Gossamer Forum
Home : Products : Gossamer Links : PHP Front End :

Include Links PHP files?

Quote Reply
Include Links PHP files?
 
I'm using the static build of Links with a php extension option (i.e. index.php - more2.php - Detailed/12.php) so i can add custom built PHP functions like adding the servers year date at the bottom of all my pages.

Is there a way to include some of the functionality LinksSQL page.php uses?

like checking if a user's logged in on all pages:

home.html template

<head>
<?php
include_once("/home/virtual/serverpath/Links/PHP/User.inc.php");
?>
</head>
<body>
<?if ($Username) {?>
| <a href="<%db_cgi_url%>/user.cgi?logout=1">Logout</a>
<?}?>
<?if (!$Username) {?>
| <a href="<%db_cgi_url%>/user.cgi">Login</a>
<?}?>
</body>

thanks for your help :)
Quote Reply
Re: [Chas-a] Include Links PHP files? In reply to
Try something like this to see what variables/options are available;

Quote:
<head>
<?php
include_once("/home/virtual/serverpath/Links/PHP/User.inc.php");global $GLOBALS;
foreach ($GLOBALS as $var => $val) { echo "$var => $val <BR>"; }
?>
</head>
<body>
<?if ($Username) {?>
| <a href="<%db_cgi_url%>/user.cgi?logout=1">Logout</a>
<?}?>
<?if (!$Username) {?>
| <a href="<%db_cgi_url%>/user.cgi">Login</a>
<?}?>
</body>


Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Include Links PHP files? In reply to
Hi Andy,

I tried it and that prints out all the php globals unfortunately non of them relate to the included php file (if you comment out the include_once file you get the same results).

Did you have any luck with detecting the username in this thread in the end?

http://gossamer-threads.com/...orum.cgi?post=219005

cheers,

Charlie



Comedy Quotes - Glinks 3.3.0, PageBuilder, StaticURLtr, CAPTCHA, User_Edit_Profile

Quote Reply
Re: [Chas-a] Include Links PHP files? In reply to
I never actually managed to get something to work where it showed the username. You could try replacing $GLOBAL with each of the following, and seeing if any relevant info is available;

$HTTP_SESSION_VARS
$_GET
$_POST
$POST
$GET
$COOKIE

...there are some more global ones, but I can't remember them Frown

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!