How Do I Check If A User Is Logged In ? »  Show posts from    to     

Icy Phoenix


Old Support Topics - How Do I Check If A User Is Logged In ?



AndyGpy [ Fri 04 Jan, 2013 10:22 ]
Post subject: How Do I Check If A User Is Logged In ?
I have moved to ICY 2.0, i have a seperate page that i use which is no longer working.

It checks if a user is logged in, if so then it pulls information from a database, it was fully working in 1.53, i noticed that the session management has changed so my question to you experts is

what is ICY2.0 equivalent to this ICY1.53 code

[code linenumbers=false]// standard session management
$userdata = session_pagestart($user_ip);
// Check to see if user is logged in

if ((!$userdata['session_logged_in']) )
// No he isnt
{
redirect(append_sid(LOGIN_MG . '?redirect=alerts.' . PHP_EXT));

}

else
// Yes they are
{
init_userprefs($userdata);

rest of my code
.
.


}

an how do i parse into a tpl called alertz_VIP.tpl or is the method of parsing still the same ?

regards


mort [ Fri 04 Jan, 2013 11:48 ]
Post subject: Re: How Do I Check If A User Is Logged In ?
Something like this may help?


Code: [Hide] [Select]
// Start session management
$user->session_begin();
$auth->acl($user->data);
$user->setup();
// End session management

if (!$user->data['session_logged_in'])
{
redirect(append_sid(CMS_PAGE_LOGIN . '?redirect=profile_main.' . PHP_EXT, true));
exit;
}


Note the: $user->data

And you should still be able to use the "old" template code to parse the templates.


AndyGpy [ Fri 04 Jan, 2013 15:17 ]
Post subject: Re: How Do I Check If A User Is Logged In ?
Thanks Mort, after adding your code and -- full_page_generation() , at the very end. i now have it working confusing but now i understand. one last question, if i am already logged in and i click on the link in menu to bring me to this page it opens up a login prompt which it never use to. ie it is continually forcing you to login.


mort [ Sat 05 Jan, 2013 12:09 ]
Post subject: Re: How Do I Check If A User Is Logged In ?
Then I suspect that you haven't got the menu -> link permission-protected for users and it thinks everyone is a guest?
if (! = if(not

You need something like this.

Code: [Hide] [Select]
if (!$user->data['session_logged_in']) {do this}else{do something else - or do - /* nothing */};


To be honest, I haven't had much of a look at IP2 - So some of this is patchy.


AndyGpy [ Sat 05 Jan, 2013 13:42 ]
Post subject: Re: How Do I Check If A User Is Logged In ?
I have

Code: [Hide] [Select]
if (!$user->data['session_logged_in'])

{
redirect(append_sid(CMS_PAGE_LOGIN . '?redirect=alertz_VIP.' . PHP_EXT, true));
exit;
}

else
// Yes they are
{


i have a load of code after the curley bracket to, once logged in it does as it should but each time page is called it defaults to login ?

Anyone else have any idea why i am being double logged in


mort [ Sat 05 Jan, 2013 14:15 ]
Post subject: Re: How Do I Check If A User Is Logged In ?
There are not too many things that will send you to the wrong place, so if I'm not wrong - And I usually am.

1. You don't have the redirect set properly.

2. The form action is wrong in either the php file or the template.

Here's an example using album_upload.php.
Code: [Hide] [Select]
album_upload.php

S_ALBUM_ACTION' => append_sid(album_append_uid('album_upload.' . PHP_EXT . '?cat_id=' . $cat_id)),

album_upload_body.tpl

<form name="upload" action="{S_ALBUM_ACTION}" method="post" enctype="multipart/form-data" onsubmit="{S_ON_SUBMIT}">


AndyGpy [ Thu 10 Jan, 2013 11:18 ]
Post subject: Re: How Do I Check If A User Is Logged In ?
below is the

Redirect Code :-

Code: [Hide] [Select]

if (!$user->data['session_logged_in'])

{
// No user isnt logged in
redirect(append_sid(CMS_PAGE_LOGIN . '?redirect=alertz_VIP.' . PHP_EXT, true));
exit;
}

else
// Yes they are
{

....My code is in here...

full_page_generation('alertz_VIP.tpl', '', '', '');

}





Form Action, this form is called from a link, the link being in overall_header.tpl --

<a href="http://www.scotbird.co.uk/scotforum/alertz_VIP.php" class="invert">Alertz</a>&nbsp;&nbsp;<img src="{FULL_SITE_PATH}{IMG_MENU_SEP}" alt="" />&nbsp;


This link then goes to the alertz_VIP.tpl page where the code is

Code: [Hide] [Select]


<style type="text/css">
<!--
.style7 {
color: #006600;
font-weight: bold;
font-size: 18px;
}
.style14 {color: #003300; font-weight: bold; }
.style16 {
color: #000066;
font-style: italic;
}
.style25 {
color: #FF0000;
font-weight: bold;
font-size: 12px;
}
.style28 {
font-size: 12px;
color: #330000;
}
.style29 {
font-size: 12px
}
.style31 {color: #003300; font-weight: bold; font-size: 16px; }
.style33 {
color: #000099;
font-weight: bold;
font-style: italic;
font-size: 18px;
}
.style34 {
color: #FF0000;
font-weight: bold;
font-size: 24px;
}
.style35 {font-size: 12px; color: #003300; }
.style36 {
color: #FF0000;
font-weight: bold;
font-size: 14px;
font-style: italic;
}
.style38 {color: #003300; font-weight: bold; font-size: 16px; font-style: italic; }
.style39 {font-size: x-small}
.style40 {color: #FF0000; font-weight: bold; font-size: xx-small; font-style: italic; }
-->
</style>

<!-- INCLUDE overall_header.tpl -->

<script src="Scripts/AC_RunActiveContent.js" type="text/javascript"></script>


<h1 align="center" class="style34"><blink>Scotbirds Alertz - Rare and Scarce</blink></h1>
<p align="center" class="style34 style39">&nbsp;</p>
<p align="center" class="style40">&nbsp; </p>
<h3 align="center" class="style14">If you have seen something unusual / rare then please call it in on -- <span class="style33">Hotline: 0333 5772473</span></h3>
<p align="center" class="style14">

<table width="90%" border="0" align="center" cellpadding="5">
<tr>

<td width="1%"><td width="5%"><td width="2%"><td width="2%"><td width="2%"><form action="alertz_VIP.php" method="GET">
<td width="2%"><td width="2%"><td width="5%"><span class="style38">Date</span><td width="3%"></td>
<td width="12%"><span class="style14">
<select name=DATE_FILTER size="1" id=DATE_FILTER onchange="this.form.submit()">
<option value="">Select </option>
<option value={DATE_FILTER}></option>
</select>
</span></td>
<td width="1%">&nbsp;</td>
<td width="7%"><span class="style16"><span class="style14"><span class="style31">Region</span></span></span></td>

<td width="22%"><span class="style16"><span class="style14">
<select name=REGION_FILTER size="1" id=REGION_FILTER onchange="this.form.submit()">
<option value="">Select </option>
<option value={REGION_FILTER}></option>
</select>
</span></span></td>
<td width="1%">&nbsp;</td>

<td width="8%"><span class="style16"><span class="style14"><span class="style31">Species</span></span></span></td>
<td width="10%"><span class="style16"><span class="style14">
<select name=SPECIES_FILTER size="1" id=SPECIES_FILTER onchange="this.form.submit()">
<option value="">Select </option>
<option value={SPECIES_FILTER}></option>
</select>
</span></span></td>

<td width="10%"><!-- Begin FreeButtons.org -->
<style>#web-buttons-id2nj62 a{display:block;color:transparent;} #web-buttons-id2nj62 a:hover{background-position:left bottom;}a#web-buttons-id2nj62a {display:none}</style>
<table id="web-buttons-id2nj62" width=0 cellpadding=0 cellspacing=0 border=0><tr>
<td style="padding-right:0px" title ="Reset Search">
<a href="http://www.scotbird.co.uk/Forum/alertz_VIP.php" title="Reset Search" style="background-image:url(images/bt2nj62.png);width:151px;height:34px;display:block;"><br/></a></td>
</tr></table><a id="web-buttons-id2nj62a"></a>
<!-- End FreeButtons.org --></td>

</table>
<p>&nbsp;</p>
<table width="870" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#99CC99">

<tr>
<th width="178" class="style31" scope="col">Region</th>
<th width="184" class="style31" scope="col">Species</th>
<th width="96" class="style31" scope="col">Date</th>
<th width="96" class="style31" scope="col">Time</th>
<th width = "304" class="style31" scope="col">Comments</th>
</tr>
<!-- BEGIN alerts -->
<tr>
<th class="style7 style29" scope="col">{alerts.REGION}</th>
<th class="style25" scope="col">{alerts.SPECIES}</th>
<th class="style35" scope="col">{alerts.DATE} </th>
<th scope="col"><span class="style35">{alerts.TIME} </span></th>
<th scope="col"><span class="style28">{alerts.COMMENTS} </span></th>
</tr>
<!-- END alerts -->
</table>
<p align="center" class="style14">&nbsp;</p>


<!-- INCLUDE overall_footer.tpl -->



Scenario 1

I am a user that has not logged in, i go direct to this page http://www.scotbird.co.uk/scotforum/alertz_VIP.php and i get redirected to the login, once logged in i can view.

Scenario 2

I am a LOGGED IN USER and browse to the page http://www.scotbird.co.uk/scotforum/alertz_VIP.php and i get asked to re-login.

Can someone assist Mort and help me resolve this as i am going nutz.

Also how do i change the page title in ICY2.0 ?

regards


mort [ Thu 10 Jan, 2013 11:48 ]
Post subject: Re: How Do I Check If A User Is Logged In ?
AndyGpy wrote: [View Post]
Can someone assist Mort and help me resolve this as I am going nutz.


If you are losing sleep over this - Then offer MG $50 bucks to fix it. After all, It's a "Private" MOD, and I don't think that many people are going to put themselves out trying to help resolve it.

In other words - If I or others could personally install it on v*53 - I or others maybe could upgrade it for v2 - IF it had ever been released here with install instructions.

And no offence - The bottom line is like me posting a whole heap of unknown script and asking "How do I fix this" ?

Quote:
Also how do I change the page title in ICY2.0 ?


I suspect that you need to add the "location" to => functions_online.php


AndyGpy [ Thu 10 Jan, 2013 13:35 ]
Post subject: Re: How Do I Check If A User Is Logged In ?
Mort,

I never released it as a mod as it is a custom page that displays information from a database ( single ) , and my skillz i feel are not strong with regards to IP hence since it was for personal use i did not release, but i did follow all guidelines when creating it in 1.53.

I take on board what you are saying that it is beyond yourself hence the reason why i am asking if there is anyone else. when i first joined IP there was many who helped with issues, now it seems only a few.

regards


Mighty Gorgon [ Thu 10 Jan, 2013 14:33 ]
Post subject: Re: How Do I Check If A User Is Logged In ?
The code suggested for checking if the users is logged in should work properly... make sure the whole file is coded properly, here is how it should look from the beginning:

Code: [Hide] [Select]
define('IN_ICYPHOENIX', true);
if (!defined('IP_ROOT_PATH')) define('IP_ROOT_PATH', './');
if (!defined('PHP_EXT')) define('PHP_EXT', substr(strrchr(__FILE__, '.'), 1));
include(IP_ROOT_PATH . 'common.' . PHP_EXT);

// Start session management
$user->session_begin();
$auth->acl($user->data);
$user->setup();
// End session management

if (!$user->data['session_logged_in'])
{
redirect(append_sid(CMS_PAGE_LOGIN . '?redirect=alertz_VIP.' . PHP_EXT, true));
exit;
}


If this code isn't working you have errors somewhere else... try to paste here even the initial part of the code of the file.


AndyGpy [ Thu 10 Jan, 2013 15:19 ]
Post subject: Re: How Do I Check If A User Is Logged In ?
MG

Code: [Hide] [Select]

define('MG_KILL_CTRACK', true);
define('IN_ICYPHOENIX', true);

if (!defined('IP_ROOT_PATH')) define('IP_ROOT_PATH', './');
if (!defined('PHP_EXT')) define('PHP_EXT', substr(strrchr(__FILE__, '.'), 1));

// Include files
include(IP_ROOT_PATH . 'common.' . PHP_EXT);
include_once(IP_ROOT_PATH . 'includes/functions.' . PHP_EXT);
include(IP_ROOT_PATH . '/alerts/alertsconfig.'.PHP_EXT);

// Page Authorise
$cms_page_id = 'scotalertz';
$cms_page_nav = (empty($cms_config_layouts[$cms_page_id]['page_nav']) ? true : false);
$cms_global_blocks = (!empty($cms_config_layouts[$cms_page_id]['global_blocks']) ? true : false);
$cms_auth_level = (isset($cms_config_layouts[$cms_page_id]['view']) ? $cms_config_layouts[$cms_page_id]['view'] : AUTH_ALL);
check_page_auth($cms_page_id, $cms_auth_level);

// Obtain Select Criteria
$temp_region_filter = $_GET["REGION_FILTER"];
$temp_species_filter = $_GET["SPECIES_FILTER"];
$temp_date_filter = $_GET["DATE_FILTER"];

// Filter characters if required
$region_filter =str_replace(" & ", "&", $temp_region_filter);
$species_filter = $temp_species_filter;
$date_filter = $temp_date_filter;



// Start session management
$user->session_begin();
$auth->acl($user->data);
$user->setup();
// End session management

if (!$user->data['session_logged_in'])

{
redirect(append_sid(CMS_PAGE_LOGIN . '?redirect=alertz_VIP.' . PHP_EXT, true));
exit;
}

else
// Yes they are
{
//init_userprefs($userdata);
// set page title
$page_title = "ScotBird alerts - VIP's ONLY !! ";
// standard page header
//include(IP_ROOT_PATH . 'includes/page_header.'.PHP_EXT);
// Connect to the database
$dbnew = new sql_db($alerts_mysql_host,$alerts_mysql_username,$alerts_mysql_password,$alerts_mysql_db,false);
if(!$dbnew)
{
die("Database Connection Failed:- Please Contact Site Admin" . mysql_error());
}
//$template->set_filenames(array('body' => 'alertz_VIP.tpl'));
//$template->_tpldata['alertz_VIP.'] = array();
// Some consistant Variables
$year =date("Y");
$month = date("m");
$day = date("d");

function datedropdown_funct($switchstring)
{
$year =date("Y");
$month = date("m");
$day = date("d");
switch ($switchstring

{

case "Today":
$day = date("d");
$retval = '<option value="">Select</option><option value="Today" SELECTED>Today</option><option value="Last 48hrs">Last 48hrs</option><option value="Last week">Last Week</option><option value="last month">Last Month</option>';
break;
case "Last 48hrs":
$day = date("d")-1;
$retval = '<option value="">Select</option><option value="Today">Today</option><option value="Last 48hrs" SELECTED>Last 48hrs</option><option value="Last week">Last Week</option><option value="last month">Last Month</option>';
break;
case "Last week":
$day = date("d")-7;
$retval = '<option value="">Select</option><option value="Today">Today</option><option value="Last 48hrs">Last 48hrs</option><option value="Last week" SELECTED>Last Week</option><option value="last month">Last Month</option>';
break;
case "last month":
$month = date("m")-1;
$retval = '<option value="">Select</option><option value="Today">Today</option><option value="Last 48hrs">Last 48hrs</option><option value="Last week">Last Week</option><option value="last month" SELECTED>Last Month</option>';
break;
case "last 3 months":
$month = date("m")-3;
$retval = '<option value="">Select</option><option value="Today">Today</option><option value="Last 48hrs">Last 48hrs</option><option value="Last week">Last Week</option><option value="last month">Last Month</option><option value="last 3 months" SELECTED>Last 3 Month</option>';
break;
default:
// Default is the last 48hrs
$day = date("d")-3;

}
$thestartdatecalc = $year . '-' .$month . '-' . $day ;
// echo $thestartdate;
return array($retval, $thestartdatecalc);
}


$theenddate = $year . '-' .$month . '-' . $day ;

// Check if the Date is Set
if(isset($date_filter) and strlen($date_filter) > 0)
{
// The date is Set
// echo "Date is Set :- " . $date_filter . " - ";
// Check to see if Region is set
if(isset($region_filter) and strlen($region_filter) > 0)
{
// The region is set
// echo "Region is Set :- " . $region_filter . " - ";
// Check to see if species is set
if(isset($species_filter) and strlen($species_filter) > 0)
{
// The species is set
// echo "Species is Set :- " . $species_filter . " - ";
list($arr1, $arr2) = datedropdown_funct($date_filter);
$date_filter_options= $arr1;
$thestartdate.= $arr2;
$sql2 = "SELECT * FROM alerts WHERE Date BETWEEN '".$thestartdate ."' AND '".$theenddate ."' AND region = '".$region_filter ."' AND species = '".$species_filter ."' ORDER BY Date DESC, time DESC ";
$sql3 = "SELECT DISTINCT species FROM alerts WHERE Date BETWEEN '".$thestartdate ."' AND '".$theenddate ."' AND region = '". $region_filter . "' GROUP BY species";
$sql = "SELECT DISTINCT region FROM alerts WHERE Date BETWEEN '".$thestartdate ."' AND '".$theenddate ."' AND species = '".$species_filter ."' GROUP BY region";

}
else
{
// The species is Not Set
// echo "Species is NOT set - ";
list($arr1, $arr2) = datedropdown_funct($date_filter);
$date_filter_options= $arr1;
$thestartdate.= $arr2;
$sql2 = "SELECT * FROM alerts WHERE Date BETWEEN '".$thestartdate ."' AND '".$theenddate ."' AND region = '".$region_filter ."' ORDER BY Date DESC, time DESC ";
$sql3 = "SELECT DISTINCT species FROM alerts WHERE Date BETWEEN '".$thestartdate ."' AND '".$theenddate ."' AND region = '". $region_filter . "' GROUP BY species";
$sql = "SELECT DISTINCT region FROM alerts WHERE Date BETWEEN '".$thestartdate ."' AND '".$theenddate ."' GROUP BY region";


}
}
else
{
// The region is not set
// echo "Region is NOT set - ";
// Check to see if species is set
if(isset($species_filter) and strlen($species_filter) > 0)
{
// The species is set
// echo "Species is Set :- " . $species_filter . " - ";
list($arr1, $arr2) = datedropdown_funct($date_filter);
$date_filter_options= $arr1;
$thestartdate.= $arr2;
$sql2 = "SELECT * FROM alerts WHERE Date BETWEEN '".$thestartdate ."' AND '".$theenddate ."' AND species = '".$species_filter ."' ORDER BY Date DESC, time DESC ";
$sql3 = "SELECT DISTINCT species FROM alerts WHERE Date BETWEEN '".$thestartdate ."' AND '".$theenddate ."' GROUP BY species";
$sql = "SELECT DISTINCT region FROM alerts WHERE Date BETWEEN '".$thestartdate ."' AND '".$theenddate ."' AND species = '".$species_filter ."' GROUP BY region";
}
else
{
// The species is NOT Set
// echo "Species is NOT set - ";
list($arr1, $arr2) = datedropdown_funct($date_filter);
$date_filter_options= $arr1;
$thestartdate.= $arr2;
$sql2 = "SELECT * FROM alerts WHERE Date BETWEEN '".$thestartdate ."' AND '".$theenddate ."' ORDER BY Date DESC, time DESC ";
$sql3 = "SELECT DISTINCT species FROM alerts WHERE Date BETWEEN '".$thestartdate ."' AND '".$theenddate ."' GROUP BY species";
$sql = "SELECT DISTINCT region FROM alerts WHERE Date BETWEEN '".$thestartdate ."' AND '".$theenddate ."' GROUP BY region";
}
}
}
else
{
// The date is not set
$date_filter_options = '<option value="">Select</option><option value="Today">Today</option><option value="Last 48hrs">Last 48hrs</option><option value="Last week">Last Week</option><option value="last month">Last Month</option>';
// echo "Date is NOT set - ";
// Check to see if Region is set
if(isset($region_filter) and strlen($region_filter) > 0)
{
// The region is set
// echo "Region is Set :- " . $region_filter . " - ";
// Check to see if species is set
if(isset($species_filter) and strlen($species_filter) > 0)
{
// The species is Set
// echo "Species is Set :- " . $species_filter . " - ";
// Build the SQL strings
$sql2 = "SELECT * FROM alerts WHERE species ='".$species_filter ."' AND region = '".$region_filter ."' ORDER BY Date DESC, time DESC ";
$sql = "SELECT DISTINCT region FROM alerts WHERE species ='".$species_filter ."' GROUP BY region";
$sql3 = "SELECT DISTINCT species FROM alerts WHERE region ='".$region_filter ."' GROUP BY species";
//

}
else
{
// The species is not set
// echo "Species is NOT set - ";
$sql2 = "SELECT * FROM alerts WHERE region = '".$region_filter ."' ORDER BY Date DESC, time DESC ";
$sql = "SELECT DISTINCT region FROM alerts WHERE species ='".$species_filter ."' GROUP BY region";
$sql3 = "SELECT DISTINCT species FROM alerts WHERE region ='".$region_filter ."' GROUP BY species";
}

}
else
{
// The region is Set
// echo "Region is NOT set - ";
// Check to see if species is set
if(isset($species_filter) and strlen($species_filter) > 0)
{
// The species is Set
// echo "Species is Set :- " . $species_filter . " - " ;

// Build the SQL strings
$sql2 = "SELECT * FROM alerts WHERE species ='".$species_filter ."' ORDER BY Date DESC, time DESC ";
$sql = "SELECT DISTINCT region FROM alerts GROUP BY region";
$sql3 = "SELECT DISTINCT species FROM alerts WHERE species ='".$species_filter ."' GROUP BY species";
//



}
else
{
// The species is not set
// echo "Species is NOT set - ";

// We will only display 5 days worth of Data
$year =date("Y");
$month = date("m");
$day = date("d")-3;
$thestartdate = $year . '-' .$month . '-' . $day ;
// Build the SQL strings
$sql2 = "SELECT * FROM alerts WHERE Date BETWEEN '".$thestartdate ."' AND '".$theenddate ."' ORDER BY Date DESC, time DESC ";
$sql3 = "SELECT DISTINCT species FROM alerts GROUP BY species";
$sql = "SELECT DISTINCT region FROM alerts GROUP BY region";
}
}
}


$result2 = $db->sql_query($sql2);
if (!($result2 = $db->sql_query($sql2)))
{
die("Database Query Failed" . mysql_error());
}
$i = 1;

while ( $row2 = $db->sql_fetchrow($result2) )
{
//if (($userdata['user_rank2'] == 5))
//{
$template->assign_block_vars('alerts', array( 'POS' => $i ,
'REGION' => str_replace("&", " & ", $row2['region']),
'SPECIES' => str_replace("%", "'",$row2['species']),
'DATE' => $row2['Date'],
'TIME' => $row2['time'],
'COMMENTS' => str_replace("'", "%",$row2['comments']),
)
);
$i++;
//}
//else
//{
// $template->assign_block_vars('alerts', array( 'POS' => $i ,
// 'REGION' => "VIP MEMBERS ONLY",
// 'SPECIES' => str_replace("%", "'",$row2['species']),
// 'DATE' => $row2['Date'],
// 'TIME' => $row2['time'],
// 'COMMENTS' => "Become a VIP and get full access",
// )
// );
//$i++;
//}
}

$template->assign_vars(array(
'USERNAME' => htmlspecialchars($user->data[username]),
'REGION_FILTER' => str_replace("&", " & ", $region_filter_options),
'SPECIES_FILTER' => $species_filter_options,
)
);




$result = $db->sql_query($sql2);

if (!($result = $db->sql_query($sql2)))
{
die("Database Query Failed" . mysql_error());
}

// This is where you would add a new VARS Array if you intend to use your own custom VARS.





while ($row = $db->sql_fetchrow($result))
{
$selected = (isset($_GET['REGION_FILTER']) AND $_GET['REGION_FILTER']==$row['region']) ? ' selected="selected"' : '' ;
$region_filter_options .= "<option value=\"{$row['region']}\"{$selected}>{$row['region']}</option>\n";
}



$result = $db->sql_query($sql3);

if (!($result = $db->sql_query($sql3)))
{
die("Database Query Failed" . mysql_error());
}

// This is where you would add a new VARS Array if you intend to use your own custom VARS.
while ($row = $db->sql_fetchrow($result))
{
$selected = (isset($_GET['SPECIES_FILTER']) AND $_GET['SPECIES_FILTER']==$row['species']) ? ' selected="selected"' : '' ;
$species_filter_options .= "<option value=\"{$row['species']}\"{$selected}>{$row['species']}</option>\n";
}

//while ($row = $db->sql_fetchrow($result))
// {
// if(isset($species_filter) AND $species_filter == $row['species'])
// //if($species_filter = $row['species'] AND strlen($species_filter) > 0)
// {
// $species_filter_options .= '<option value="' . $row['species'] . '" SELECTED>' . $row['species'] . '</option>';
// }
// else
// {
// $species_filter_options .= '<option value="' . $row['species'] . '">' . $row['species'] . '</option>';
// }
// }


$template->assign_vars(array(
'USERNAME' => htmlspecialchars($user->data[username]),
'REGION_FILTER' => str_replace("&", " & ", $region_filter_options),
'SPECIES_FILTER' => $species_filter_options,

)
);


$template->assign_vars(array(
'USERNAME' => htmlspecialchars($user->data[username]),
'DATE_FILTER' => $date_filter_options,
)
);

// Build the page
//$template->pparse('body');

//full_page_generation();
full_page_generation('alertz_VIP.tpl', $lang['me'], 'this page is', '');

}
?>



Full code of my file, when i get home i will try what you suggest


mort [ Fri 11 Jan, 2013 12:37 ]
Post subject: Re: How Do I Check If A User Is Logged In ?
Andy, Please have a look at the what MG posted, as you have to define the session etc before you start adding anything else.

You've got it halfway down the script, where it's not meant to be?

And "Please" Wrap your scripts in the spoiler.


AndyGpy [ Fri 11 Jan, 2013 16:34 ]
Post subject: Re: How Do I Check If A User Is Logged In ?
I have tried what MG has suggested, later when i am at home i will repost what i have at present.

Regards


mort [ Sat 12 Jan, 2013 10:40 ]
Post subject: Re: How Do I Check If A User Is Logged In ?
And I'm sorry I was so blunt.

Because I should have added in the "Reasons why the path goes awry" is that if the session is lost everything falls apart. And the biggest problem that causes that is adding the "header" script too late.



Mighty Gorgon [ Sun 13 Jan, 2013 20:22 ]
Post subject: Re: How Do I Check If A User Is Logged In ?
Andy, did you check if it works?


AndyGpy [ Mon 14 Jan, 2013 13:58 ]
Post subject: Re: How Do I Check If A User Is Logged In ?
MG,

Tried what you suggested and it did not work out. Still the same.

What i have now done is removed all code so that all i have is :-

alertz_VIP.php

Code: [Hide] [Select]

define('IN_ICYPHOENIX', true);
if (!defined('IP_ROOT_PATH')) define('IP_ROOT_PATH', './');
if (!defined('PHP_EXT')) define('PHP_EXT', substr(strrchr(__FILE__, '.'), 1));

// Include files
include(IP_ROOT_PATH . 'common.' . PHP_EXT);


//Start session management
$user->session_begin();
$auth->acl($user->data);
$user->setup();
//End session management


if (!$user->data['session_logged_in'])

{

redirect(append_sid(CMS_PAGE_LOGIN . '?redirect=alertz_VIP.' . PHP_EXT, true));
exit;
}

else
// Yes they are
{
$template->assign_vars(array(
'USERNAME' => htmlspecialchars($user->data[username]),
)
);

//full_page_generation();
full_page_generation('alertz_VIP.php', , '', '');

}



and the template alertz_VIP.tpl

Code: [Hide] [Select]

<style type="text/css">
<!--
.style7 {
color: #006600;
font-weight: bold;
font-size: 18px;
}
.style14 {color: #003300; font-weight: bold; }
.style16 {
color: #000066;
font-style: italic;
}
.style25 {
color: #FF0000;
font-weight: bold;
font-size: 12px;
}
.style28 {
font-size: 12px;
color: #330000;
}
.style29 {
font-size: 12px
}
.style31 {color: #003300; font-weight: bold; font-size: 16px; }
.style33 {
color: #000099;
font-weight: bold;
font-style: italic;
font-size: 18px;
}
.style34 {
color: #FF0000;
font-weight: bold;
font-size: 24px;
}
.style35 {font-size: 12px; color: #003300; }
.style36 {
color: #FF0000;
font-weight: bold;
font-size: 14px;
font-style: italic;
}
.style38 {color: #003300; font-weight: bold; font-size: 16px; font-style: italic; }
.style39 {font-size: x-small}
.style40 {color: #FF0000; font-weight: bold; font-size: xx-small; font-style: italic; }
-->
</style>

<!-- INCLUDE overall_header.tpl -->


<h1 align="center" class="style34"><blink>Scotbirds Alertz - Rare and Scarce</blink></h1>
<p align="center" class="style34 style39">&nbsp;</p>
<p align="center" class="style40">&nbsp; </p>
<h3 align="center" class="style14">If you have seen something unusual / rare then please call it in on -- <span class="style33">Hotline: 0333 5772473</span></h3>
<p align="center" class="style14">

<table width="90%" border="0" align="center" cellpadding="5">
<tr>

<td width="1%"><td width="5%"><td width="2%"><td width="2%"><td width="2%"><form action="alertz_VIP.php" method="GET">
<td width="2%"><td width="2%"><td width="5%"><span class="style38">Date</span><td width="3%"></td>
<td width="12%"><span class="style14">
<select name=DATE_FILTER size="1" id=DATE_FILTER onchange="this.form.submit()">
<option value="">Select </option>
<option value={DATE_FILTER}></option>
</select>
</span></td>
<td width="1%">&nbsp;</td>
<td width="7%"><span class="style16"><span class="style14"><span class="style31">Region</span></span></span></td>

<td width="22%"><span class="style16"><span class="style14">
<select name=REGION_FILTER size="1" id=REGION_FILTER onchange="this.form.submit()">
<option value="">Select </option>
<option value={REGION_FILTER}></option>
</select>
</span></span></td>
<td width="1%">&nbsp;</td>

<td width="8%"><span class="style16"><span class="style14"><span class="style31">Species</span></span></span></td>
<td width="10%"><span class="style16"><span class="style14">
<select name=SPECIES_FILTER size="1" id=SPECIES_FILTER onchange="this.form.submit()">
<option value="">Select </option>
<option value={SPECIES_FILTER}></option>
</select>
</span></span></td>

<td width="10%"><!-- Begin FreeButtons.org -->
<style>#web-buttons-id2nj62 a{display:block;color:transparent;} #web-buttons-id2nj62 a:hover{background-position:left bottom;}a#web-buttons-id2nj62a {display:none}</style>
<table id="web-buttons-id2nj62" width=0 cellpadding=0 cellspacing=0 border=0><tr>
<td style="padding-right:0px" title ="Reset Search">
<a href="http://www.scotbird.co.uk/Forum/alertz_VIP.php" title="Reset Search" style="background-image:url(images/bt2nj62.png);width:151px;height:34px;display:block;"><br/></a></td>
</tr></table><a id="web-buttons-id2nj62a"></a>
<!-- End FreeButtons.org --></td>

</table>
<p>&nbsp;</p>
<table width="870" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#99CC99">

<tr>
<th width="178" class="style31" scope="col">Region</th>
<th width="184" class="style31" scope="col">Species</th>
<th width="96" class="style31" scope="col">Date</th>
<th width="96" class="style31" scope="col">Time</th>
<th width = "304" class="style31" scope="col">Comments</th>
</tr>
<!-- BEGIN alerts -->
<tr>
<th class="style7 style29" scope="col">{alerts.REGION}</th>
<th class="style25" scope="col">{alerts.SPECIES}</th>
<th class="style35" scope="col">{alerts.DATE} </th>
<th scope="col"><span class="style35">{alerts.TIME} </span></th>
<th scope="col"><span class="style28">{alerts.COMMENTS} </span></th>
</tr>
<!-- END alerts -->
</table>
<p align="center" class="style14">&nbsp;</p>


<!-- INCLUDE overall_footer.tpl -->



using any user to login gets the same results

A -- i am logged into website already and click on the link to this page, i get faced with the log in screen, once i log in a second time i can access this page
B -- I am NOT logged in and browse to this page direct, i get asked to login then it goes to the page

User - test
password - test

website - HERE

Link called alertz only appears once a user is logged in and can be found up near the header logo.



Any suggestions


mort [ Mon 14 Jan, 2013 14:18 ]
Post subject: Re: How Do I Check If A User Is Logged In ?
Just one - Turn on error reporting when you do these things.

'USERNAME' => htmlspecialchars($user->data[username]),

And it would have probably said something like "Undefined CONSTANT"

data[username]), != data['username']),

Well I hope that's the problem.


AndyGpy [ Mon 14 Jan, 2013 15:59 ]
Post subject: Re: How Do I Check If A User Is Logged In ?
Changed

data[username]

to

data['username']

still the same


mort [ Mon 14 Jan, 2013 21:34 ]
Post subject: Re: How Do I Check If A User Is Logged In ?
You're not setting cookies and the test account thinks I'm an Admin?

ACP
CMS

Home
Profile
Forum

Without cookies, you can't log sessions.

Can I suggest that you upgrade this again and go through one thing at a time as you are modding it, because somewhere you are killing it.

Here's a couple of tools that just saved my life -

Put them at the top of index.php ? and and keep that page in the browser while you play in another window.

Code: [Hide] [Select]
foreach($_SESSION as $key => $value) {
echo 'Current session variable ' . $key . ' is: ' . $value . '<br />';
}

print_r($_COOKIE);


AndyGpy [ Wed 16 Jan, 2013 22:26 ]
Post subject: Re: How Do I Check If A User Is Logged In ?
Right guys,

getting closer i think.

i know the alertz.php and the .tpl files are okay the problem lies when i am logged in and click on the link to go to the alertz page it forgets about the session ID and kicks me to the log in screen.

THe link i have in the header sectiion is

<a href="{FULL_SITE_PATH}/alertz_VIP.php" class="invert">Alertz</a>&nbsp;&nbsp;<img src="{FULL_SITE_PATH}{IMG_MENU_SEP}" alt="" />&nbsp;

how can i get it so the session ID is kept like any other link i have ?

I am sure i have cookies on, as i have set cookie path etc.


mort [ Wed 16 Jan, 2013 23:10 ]
Post subject: Re: How Do I Check If A User Is Logged In ?
AndyGpy wrote: [View Post]
I am sure i have cookies on, as i have set cookie path etc.


Andy, you were not setting SESSIONS on anything, anywhere - Cookies either

And the fact that you have set a cookie path, means nothing if cookies are not being created.

Even without cookies - SESSIONS normally handles the user-security.

You have neither.

Go to your browser (if it's not fixed) and check if there are any current cookies or sessions for your site.


AndyGpy [ Thu 17 Jan, 2013 08:09 ]
Post subject: Re: How Do I Check If A User Is Logged In ?
ok Mort in Icy terms how to i set sessions then as i thought

//Start session management
$user->session_begin();
$auth->acl($user->data);
$user->setup();
//End session management

created the session ?

regards


mort [ Thu 17 Jan, 2013 08:28 ]
Post subject: Re: How Do I Check If A User Is Logged In ?
Not IP - -

But as an example.

You query the DB for the information.

Code: [Hide] [Select]
$row = $db->fetch_row($sql);
if($row['activation_key'] == "0"){
$_SESSION['username'] = $username;
$_SESSION['userid'] = $row['userid'];
$_SESSION['website'] = $row['website'];
$_SESSION['blog_level'] = $row['blog_level'];
$_SESSION['lang'] = $row['user_lang'];
$_SESSION['user_flag'] = $row['user_flag'];
$_SESSION['user_style'] = $row['user_style'];
$_SESSION['user_session_time'] = $row['user_session_time'];


Then start the session in a "Global" file by adding:

Code: [Hide] [Select]
session_start();


At the top of the file.

Code: [Hide] [Select]
$user->session_begin();


Would be a function that collects all the users data. If they are logged in.?

That too - would need to be at the top of every file the user has access to.

Because if it's not S_LOGGED_IN or S_LOGGED-OUT Means nothing.


AndyGpy [ Thu 17 Jan, 2013 11:06 ]
Post subject: Re: How Do I Check If A User Is Logged In ?
Could you perhaps give me an example based on what i am trying to achieve, i am not a PHP developer, i am a VB man and learning as i go with PHP


mort [ Thu 17 Jan, 2013 12:18 ]
Post subject: Re: How Do I Check If A User Is Logged In ?
AndyGpy wrote: [View Post]
Could you perhaps give me an example based on what i am trying to achieve, i am not a PHP developer, i am a VB man and learning as i go with PHP


I hate to be blunt, but by using GPL/GNU software you are expected to sort these things yourself. If it was an Icy Phoenix problem that would be different. But it's not.

Consider this - After you - There's someone else - Then someone else again. So somewhere the free ride on other people's time has to have a line drawn under it. And I've just drawn the line under mine on this subject.

Some time ago I was told this at Coppermine:

Quote:
If you can't fix it, then learn how to do it, or pay someone who can.


And that's what GPL/GNU is - Or you can just wait until someone else wants to be involved some more.


AndyGpy [ Thu 17 Jan, 2013 12:39 ]
Post subject: Re: How Do I Check If A User Is Logged In ?
Mort

The purpose of the forum that i am led to beleive is for more experienceed members to help others where they can, that way they game experience and can then offer to help others.

If that is your attitude towards support, ie pay for it then, i had already PM'ed MG asking and fully prepared to pay.

I have looked at several other pages profile.php, memberlist.php etc looking on how the session id is retained and cannot figure it out hence the reason i am asking for support.

As explained i am fully up for learning and i am a long way from being a PHP developer.

You keep going on about sessions and cookies, now lets explore that further.

I have taken profile.php, which we all know works wonderfully. I create a link to it in my header and when clicked the session ID is lost and you are asked to log in.

Perhaps now you can understand my frustration. I am using the code as shown by MG in his tutorials but i am still having problems, ask for support and basically getting told to pay for such.

I too , like you am a VIP and i dont have any issue supporting this site as i have recieved support from it myself in the past but now im basically being told fix it yourself.

regards


mort [ Thu 17 Jan, 2013 14:39 ]
Post subject: Re: How Do I Check If A User Is Logged In ?
You don't take enough care Andy.

This all works for me - - Ten minutes.

And please DON'T change anything until you test it.

Code: [Hide] [Select]
<?php

define('IN_ICYPHOENIX', true);
if (!defined('IP_ROOT_PATH')) define('IP_ROOT_PATH', './');
if (!defined('PHP_EXT')) define('PHP_EXT', substr(strrchr(__FILE__, '.'), 1));

// Include files
include(IP_ROOT_PATH . 'common.' . PHP_EXT);


//Start session management
$user->session_begin();
$auth->acl($user->data);
$user->setup();
//End session management


if (!$user->data['session_logged_in'])

{

redirect(append_sid(CMS_PAGE_LOGIN . '?redirect=alertz_VIP.' . PHP_EXT, true));
exit;
}

else
// Yes they are
{
$template->assign_vars(array(
'USERNAME' => htmlspecialchars($user->data[username]),
)
);

//full_page_generation();
full_page_generation('alertz_VIP.tpl', '', '');

}
?>




Code: [Hide] [Select]
<style type="text/css">
<!--
.style7 {
color: #006600;
font-weight: bold;
font-size: 18px;
}
.style14 {color: #003300; font-weight: bold; }
.style16 {
color: #000066;
font-style: italic;
}
.style25 {
color: #FF0000;
font-weight: bold;
font-size: 12px;
}
.style28 {
font-size: 12px;
color: #330000;
}
.style29 {
font-size: 12px
}
.style31 {color: #003300; font-weight: bold; font-size: 16px; }
.style33 {
color: #000099;
font-weight: bold;
font-style: italic;
font-size: 18px;
}
.style34 {
color: #FF0000;
font-weight: bold;
font-size: 24px;
}
.style35 {font-size: 12px; color: #003300; }
.style36 {
color: #FF0000;
font-weight: bold;
font-size: 14px;
font-style: italic;
}
.style38 {color: #003300; font-weight: bold; font-size: 16px; font-style: italic; }
.style39 {font-size: x-small}
.style40 {color: #FF0000; font-weight: bold; font-size: xx-small; font-style: italic; }
-->
</style>

<!-- INCLUDE overall_header.tpl -->


<h1 align="center" class="style34"><blink>Scotbirds Alertz - Rare and Scarce</blink></h1>
<p align="center" class="style34 style39">&nbsp;</p>
<p align="center" class="style40">&nbsp; </p>
<h3 align="center" class="style14">If you have seen something unusual / rare then please call it in on -- <span class="style33">Hotline: 0333 5772473</span></h3>
<p align="center" class="style14">

<table width="90%" border="0" align="center" cellpadding="5">
<tr>

<td width="1%"><td width="5%"><td width="2%"><td width="2%"><td width="2%"><form action="alertz_VIP.php" method="GET">
<td width="2%"><td width="2%"><td width="5%"><span class="style38">Date</span><td width="3%"></td>
<td width="12%"><span class="style14">
<select name=DATE_FILTER size="1" id=DATE_FILTER onchange="this.form.submit()">
<option value="">Select </option>
<option value={DATE_FILTER}></option>
</select>
</span></td>
<td width="1%">&nbsp;</td>
<td width="7%"><span class="style16"><span class="style14"><span class="style31">Region</span></span></span></td>

<td width="22%"><span class="style16"><span class="style14">
<select name=REGION_FILTER size="1" id=REGION_FILTER onchange="this.form.submit()">
<option value="">Select </option>
<option value={REGION_FILTER}></option>
</select>
</span></span></td>
<td width="1%">&nbsp;</td>

<td width="8%"><span class="style16"><span class="style14"><span class="style31">Species</span></span></span></td>
<td width="10%"><span class="style16"><span class="style14">
<select name=SPECIES_FILTER size="1" id=SPECIES_FILTER onchange="this.form.submit()">
<option value="">Select </option>
<option value={SPECIES_FILTER}></option>
</select>
</span></span></td>

<td width="10%"><!-- Begin FreeButtons.org -->
<style>#web-buttons-id2nj62 a{display:block;color:transparent;} #web-buttons-id2nj62 a:hover{background-position:left bottom;}a#web-buttons-id2nj62a {display:none}</style>
<table id="web-buttons-id2nj62" width=0 cellpadding=0 cellspacing=0 border=0><tr>
<td style="padding-right:0px" title ="Reset Search">
<a href="http://www.scotbird.co.uk/Forum/alertz_VIP.php" title="Reset Search" style="background-image:url(images/bt2nj62.png);width:151px;height:34px;display:block;"><br/></a></td>
</tr></table><a id="web-buttons-id2nj62a"></a>
<!-- End FreeButtons.org --></td>

</table>
<p>&nbsp;</p>
<table width="870" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#99CC99">

<tr>
<th width="178" class="style31" scope="col">Region</th>
<th width="184" class="style31" scope="col">Species</th>
<th width="96" class="style31" scope="col">Date</th>
<th width="96" class="style31" scope="col">Time</th>
<th width = "304" class="style31" scope="col">Comments</th>
</tr>
<!-- BEGIN alerts -->
<tr>
<th class="style7 style29" scope="col">{alerts.REGION}</th>
<th class="style25" scope="col">{alerts.SPECIES}</th>
<th class="style35" scope="col">{alerts.DATE} </th>
<th scope="col"><span class="style35">{alerts.TIME} </span></th>
<th scope="col"><span class="style28">{alerts.COMMENTS} </span></th>
</tr>
<!-- END alerts -->
</table>
<p align="center" class="style14">&nbsp;</p>


<!-- INCLUDE overall_footer.tpl -->


AndyGpy [ Thu 17 Jan, 2013 15:17 ]
Post subject: Re: How Do I Check If A User Is Logged In ?
Mort,

I have done as you asked,


Content Encoding Error


The page you are trying to view cannot be shown because it uses an invalid or unsupported form of compression.


Please contact the web site owners to inform them of this problem.



i am using firefox

regards


Informpro [ Thu 17 Jan, 2013 16:05 ]
Post subject: Re: How Do I Check If A User Is Logged In ?
Disable gzip encoding


AndyGpy [ Thu 17 Jan, 2013 17:22 ]
Post subject: Re: How Do I Check If A User Is Logged In ?
thanks informpro thats fixed that but i still have original problem double login for anything i access of my menu in my header

if i manual type in www.scotbird.co.uk/scotforum/alertz...xxxxxxxxxxxxxxx xxxxxxxx being the SID i am currently logged in with i get to the page.

If i type in www.scotbird.co.uk/scotforum/alertz_VIP.php i get shoved to the login page

My Overall Header.tpl file is below

Code: [Hide] [Select]
<!-- IF S_LOFI -->
<!-- IF S_LOFI_BOTS -->
<!-- INCLUDE ../common/lofi/bots/lofi_bots_header.tpl -->
<!-- ELSE -->
<!-- INCLUDE ../common/lofi/lofi_header.tpl -->
<!-- ENDIF -->
<!-- ELSE -->
{DOCTYPE_HTML}
<head>
<!-- INCLUDE overall_inc_header.tpl -->
{EXTRA_CSS_JS}

<!-- IF S_HEADER_DROPDOWN -->
<script type="text/javascript">

/***********************************************
* AnyLink Drop Down Menu- © Dynamic Drive (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/

//Contents for menu 1
var menu1 = new Array();
menu1[0] = '<br /><div class="center-block-text">&nbsp;<form action="{FULL_SITE_PATH}{U_SEARCH}" method="post"><input name="search_keywords" type="text" class="post" style="width: 150px;" />&nbsp;<input type="submit" class="mainoption" value="{L_SEARCH}" />&nbsp;<br /><\/form><\/div>';
menu1[1] = '&nbsp;<a href="{FULL_SITE_PATH}{U_SEARCH}" title="{L_SEARCH_EXPLAIN}">{L_ADV_SEARCH}<\/a>';
//Contents for menu 2
var menu2 = new Array();
menu2[0] = '<a href="{FULL_SITE_PATH}{U_SEARCH_NEW}" title="{L_SEARCH_NEW}">{L_SEARCH_NEW2}<\/a>';
menu2[1] = '{L_DISPLAY_UNREAD}';
menu2[2] = '{L_DISPLAY_MARKED}';
menu2[3] = '{L_DISPLAY_PERMANENT}';

var menuwidth = '180px'; //default menu width
var disappeardelay = 250; //menu disappear speed onMouseout (in miliseconds)
var hidemenu_onclick = "no"; //hide menu when user clicks within menu?

/////No further editing needed
if (ie4 || ns6)
{
document.write('<div id="dropmenudiv" class="row1" style="visibility: hidden; width:' + menuwidth + ';" onmouseover="clearhidemenu();" onmouseout="dynamichide(event);"><\/div>');
}
</script>

<script type="text/javascript" src="{FULL_SITE_PATH}{T_COMMON_TPL_PATH}js/ddmenu.js"></script>

<script type="text/javascript">
if (hidemenu_onclick == "yes")
{
document.onclick = hidemenu;
}
</script>
<!-- ENDIF -->

</head>
<body>

<div id="logo-img"><a href="{FULL_SITE_PATH}{U_PORTAL}" title="{L_HOME}"><img src="{FULL_SITE_PATH}{SITELOGO}" alt="{L_HOME}" title="{L_HOME}" /></a></div>

<?php
$domainname = basename($_SERVER['SCRIPT_NAME'], '.' . PHP_EXT);
IF (strstr($domainname,'newsletter')){
?>
</p>
<tr>
<td width="100%" class="forum-buttons" colspan="3">
<a href="{FULL_SITE_PATH}{U_PORTAL}">Home</a>&nbsp;&nbsp;<img src="{FULL_SITE_PATH}{IMG_MENU_SEP}" alt="" />&nbsp;
<a href="{FULL_SITE_PATH}/newsletter2.php">Nov 2008</a>&nbsp;&nbsp;<img src="{FULL_SITE_PATH}{IMG_MENU_SEP}" alt="" />&nbsp;
<a href="{FULL_SITE_PATH}/newsletter3.php">Apr 2009</a>&nbsp;&nbsp;<img src="{FULL_SITE_PATH}{IMG_MENU_SEP}" alt="" />&nbsp;
<!-- IF not S_LOGGED_IN -->
<a href="{FULL_SITE_PATH}{U_REGISTER}">{L_REGISTER}</a>&nbsp;&nbsp;<img src="{FULL_SITE_PATH}{IMG_MENU_SEP}" alt="" />&nbsp;
<!-- ENDIF -->
<a href="{FULL_SITE_PATH}{U_LOGIN_LOGOUT}">{L_LOGIN_LOGOUT2}</a>
</td>
</tr>
<?php
}
ELSEIF (basename($_SERVER['SCRIPT_NAME'], '.' . PHP_EXT) == 'tickindex'){
?>

<tr>
<td width="100%" class="forum-buttons" colspan="3">
<a href="{FULL_SITE_PATH}{U_PORTAL}" class="invert">{L_HOME}</a>&nbsp;&nbsp;<img src="{FULL_SITE_PATH}{IMG_MENU_SEP}" alt="" />&nbsp;
<a href="{FULL_SITE_PATH}/tickindex.php" class="invert">Personal List</a>&nbsp;&nbsp;<img src="{FULL_SITE_PATH}{IMG_MENU_SEP}" alt="" />&nbsp;
<a href="{FULL_SITE_PATH}/tickleaderboard.php" class="invert">Leaderboard</a>&nbsp;&nbsp;<img src="{FULL_SITE_PATH}{IMG_MENU_SEP}" alt="" />&nbsp;

<!-- IF not S_LOGGED_IN -->
<a href="{FULL_SITE_PATH}{U_REGISTER}" class="invert">{L_REGISTER}</a>&nbsp;&nbsp;<img src="{FULL_SITE_PATH}{IMG_MENU_SEP}" alt="" />&nbsp;
<!-- ENDIF -->
<a href="{FULL_SITE_PATH}{U_LOGIN_LOGOUT}" class="invert">{L_LOGIN_LOGOUT2}</a>
</td>
</tr>
<?php
}
ELSEIF (basename($_SERVER['SCRIPT_NAME'], '.' . PHP_EXT) == 'tickleaderboard'){
?>

<tr>
<td width="100%" class="forum-buttons" colspan="3">
<a href="{FULL_SITE_PATH}{U_PORTAL}" class="invert">{L_HOME}</a>&nbsp;&nbsp;<img src="{FULL_SITE_PATH}{IMG_MENU_SEP}" alt="" />&nbsp;
<a href="{FULL_SITE_PATH}/tickindex.php" class="invert">Personal List</a>&nbsp;&nbsp;<img src="{FULL_SITE_PATH}{IMG_MENU_SEP}" alt="" />&nbsp;
<a href="{FULL_SITE_PATH}/tickleaderboard.php" class="invert">Leaderboard</a>&nbsp;&nbsp;<img src="{FULL_SITE_PATH}{IMG_MENU_SEP}" alt="" />&nbsp;

<!-- IF not S_LOGGED_IN -->
<a href="{FULL_SITE_PATH}{U_REGISTER}" class="invert">{L_REGISTER}</a>&nbsp;&nbsp;<img src="{FULL_SITE_PATH}{IMG_MENU_SEP}" alt="" />&nbsp;
<!-- ENDIF -->
<a href="{FULL_SITE_PATH}{U_LOGIN_LOGOUT}" class="invert">{L_LOGIN_LOGOUT2}</a>
</td>
</tr>
<?php
}
ELSEIF (basename($_SERVER['SCRIPT_NAME'], '.' . PHP_EXT) == 'index'){
?>
<tr>
<td width="100%" class="forum-buttons" colspan="3"><a href="{FULL_SITE_PATH}{U_PORTAL}" class="invert">{L_HOME}</a>&nbsp;&nbsp;<img src="{FULL_SITE_PATH}{IMG_MENU_SEP}" alt="" />&nbsp;
<a href="{FULL_SITE_PATH}{U_INDEX}" class="invert">{L_INDEX}</a>&nbsp;&nbsp;<img src="{FULL_SITE_PATH}{IMG_MENU_SEP}" alt="" />&nbsp;
<!-- BEGIN switch_upi2db_off -->
<a href="{FULL_SITE_PATH}{U_SEARCH_NEW}" class="invert">{L_NEW2}</a>&nbsp;&nbsp;<img src="{FULL_SITE_PATH}{IMG_MENU_SEP}" alt="" />&nbsp;
<!-- END switch_upi2db_off -->
<a href="{FULL_SITE_PATH}/album.php" class="invert">Gallery</a>&nbsp;&nbsp;<img src="{FULL_SITE_PATH}{IMG_MENU_SEP}" alt="" />&nbsp;
<!-- IF S_LOGGED_IN -->

<a href="{FULL_SITE_PATH}/newsletter.php" class="invert">ESSE Project</a>&nbsp;&nbsp;<img src="{FULL_SITE_PATH}{IMG_MENU_SEP}" alt="" />&nbsp;
<a href="{FULL_SITE_PATH}/alertz_VIP.php" class="invert">Alertz</a>&nbsp;&nbsp;<img src="{FULL_SITE_PATH}{IMG_MENU_SEP}" alt="" />&nbsp;
<a href="{FULL_SITE_PATH}/tickindex.php" class="invert">TickLists</a>&nbsp;&nbsp;<img src="{FULL_SITE_PATH}{IMG_MENU_SEP}" alt="" />&nbsp;

<a href="{FULL_SITE_PATH}{U_PROFILE}" class="invert">{L_PROFILE}</a>&nbsp;&nbsp;<img src="{FULL_SITE_PATH}{IMG_MENU_SEP}" alt="" />&nbsp;
<!-- ENDIF -->
<!-- IF S_HEADER_DROPDOWN -->
<a href="{FULL_SITE_PATH}{U_SEARCH}" onMouseOver="dropdownmenu(this,event,menu1,'250px')" onMouseOut="delayhidemenu()" class="invert">{L_SEARCH}</a>&nbsp;&nbsp;<img src="{FULL_SITE_PATH}{IMG_MENU_SEP}" alt="" />&nbsp;
<!-- ELSE -->
<a href="{FULL_SITE_PATH}{U_SEARCH}" class="invert">{L_SEARCH}</a>&nbsp;&nbsp;<img src="{FULL_SITE_PATH}{IMG_MENU_SEP}" alt="" />&nbsp;
<!-- ENDIF -->
<!-- IF not S_LOGGED_IN -->
<a href="{FULL_SITE_PATH}{U_REGISTER}" class="invert">{L_REGISTER}</a>&nbsp;&nbsp;<img src="{FULL_SITE_PATH}{IMG_MENU_SEP}" alt="" />&nbsp;
<!-- ENDIF -->
<a href="{FULL_SITE_PATH}{U_LOGIN_LOGOUT}" class="invert">{L_LOGIN_LOGOUT2}</a> </td>
</tr>
<?php
}
ELSEIF (basename($_SERVER['SCRIPT_NAME'], '.' . PHP_EXT) == 'album'){
?>
<tr>
<td width="100%" class="forum-buttons" colspan="3"><a href="{FULL_SITE_PATH}{U_PORTAL}" class="invert">{L_HOME}</a>&nbsp;&nbsp;<img src="{FULL_SITE_PATH}{IMG_MENU_SEP}" alt="" />&nbsp;
<a href="{FULL_SITE_PATH}{U_INDEX}" class="invert">{L_INDEX}</a>&nbsp;&nbsp;<img src="{FULL_SITE_PATH}{IMG_MENU_SEP}" alt="" />&nbsp;
<!-- BEGIN switch_upi2db_off -->
<a href="{FULL_SITE_PATH}{U_SEARCH_NEW}" class="invert">{L_NEW2}</a>&nbsp;&nbsp;<img src="{FULL_SITE_PATH}{IMG_MENU_SEP}" alt="" />&nbsp;
<!-- END switch_upi2db_off -->
<a href="{FULL_SITE_PATH}/album.php" class="invert">Gallery</a>&nbsp;&nbsp;<img src="{FULL_SITE_PATH}{IMG_MENU_SEP}" alt="" />&nbsp;
<!-- IF S_LOGGED_IN -->

<a href="{FULL_SITE_PATH}/newsletter.php" class="invert">ESSE Project</a>&nbsp;&nbsp;<img src="{FULL_SITE_PATH}{IMG_MENU_SEP}" alt="" />&nbsp;
<a href="{FULL_SITE_PATH}/alertz_VIP.php" class="invert">Alertz</a>&nbsp;&nbsp;<img src="{FULL_SITE_PATH}{IMG_MENU_SEP}" alt="" />&nbsp;
<a href="{FULL_SITE_PATH}/tickindex.php" class="invert">TickLists</a>&nbsp;&nbsp;<img src="{FULL_SITE_PATH}{IMG_MENU_SEP}" alt="" />&nbsp;

<a href="{FULL_SITE_PATH}{U_PROFILE}" class="invert">{L_PROFILE}</a>&nbsp;&nbsp;<img src="{FULL_SITE_PATH}{IMG_MENU_SEP}" alt="" />&nbsp;
<!-- ENDIF -->
<!-- IF S_HEADER_DROPDOWN -->
<a href="{FULL_SITE_PATH}{U_SEARCH}" onMouseOver="dropdownmenu(this,event,menu1,'250px')" onMouseOut="delayhidemenu()" class="invert">{L_SEARCH}</a>&nbsp;&nbsp;<img src="{FULL_SITE_PATH}{IMG_MENU_SEP}" alt="" />&nbsp;
<!-- ELSE -->
<a href="{FULL_SITE_PATH}{U_SEARCH}" class="invert">{L_SEARCH}</a>&nbsp;&nbsp;<img src="{FULL_SITE_PATH}{IMG_MENU_SEP}" alt="" />&nbsp;
<!-- ENDIF -->
<!-- IF not S_LOGGED_IN -->
<a href="{FULL_SITE_PATH}{U_REGISTER}" class="invert">{L_REGISTER}</a>&nbsp;&nbsp;<img src="{FULL_SITE_PATH}{IMG_MENU_SEP}" alt="" />&nbsp;
<!-- ENDIF -->
<a href="{FULL_SITE_PATH}{U_LOGIN_LOGOUT}" class="invert">{L_LOGIN_LOGOUT2}</a> </td>
</tr>
<?php
}
ELSEIF (basename($_SERVER['SCRIPT_NAME'], '.' . PHP_EXT) == 'viewtopic'){
?>
<tr>
<td width="100%" class="forum-buttons" colspan="3"><a href="{FULL_SITE_PATH}{U_PORTAL}" class="invert">{L_HOME}</a>&nbsp;&nbsp;<img src="{FULL_SITE_PATH}{IMG_MENU_SEP}" alt="" />&nbsp;
<a href="{FULL_SITE_PATH}{U_INDEX}" class="invert">{L_INDEX}</a>&nbsp;&nbsp;<img src="{FULL_SITE_PATH}{IMG_MENU_SEP}" alt="" />&nbsp;
<!-- BEGIN switch_upi2db_off -->
<a href="{FULL_SITE_PATH}{U_SEARCH_NEW}" class="invert">{L_NEW2}</a>&nbsp;&nbsp;<img src="{FULL_SITE_PATH}{IMG_MENU_SEP}" alt="" />&nbsp;
<!-- END switch_upi2db_off -->
<a href="{FULL_SITE_PATH}/album.php" class="invert">Gallery</a>&nbsp;&nbsp;<img src="{FULL_SITE_PATH}{IMG_MENU_SEP}" alt="" />&nbsp;
<!-- IF S_LOGGED_IN -->

<a href="{FULL_SITE_PATH}/newsletter.php" class="invert">ESSE Project</a>&nbsp;&nbsp;<img src="{FULL_SITE_PATH}{IMG_MENU_SEP}" alt="" />&nbsp;
<a href="{FULL_SITE_PATH}/alertz_VIP.php" class="invert">Alertz</a>&nbsp;&nbsp;<img src="{FULL_SITE_PATH}{IMG_MENU_SEP}" alt="" />&nbsp;
<a href="{FULL_SITE_PATH}/tickindex.php" class="invert">TickLists</a>&nbsp;&nbsp;<img src="{FULL_SITE_PATH}{IMG_MENU_SEP}" alt="" />&nbsp;

<a href="{FULL_SITE_PATH}{U_PROFILE}" class="invert">{L_PROFILE}</a>&nbsp;&nbsp;<img src="{FULL_SITE_PATH}{IMG_MENU_SEP}" alt="" />&nbsp;
<!-- ENDIF -->
<!-- IF S_HEADER_DROPDOWN -->
<a href="{FULL_SITE_PATH}{U_SEARCH}" onMouseOver="dropdownmenu(this,event,menu1,'250px')" onMouseOut="delayhidemenu()" class="invert">{L_SEARCH}</a>&nbsp;&nbsp;<img src="{FULL_SITE_PATH}{IMG_MENU_SEP}" alt="" />&nbsp;
<!-- ELSE -->
<a href="{FULL_SITE_PATH}{U_SEARCH}" class="invert">{L_SEARCH}</a>&nbsp;&nbsp;<img src="{FULL_SITE_PATH}{IMG_MENU_SEP}" alt="" />&nbsp;
<!-- ENDIF -->
<!-- IF not S_LOGGED_IN -->
<a href="{FULL_SITE_PATH}{U_REGISTER}" class="invert">{L_REGISTER}</a>&nbsp;&nbsp;<img src="{FULL_SITE_PATH}{IMG_MENU_SEP}" alt="" />&nbsp;
<!-- ENDIF -->
<a href="{FULL_SITE_PATH}{U_LOGIN_LOGOUT}" class="invert">{L_LOGIN_LOGOUT2}</a> </td>
</tr>
<?php
}

ELSEIF (basename($_SERVER['SCRIPT_NAME'], '.' . PHP_EXT) == 'viewforum'){
?>
<tr>
<td width="100%" class="forum-buttons" colspan="3"><a href="{FULL_SITE_PATH}{U_PORTAL}" class="invert">{L_HOME}</a>&nbsp;&nbsp;<img src="{FULL_SITE_PATH}{IMG_MENU_SEP}" alt="" />&nbsp;
<a href="{FULL_SITE_PATH}{U_INDEX}" class="invert">{L_INDEX}</a>&nbsp;&nbsp;<img src="{FULL_SITE_PATH}{IMG_MENU_SEP}" alt="" />&nbsp;
<!-- BEGIN switch_upi2db_off -->
<a href="{FULL_SITE_PATH}{U_SEARCH_NEW}" class="invert">{L_NEW2}</a>&nbsp;&nbsp;<img src="{FULL_SITE_PATH}{IMG_MENU_SEP}" alt="" />&nbsp;
<!-- END switch_upi2db_off -->
<a href="{FULL_SITE_PATH}/album.php" class="invert">Gallery</a>&nbsp;&nbsp;<img src="{FULL_SITE_PATH}{IMG_MENU_SEP}" alt="" />&nbsp;
<!-- IF S_LOGGED_IN -->

<a href="{FULL_SITE_PATH}/newsletter.php" class="invert">ESSE Project</a>&nbsp;&nbsp;<img src="{FULL_SITE_PATH}{IMG_MENU_SEP}" alt="" />&nbsp;
<a href="{FULL_SITE_PATH}/alertz_VIP.php" class="invert">Alertz</a>&nbsp;&nbsp;<img src="{FULL_SITE_PATH}{IMG_MENU_SEP}" alt="" />&nbsp;
<a href="{FULL_SITE_PATH}/tickindex.php" class="invert">TickLists</a>&nbsp;&nbsp;<img src="{FULL_SITE_PATH}{IMG_MENU_SEP}" alt="" />&nbsp;

<a href="{FULL_SITE_PATH}{U_PROFILE}" class="invert">{L_PROFILE}</a>&nbsp;&nbsp;<img src="{FULL_SITE_PATH}{IMG_MENU_SEP}" alt="" />&nbsp;
<!-- ENDIF -->
<!-- IF S_HEADER_DROPDOWN -->
<a href="{FULL_SITE_PATH}{U_SEARCH}" onMouseOver="dropdownmenu(this,event,menu1,'250px')" onMouseOut="delayhidemenu()" class="invert">{L_SEARCH}</a>&nbsp;&nbsp;<img src="{FULL_SITE_PATH}{IMG_MENU_SEP}" alt="" />&nbsp;
<!-- ELSE -->
<a href="{FULL_SITE_PATH}{U_SEARCH}" class="invert">{L_SEARCH}</a>&nbsp;&nbsp;<img src="{FULL_SITE_PATH}{IMG_MENU_SEP}" alt="" />&nbsp;
<!-- ENDIF -->
<!-- IF not S_LOGGED_IN -->
<a href="{FULL_SITE_PATH}{U_REGISTER}" class="invert">{L_REGISTER}</a>&nbsp;&nbsp;<img src="{FULL_SITE_PATH}{IMG_MENU_SEP}" alt="" />&nbsp;
<!-- ENDIF -->
<a href="{FULL_SITE_PATH}{U_LOGIN_LOGOUT}" class="invert">{L_LOGIN_LOGOUT2}</a> </td>
</tr>
<?php
}
ELSEIF (basename($_SERVER['SCRIPT_NAME'], '.' . PHP_EXT) == 'forum'){
?>
<tr>
<td width="100%" class="forum-buttons" colspan="3"><a href="{FULL_SITE_PATH}{U_PORTAL}" class="invert">{L_HOME}</a>&nbsp;&nbsp;<img src="{FULL_SITE_PATH}{IMG_MENU_SEP}" alt="" />&nbsp;
<a href="{FULL_SITE_PATH}{U_INDEX}" class="invert">{L_INDEX}</a>&nbsp;&nbsp;<img src="{FULL_SITE_PATH}{IMG_MENU_SEP}" alt="" />&nbsp;
<!-- BEGIN switch_upi2db_off -->
<a href="{FULL_SITE_PATH}{U_SEARCH_NEW}" class="invert">{L_NEW2}</a>&nbsp;&nbsp;<img src="{FULL_SITE_PATH}{IMG_MENU_SEP}" alt="" />&nbsp;
<!-- END switch_upi2db_off -->
<a href="{FULL_SITE_PATH}/album.php" class="invert">Gallery</a>&nbsp;&nbsp;<img src="{FULL_SITE_PATH}{IMG_MENU_SEP}" alt="" />&nbsp;
<!-- IF S_LOGGED_IN -->

<a href="{FULL_SITE_PATH}/newsletter.php" class="invert">ESSE Project</a>&nbsp;&nbsp;<img src="{FULL_SITE_PATH}{IMG_MENU_SEP}" alt="" />&nbsp;
<a href="{FULL_SITE_PATH}/alertz_VIP.php" class="invert">Alertz</a>&nbsp;&nbsp;<img src="{FULL_SITE_PATH}{IMG_MENU_SEP}" alt="" />&nbsp;
<a href="{FULL_SITE_PATH}/tickindex.php" class="invert">TickLists</a>&nbsp;&nbsp;<img src="{FULL_SITE_PATH}{IMG_MENU_SEP}" alt="" />&nbsp;

<a href="{FULL_SITE_PATH}{U_PROFILE}" class="invert">{L_PROFILE}</a>&nbsp;&nbsp;<img src="{FULL_SITE_PATH}{IMG_MENU_SEP}" alt="" />&nbsp;
<!-- ENDIF -->
<!-- IF S_HEADER_DROPDOWN -->
<a href="{FULL_SITE_PATH}{U_SEARCH}" onMouseOver="dropdownmenu(this,event,menu1,'250px')" onMouseOut="delayhidemenu()" class="invert">{L_SEARCH}</a>&nbsp;&nbsp;<img src="{FULL_SITE_PATH}{IMG_MENU_SEP}" alt="" />&nbsp;
<!-- ELSE -->
<a href="{FULL_SITE_PATH}{U_SEARCH}" class="invert">{L_SEARCH}</a>&nbsp;&nbsp;<img src="{FULL_SITE_PATH}{IMG_MENU_SEP}" alt="" />&nbsp;
<!-- ENDIF -->
<!-- IF not S_LOGGED_IN -->
<a href="{FULL_SITE_PATH}{U_REGISTER}" class="invert">{L_REGISTER}</a>&nbsp;&nbsp;<img src="{FULL_SITE_PATH}{IMG_MENU_SEP}" alt="" />&nbsp;
<!-- ENDIF -->
<a href="{FULL_SITE_PATH}{U_LOGIN_LOGOUT}" class="invert">{L_LOGIN_LOGOUT2}</a> </td>
</tr>
<?php
}
ELSEIF (basename($_SERVER['SCRIPT_NAME'], '.' . PHP_EXT) == 'album_cat'){
?>
<tr>
<td width="100%" class="forum-buttons" colspan="3"><a href="{FULL_SITE_PATH}{U_PORTAL}" class="invert">{L_HOME}</a>&nbsp;&nbsp;<img src="{FULL_SITE_PATH}{IMG_MENU_SEP}" alt="" />&nbsp;
<a href="{FULL_SITE_PATH}{U_INDEX}" class="invert">{L_INDEX}</a>&nbsp;&nbsp;<img src="{FULL_SITE_PATH}{IMG_MENU_SEP}" alt="" />&nbsp;
<!-- BEGIN switch_upi2db_off -->
<a href="{FULL_SITE_PATH}{U_SEARCH_NEW}" class="invert">{L_NEW2}</a>&nbsp;&nbsp;<img src="{FULL_SITE_PATH}{IMG_MENU_SEP}" alt="" />&nbsp;
<!-- END switch_upi2db_off -->
<a href="{FULL_SITE_PATH}/album.php" class="invert">Gallery</a>&nbsp;&nbsp;<img src="{FULL_SITE_PATH}{IMG_MENU_SEP}" alt="" />&nbsp;
<!-- IF S_LOGGED_IN -->

<a href="{FULL_SITE_PATH}/newsletter.php" class="invert">ESSE Project</a>&nbsp;&nbsp;<img src="{FULL_SITE_PATH}{IMG_MENU_SEP}" alt="" />&nbsp;
<a href="{FULL_SITE_PATH}/alertz_VIP.php" class="invert">Alertz</a>&nbsp;&nbsp;<img src="{FULL_SITE_PATH}{IMG_MENU_SEP}" alt="" />&nbsp;
<a href="{FULL_SITE_PATH}/tickindex.php" class="invert">TickLists</a>&nbsp;&nbsp;<img src="{FULL_SITE_PATH}{IMG_MENU_SEP}" alt="" />&nbsp;

<a href="{FULL_SITE_PATH}{U_PROFILE}" class="invert">{L_PROFILE}</a>&nbsp;&nbsp;<img src="{FULL_SITE_PATH}{IMG_MENU_SEP}" alt="" />&nbsp;
<!-- ENDIF -->
<!-- IF S_HEADER_DROPDOWN -->
<a href="{FULL_SITE_PATH}{U_SEARCH}" onMouseOver="dropdownmenu(this,event,menu1,'250px')" onMouseOut="delayhidemenu()" class="invert">{L_SEARCH}</a>&nbsp;&nbsp;<img src="{FULL_SITE_PATH}{IMG_MENU_SEP}" alt="" />&nbsp;
<!-- ELSE -->
<a href="{FULL_SITE_PATH}{U_SEARCH}" class="invert">{L_SEARCH}</a>&nbsp;&nbsp;<img src="{FULL_SITE_PATH}{IMG_MENU_SEP}" alt="" />&nbsp;
<!-- ENDIF -->
<!-- IF not S_LOGGED_IN -->
<a href="{FULL_SITE_PATH}{U_REGISTER}" class="invert">{L_REGISTER}</a>&nbsp;&nbsp;<img src="{FULL_SITE_PATH}{IMG_MENU_SEP}" alt="" />&nbsp;
<!-- ENDIF -->
<a href="{FULL_SITE_PATH}{U_LOGIN_LOGOUT}" class="invert">{L_LOGIN_LOGOUT2}</a> </td>
</tr>
<?php
}
ELSEIF (basename($_SERVER['SCRIPT_NAME'], '.' . PHP_EXT) == 'alertz_VIP'){
?>
<tr>
<td width="100%" class="forum-buttons" colspan="3"><a href="{FULL_SITE_PATH}{U_PORTAL}" class="invert">{L_HOME}</a>&nbsp;&nbsp;<img src="{FULL_SITE_PATH}{IMG_MENU_SEP}" alt="" />&nbsp;
<a href="{FULL_SITE_PATH}{U_INDEX}" class="invert">{L_INDEX}</a>&nbsp;&nbsp;<img src="{FULL_SITE_PATH}{IMG_MENU_SEP}" alt="" />&nbsp;
<!-- BEGIN switch_upi2db_off -->
<a href="{FULL_SITE_PATH}{U_SEARCH_NEW}" class="invert">{L_NEW2}</a>&nbsp;&nbsp;<img src="{FULL_SITE_PATH}{IMG_MENU_SEP}" alt="" />&nbsp;
<!-- END switch_upi2db_off -->
<a href="{FULL_SITE_PATH}/album.php" class="invert">Gallery</a>&nbsp;&nbsp;<img src="{FULL_SITE_PATH}{IMG_MENU_SEP}" alt="" />&nbsp;
<!-- IF S_LOGGED_IN -->

<a href="{FULL_SITE_PATH}/newsletter.php" class="invert">ESSE Project</a>&nbsp;&nbsp;<img src="{FULL_SITE_PATH}{IMG_MENU_SEP}" alt="" />&nbsp;
<a href="{FULL_SITE_PATH}/alertz_VIP.php" class="invert">Alertz</a>&nbsp;&nbsp;<img src="{FULL_SITE_PATH}{IMG_MENU_SEP}" alt="" />&nbsp;
<a href="{FULL_SITE_PATH}/tickindex.php" class="invert">TickLists</a>&nbsp;&nbsp;<img src="{FULL_SITE_PATH}{IMG_MENU_SEP}" alt="" />&nbsp;

<a href="{FULL_SITE_PATH}{U_PROFILE}" class="invert">{L_PROFILE}</a>&nbsp;&nbsp;<img src="{FULL_SITE_PATH}{IMG_MENU_SEP}" alt="" />&nbsp;
<!-- ENDIF -->
<!-- IF S_HEADER_DROPDOWN -->
<a href="{FULL_SITE_PATH}{U_SEARCH}" onMouseOver="dropdownmenu(this,event,menu1,'250px')" onMouseOut="delayhidemenu()" class="invert">{L_SEARCH}</a>&nbsp;&nbsp;<img src="{FULL_SITE_PATH}{IMG_MENU_SEP}" alt="" />&nbsp;
<!-- ELSE -->
<a href="{FULL_SITE_PATH}{U_SEARCH}" class="invert">{L_SEARCH}</a>&nbsp;&nbsp;<img src="{FULL_SITE_PATH}{IMG_MENU_SEP}" alt="" />&nbsp;
<!-- ENDIF -->
<!-- IF not S_LOGGED_IN -->
<a href="{FULL_SITE_PATH}{U_REGISTER}" class="invert">{L_REGISTER}</a>&nbsp;&nbsp;<img src="{FULL_SITE_PATH}{IMG_MENU_SEP}" alt="" />&nbsp;
<!-- ENDIF -->
<a href="{FULL_SITE_PATH}{U_LOGIN_LOGOUT}" class="invert">{L_LOGIN_LOGOUT2}</a> </td>
</tr>
<?php
}
ELSEIF (basename($_SERVER['SCRIPT_NAME'], '.' . PHP_EXT) == 'index'){
?>
<tr>
<td width="100%" class="forum-buttons" colspan="3">
<a href="{FULL_SITE_PATH}{U_PORTAL}">{L_HOME}</a>&nbsp;&nbsp;<img src="{FULL_SITE_PATH}{IMG_MENU_SEP}" alt="" />&nbsp;
<a href="{FULL_SITE_PATH}{U_INDEX}">1{L_INDEX}</a>&nbsp;&nbsp;<img src="{FULL_SITE_PATH}{IMG_MENU_SEP}" alt="" />&nbsp;
<!-- BEGIN switch_upi2db_off -->
<a href="{FULL_SITE_PATH}{U_SEARCH_NEW}">{L_NEW2}</a>&nbsp;&nbsp;<img src="{FULL_SITE_PATH}{IMG_MENU_SEP}" alt="" />&nbsp;
<!-- END switch_upi2db_off -->
<!-- BEGIN switch_upi2db_on -->
<span style="vertical-align:top;">{L_POSTS}:&nbsp;</span><a href="{FULL_SITE_PATH}{U_SEARCH_NEW}">{L_NEW2}</a><span style="vertical-align:top;">&nbsp;•&nbsp;</span>{L_DISPLAY_U}<span style="vertical-align:top;">&nbsp;•&nbsp;</span>{L_DISPLAY_M}<span style="vertical-align:top;">&nbsp;•&nbsp;</span>{L_DISPLAY_P}&nbsp;&nbsp;<img src="{FULL_SITE_PATH}{IMG_MENU_SEP}" alt="" />&nbsp;
<!-- END switch_upi2db_on -->
<!-- IF S_LOGGED_IN -->
<a href="{FULL_SITE_PATH}{U_PROFILE}">{L_PROFILE}</a>&nbsp;&nbsp;<img src="{FULL_SITE_PATH}{IMG_MENU_SEP}" alt="" />&nbsp;
<!-- ENDIF -->
<!-- IF S_HEADER_DROPDOWN -->
<a href="{FULL_SITE_PATH}{U_SEARCH}" onMouseOver="dropdownmenu(this,event,menu1,'250px')" onMouseOut="delayhidemenu()">{L_SEARCH}</a>&nbsp;&nbsp;<img src="{FULL_SITE_PATH}{IMG_MENU_SEP}" alt="" />&nbsp;
<!-- ELSE -->
<a href="{FULL_SITE_PATH}{U_SEARCH}">{L_SEARCH}</a>&nbsp;&nbsp;<img src="{FULL_SITE_PATH}{IMG_MENU_SEP}" alt="" />&nbsp;
<!-- ENDIF -->
<a href="{FULL_SITE_PATH}{U_FAQ}">{L_FAQ}</a>&nbsp;&nbsp;<img src="{FULL_SITE_PATH}{IMG_MENU_SEP}" alt="" />&nbsp;
<!-- IF not S_LOGGED_IN -->
<a href="{FULL_SITE_PATH}{U_REGISTER}">{L_REGISTER}</a>&nbsp;&nbsp;<img src="{FULL_SITE_PATH}{IMG_MENU_SEP}" alt="" />&nbsp;
<!-- ENDIF -->
<a href="{FULL_SITE_PATH}{U_LOGIN_LOGOUT}">{L_LOGIN_LOGOUT2}</a>
</td>
</tr>
<!-- ENDIF -->

<!-- BEGIN switch_lw_user_logged_in -->
<tr>
<td height="25" align="center" valign="top" nowrap="nowrap"><span class="mainmenu">&nbsp;{L_LW_EXPIRE_REMINDER}</span></td>
</tr>
<!-- END switch_lw_user_logged_in -->



<?php
}
?>

<div id="global-wrapper">
<span><a name="top"></a></span>
{TOP_HTML_BLOCK}
<!-- IF GH_BLOCK --><!-- BEGIN gheader_blocks_row -->{gheader_blocks_row.CMS_BLOCK}<!-- END gheader_blocks_row --><!-- ENDIF -->
<!-- IF PROFILE_VIEW --><script type="text/javascript">window.open('{U_PROFILE_VIEW}','_blank','height=800,width=250,resizable=yes');</script><!-- ENDIF -->


{PAGE_BEGIN}
<table id="forumtable" cellspacing="0" cellpadding="0">
<!-- IF GT_BLOCK -->
<tr><td width="100%" colspan="3"><!-- BEGIN ghtop_blocks_row -->{ghtop_blocks_row.CMS_BLOCK}<!-- END ghtop_blocks_row --></td></tr>
<!-- ENDIF -->
<tr>
<td width="100%" colspan="3" valign="top">
<div id="top_logo">
<table class="" width="100%" cellspacing="0" cellpadding="0" border="0">
<tr>
<td align="left" height="100%" valign="middle">
<!-- IF GL_BLOCK -->
<!-- BEGIN ghleft_blocks_row -->{ghleft_blocks_row.OUTPUT}<!-- END ghleft_blocks_row -->
<!-- ELSE -->

<!-- ENDIF -->
</td>
<td align="center" valign="middle"><!-- IF S_HEADER_BANNER --><center><br />{HEADER_BANNER_CODE}</center><!-- ELSE -->&nbsp;<!-- ENDIF --></td>
<td align="right" valign="middle">
<!-- <div class="sitedes"><h1>{SITENAME}</h1><h2>{SITE_DESCRIPTION}</h2></div> -->
<!-- IF GR_BLOCK -->
<!-- BEGIN ghright_blocks_row -->{ghright_blocks_row.OUTPUT}<!-- END ghright_blocks_row -->
<!-- ELSE -->
<!-- IF S_LOGGED_IN -->&nbsp;<!-- ELSE -->&nbsp;<!-- ENDIF -->
<!-- ENDIF -->
</td>
</tr>
</table>
</div>
</td>
</tr>



<!-- IF S_PAGE_NAV --><tr><td width="100%" colspan="3"><div style="margin-left: 7px; margin-right: 7px;"><!-- INCLUDE breadcrumbs_main.tpl --></div></td></tr><!-- ENDIF -->

<!-- INCLUDE overall_inc_body.tpl -->

<!-- ENDIF -->


is my overal header


mort [ Thu 17 Jan, 2013 19:20 ]
Post subject: Re: How Do I Check If A User Is Logged In ?
Please Do another fresh Upgrade and ensure that IP is working correctly before you add anything.

andy


And it probably explains why you never found these Mistakes that you made, because something else is screwed up as well.

full_page_generation('alertz_VIP.php', , '', '');


Mighty Gorgon [ Thu 17 Jan, 2013 19:31 ]
Post subject: Re: How Do I Check If A User Is Logged In ?
AndyGpy wrote: [View Post]
Right guys,

getting closer i think.

i know the alertz.php and the .tpl files are okay the problem lies when i am logged in and click on the link to go to the alertz page it forgets about the session ID and kicks me to the log in screen.

THe link i have in the header sectiion is

<a href="{FULL_SITE_PATH}/alertz_VIP.php" class="invert">Alertz</a>&nbsp;&nbsp;<img src="{FULL_SITE_PATH}{IMG_MENU_SEP}" alt="" />&nbsp;

how can i get it so the session ID is kept like any other link i have ?

I am sure i have cookies on, as i have set cookie path etc.

This fully explains what the problem is.

The solution is easy... you need to append sid to the url.

Do what mort suggested on adding append_sid on redirect, and then this part...

You should define the URL as a var in PHP, maybe in page_header function, something like this:
Code: [Hide] [Select]
'U_ALERTZ_VIP' => append_sid('alertz_VIP.' . PHP_EXT),


And then use the var int TPL like this:
Code: [Hide] [Select]
<a href="{FULL_SITE_PATH}{U_ALERTZ_VIP}" class="invert">Alertz</a>


And your issue should be gone forever... let me know...


mort [ Thu 17 Jan, 2013 20:08 ]
Post subject: Re: How Do I Check If A User Is Logged In ?
I don't know MG, he says he's got cookies turned on and yet nothing is being set. Because it worked for me as is and I never even "Set" cookies on this XAMPP install - just the default install and it works fine.

And for Andy's benefit.

Even without sessions, you need to check things instead of assuming that something is working. Because this is what you should be getting without appending the sid.

As I POINTED OUT to you before. You are getting nothing?

andy2

Quote:
You should define the URL as a var in PHP, maybe in page_header function, something like this:


Actually - Put it in templates/default/default.cfg along with its cousins at the bottom.


AndyGpy [ Thu 17 Jan, 2013 22:37 ]
Post subject: Re: How Do I Check If A User Is Logged In ?
Mort --

full_page_generation('alertz_VIP.php', , '', ''); was a typo, if you had checked it prior to informing me you would have seen it went to .tpl page. lol

MG --



Mort -- no disrespect, but people like me who are trying to learn can be put of sometime by the way you came over earlier. All worked out in the end

Many thanks to both you and MG.

now i need to do that for all my links that are like that one.

regards


mort [ Thu 17 Jan, 2013 23:15 ]
Post subject: Re: How Do I Check If A User Is Logged In ?
AndyGpy wrote: [View Post]
Mort --

full_page_generation('alertz_VIP.php', , '', ''); was a typo, if you had checked it prior to informing me you would have seen it went to .tpl page. lol


I made it a .tpl file when I tested it.

I quoted exactly what YOU WROTE! It's no good saying afterwards "It was a typo" when you post it and say This is what I've GOT!.

Quote:
alertz_VIP.php

//full_page_generation();
full_page_generation('alertz_VIP.php', , '', '');

and the template alertz_VIP.tpl



Quote:
can be put of sometime by the way you came over earlier


Yeah, well that's too bad - Because you were all over the place with this, and you say you were frustrated. ?


AndyGpy [ Fri 18 Jan, 2013 07:41 ]
Post subject: Re: How Do I Check If A User Is Logged In ?
Not getting into an Argument Mort but look at my 7th post on this topic --


else
// Yes they are
{

....My code is in here...

full_page_generation('alertz_VIP.tpl', '', '', '');

}

and further down in the posts.

Anyway all is good.


mort [ Fri 18 Jan, 2013 09:13 ]
Post subject: Re: How Do I Check If A User Is Logged In ?
AndyGpy wrote: [View Post]
Not getting into an Argument Mort but look at my 7th post on this topic --


And WHY would I take script from your seventh post when you supposedly posted an updated version here. Well after the post that you refer too. ?

Why don't I go back to last month - - - Same thing?

http://www.icyphoenix.com/viewtopic.php?p=58012#p58012

I downloaded what anyone would assume to be the latest - filed it - tested it - found errors, and now you tell me I should have used an earlier script.

It's up to you to make sure that the latest scripts you post are a true reflection of where you are up to.

As I said, you were all over the place.


AndyGpy [ Fri 18 Jan, 2013 13:41 ]
Post subject: Re: [SOLVED] How Do I Check If A User Is Logged In ?
why you so agressive ?


mort [ Sat 19 Jan, 2013 00:31 ]
Post subject: Re: How Do I Check If A User Is Logged In ?
I'm not aggressive Andy,

But I think you deserve an answer to your question.

Early on I went to your site and determined that you had neither sessions working on that page or cookies set for the whole board.

You say you did have cookies set. Well, my FF says you didn't, and if you had and were absolutely sure that cookies were set ON then you would have a problem somewhere else.

Did you test it - Probably No.

I gave you some tools to put in the header of any global file to test both sessions and cookies, and that would have determined whether or not cookies and sessions were actually working (Turned On).

Did you test it - Probably No.

Because if you had done that, it would have determined the cookie-status, and maybe you just didn't have them turned on after all. Because if they were turned on your MOD would have worked under Cookie(Sessions), and your next question would have been.

Why does this MOD work with cookies and not with sessions.?

To which the answer would have been obvious.

But you persisted with posting your script and asking why it's not working, so I put myself out to download it - file it - and test it. And found errors. But according to you I should have downloaded an earlier script that apparently didn't contain errors.

That's your fault, not mine.

When the script I checked didn't work for you, I again went back to your site and found that cookies were still not turned on and posted some pictures of it here.

Did you test if cookies were set - Probably No.

You boast about how you fixed someone else's MOD for your own purpose to get it to work with Icy Phoenix, and contravene the very licence that you obtained it under.

You also suggest that people should be here to make themselves available to help those who are less experienced - We are - But it's not a one-way street.

And finally, you also worked outside the guidelines of any logical diagnostics in helping to resolve the problem, by not testing your end of it, and by expecting people to simply fall on the answer to the problem.

I not aggressive Andy - Pissed Off would be a better term to use.


AndyGpy [ Sat 19 Jan, 2013 12:57 ]
Post subject: Re: [SOLVED] How Do I Check If A User Is Logged In ?
Trying to provoke me into an arguement wont get one, one thing i would like to comment to in regards to your reply is:-

You boast about how you fixed someone else's MOD for your own purpose to get it to work with Icy Phoenix, and contravene the very licence that you obtained it under.

Never modded anyones MOD for my own purpose, all I have published is my own.

Mort -- Chill out, as i said i am learning as i go.


mort [ Sat 23 Mar, 2013 15:07 ]
Post subject: Re: [SOLVED] How Do I Check If A User Is Logged In ?
AndyGpy wrote: [View Post]
Never modified anyone's MOD for my own purpose, all I have published is my own.


You still miss the point.

Icyphoenix is licenced under the GPL, so you can use it and distribute it, for free, as long as the code and the modifications you make remain public.
However, if you do improve the source code, or add new features, we would be very happy to hear from you and include it in future releases either by adding it to the core files or as a modification.

Please do take the time to read the GPL licence - and if you don't understand it - Get someone who does to explain it to you. Because contributing the things you make by using someone else's GPL code is what keeps GPL alive.

But the one thing that does strike me as odd is that you profess to have written this modification to operate under Icy Phoenix, and it uses VB mark-up for the html?

But maybe that's intentional on your part to simplify things as Icy Phoenix mark-up can be a tad hard to follow at times

Anyway, I'll have to give this subject a miss as I have to go and report a "Lost Puppy" on a VB site - Nothing fancy - Just the "Time of day sighted, the location, direction headed, colour of its feathers fur and any other relevant details that will help the owner to locate it or possibly be reunited with it.





Powered by Icy Phoenix