Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2008-03-04 18:07:35

waynem80
New Member
Registered: 2008-03-04
Posts: 7

Ok, so I'm trying to include Vanilla's settings and people php files..

Hi, I’ve been having some problems and need a little help…

in order to track users that are logged in “Outside” the vanilla forum you:

Include these to files

include(“./appg/settings.php”);
include(“./appg/init_people.php”);

I always include them in a regular page above <!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>

Then you have this little bit of php that is used to tell whether a user is logged into vanilla or not…
I have this code in textpattern, but no luck, and yes i’m using <txp:php> tags.. :P

<?php
if ($Context->Session->UserID)
{
echo “Signed in as <b>{$Context->Session->User->Name}</b>.”;

}
else
{
echo “Welcome, Guest.”;
}
?>

Well, I can hack into publish.php and include them there, but it doesn’t seem to be picking up that a user is logged in… Why is this, it works for a page that i handcode, but not in textpattern…

Am I doing something wrong?

here’s my site: NC Golfers

Wayne

Last edited by waynem80 (2008-03-04 18:12:26)

Offline

#2 2008-03-05 07:58:19

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: Ok, so I'm trying to include Vanilla's settings and people php files..

If you’re using txp:php, you shouldn’t be using the opening and closing <?php tags.

Offline

#3 2008-03-05 15:26:49

waynem80
New Member
Registered: 2008-03-04
Posts: 7

Re: Ok, so I'm trying to include Vanilla's settings and people php files..

I’m not

Offline

#4 2008-03-05 18:56:07

waynem80
New Member
Registered: 2008-03-04
Posts: 7

Re: Ok, so I'm trying to include Vanilla's settings and people php files..

Any ideas?

Offline

#5 2008-03-05 19:00:25

iblastoff
Plugin Author
From: Toronto
Registered: 2006-06-11
Posts: 1,197
Website

Re: Ok, so I'm trying to include Vanilla's settings and people php files..

well you said you are using txp:php tags and in your code you do have <?php ?> tags as well. so which is it?

Offline

#6 2008-03-05 19:07:05

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: Ok, so I'm trying to include Vanilla's settings and people php files..

To make sure, it should be:

<txp:php>
	include("./appg/settings.php");
	include("./appg/init_people.php");
	if ($Context->Session->UserID) echo "Signed in as <strong>{$Context->Session->User->Name}</strong>.";
	else echo "Welcome, Guest.";
</txp:php>

Also check that the include paths are correct.

Offline

#7 2008-03-05 19:08:33

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,726
Website

Re: Ok, so I'm trying to include Vanilla's settings and people php files..

maybe it’s unrelated. I had a problem integrating something similar before: thread on lussumo.com


TXP Builders – finely-crafted code, design and txp

Offline

#8 2008-03-07 03:17:52

waynem80
New Member
Registered: 2008-03-04
Posts: 7

Re: Ok, so I'm trying to include Vanilla's settings and people php files..

Sorry for not clarifying better, I only use <txp:php> tags

<txp:php> include(“./appg/settings.php”); include(“./appg/init_people.php”); if ($Context->Session->UserID) echo “Signed in as <strong>{$Context->Session->User->Name}</strong>.”; else echo “Welcome, Guest.”;
</txp:php>

would be right, but the include(“./appg/settings.php”); include(“./appg/init_people.php”);
Files have to be executed first…

I’m certain the include paths are correct… When i use firebug, and look at the http headers, It’s changed to powered by vanilla…

Where to go from there who knows, it doesn’t make sense anymore…

Last edited by waynem80 (2008-03-07 03:19:17)

Offline

#9 2008-03-07 03:22:07

waynem80
New Member
Registered: 2008-03-04
Posts: 7

Re: Ok, so I'm trying to include Vanilla's settings and people php files..

jakob wrote:

maybe it’s unrelated. I had a problem integrating something similar before: thread on lussumo.com

It’s seems like i’m having a problem like you.. what did you do to solve this?

The files are getting included, but maybe they’re not executing? ….

Offline

#10 2008-03-07 07:02:29

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,726
Website

Re: Ok, so I'm trying to include Vanilla's settings and people php files..

Unfortunately, I haven’t solved it. I’d still like to know why it works standalone but not included in another framework…


TXP Builders – finely-crafted code, design and txp

Offline

#11 2008-03-07 15:53:55

waynem80
New Member
Registered: 2008-03-04
Posts: 7

Re: Ok, so I'm trying to include Vanilla's settings and people php files..

Me too.. Like I said before, if I include it into a page that i build and upload to the server, works perfectly… But not in Textpattern… which has me so confused, I dunno where to begin…

Offline

#12 2008-03-07 16:01:59

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: Ok, so I'm trying to include Vanilla's settings and people php files..

What happens in those two include files and where in the page are you trying to include them?

Offline

Board footer

Powered by FluxBB