Icy Phoenix

     
 


Post new topic  Reply to topic 
Page 1 of 3
Goto page 1, 2, 3  Next
 
Reply with quote Download Post 
Post 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
 



 
AndyGpySend private messageVisit poster's website  
Back to topPage bottom
Icy Phoenix is an open source project, you can show your appreciation and support future development by donating to the project.

Support us
 
Reply with quote Download Post 
Post Re: How Do I Check If A User Is Logged In ? 
 
Something like this may help?  


Code: [Download] [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.
 



 
mortSend private message  
Back to topPage bottom
Reply with quote Download Post 
Post 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.
 



 
AndyGpySend private messageVisit poster's website  
Back to topPage bottom
Reply with quote Download Post 
Post 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: [Download] [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.  
 



 
mortSend private message  
Back to topPage bottom
Reply with quote Download Post 
Post Re: How Do I Check If A User Is Logged In ? 
 
I have

Code: [Download] [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
 



 
AndyGpySend private messageVisit poster's website  
Back to topPage bottom
Reply with quote Download Post 
Post 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: [Download] [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}">

 



 
mortSend private message  
Back to topPage bottom
Reply with quote Download Post 
Post Re: How Do I Check If A User Is Logged In ? 
 
below is the

Redirect Code :-

Code: [Download] [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: [Download] [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
 



 
AndyGpySend private messageVisit poster's website  
Back to topPage bottom
Reply with quote Download Post 
Post 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
 



 
mortSend private message  
Back to topPage bottom
Reply with quote Download Post 
Post 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
 



 
AndyGpySend private messageVisit poster's website  
Back to topPage bottom
Reply with quote Download Post 
Post 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: [Download] [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.
 




____________
Luca
SEARCH is the quickest way to get support.
Icy Phoenix ColorizeIt - CustomIcy - HON
 
Mighty GorgonSend private messageSend e-mail to userVisit poster's website  
Back to topPage bottom
Reply with quote Download Post 
Post Re: How Do I Check If A User Is Logged In ? 
 
MG

Code: [Download] [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
 



 
AndyGpySend private messageVisit poster's website  
Back to topPage bottom
Reply with quote Download Post 
Post 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.
 



 
mortSend private message  
Back to topPage bottom
Reply with quote Download Post 
Post 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
 



 
AndyGpySend private messageVisit poster's website  
Back to topPage bottom
Reply with quote Download Post 
Post 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.

 
 



 
mortSend private message  
Back to topPage bottom
Reply with quote Download Post 
Post Re: How Do I Check If A User Is Logged In ? 
 
Andy, did you check if it works?
 




____________
Luca
SEARCH is the quickest way to get support.
Icy Phoenix ColorizeIt - CustomIcy - HON
 
Mighty GorgonSend private messageSend e-mail to userVisit poster's website  
Back to topPage bottom
Post new topic  Reply to topic  Page 1 of 3
Goto page 1, 2, 3  Next


Display posts from previous:    

HideWas this topic useful?

Link this topic
URL
BBCode
HTML




 
Permissions List
You cannot post new topics
You cannot reply to topics
You cannot edit your posts
You cannot delete your posts
You cannot vote in polls
You cannot attach files
You can download files
You cannot post calendar events


  

 

  cron