EscalateSEO Posted November 4, 2011 Share Posted November 4, 2011 I am trying to make this page so that it is only visible to people who are logged in and have active packages for package ID's 1 and 2. You can see the bold part of the code below to see what I added. <?php define("CLIENTAREA",true); //define("FORCESSL",true); # Uncomment to force the page to use https:// require("dbconnect.php"); require("includes/functions.php"); require("includes/clientareafunctions.php"); $pagetitle = $_LANG['clientareatitle']; $breadcrumbnav = '<a href="index.php">'.$_LANG['globalsystemname'].'</a>'; $breadcrumbnav .= ' > <a href="plr.php">PLR Products</a>'; initialiseClientArea($pagetitle,'',$breadcrumbnav); # To assign variables to the template system use the following syntax. # These can then be referenced using {$variablename} in the template. $smartyvalues["variablename"] = $value; # Check login status if ($_SESSION['uid']) { # User is logged in - put any code you like here # Here's an example to get the currently logged in clients first name $result = mysql_query("SELECT firstname FROM tblclients WHERE id=".(int)$_SESSION['uid']); $data = mysql_fetch_array($result); $clientname = $data[0]; $smartyvalues["clientname"] = $clientname; } else { # User is not logged in } # Define the template filename to be used without the .tpl extension $templatefile = "plr"; outputClientArea($templatefile); ?><?php define("CLIENTAREA",true); //define("FORCESSL",true); # Uncomment to force the page to use https:// require("dbconnect.php"); require("includes/functions.php"); require("includes/clientareafunctions.php"); $breadcrumbnav .= '<strong>Here is some info about this page.</strong>'; initialiseClientArea('','',$breadcrumbnav); # To assign variables to the template system use the following syntax. # These can then be referenced using {$variablename} in the template. $smartyvalues["variablename"] = $value; # Check login status if ($_SESSION['uid']) { # User is logged in - put any code you like here # Here's an example to get the currently logged in clients first name $result = mysql_query("SELECT firstname FROM tblclients WHERE id=".(int)$_SESSION['uid']); $data = mysql_fetch_array($result); $clientname = $data[0]; $smartyvalues["clientname"] = $clientname; } else { # User is not logged in } # Define the template filename to be used without the .tpl extension $templatefile = "plr"; outputClientArea($templatefile); ?><?php define("CLIENTAREA",true); //define("FORCESSL",true); # Uncomment to force the page to use https:// require("dbconnect.php"); require("includes/functions.php"); require("includes/clientareafunctions.php"); $pagetitle = $_LANG['clientareatitle']; $breadcrumbnav .= '<strong>InvisionProfits has over 100,000 PLR products available for you to download!</strong>'; initialiseClientArea('','',$breadcrumbnav); # To assign variables to the template system use the following syntax. # These can then be referenced using {$variablename} in the template. $smartyvalues["variablename"] = $value; # Check login status [b]if ($_SESSION['uid']) { $query = "SELECT packageid, domainstatus FROM tblhosting WHERE userid=".$_SESSION['uid']." AND packageid IN ('1','2')"; $result = mysql_query($query); $good = false; while($row = mysql_fetch_array($result)) { if ($row['domainstatus'] == "Active"){ $good = true; } } # To assign variables in Smarty use the following syntax. # This can then be used as {$variablename} in the template $smartyvalues["hasauth"] = $good; # Define the template filename to be used without the .tpl extension $templatefile = "plr"; outputClientArea($templatefile); ?>[/b] However, this code is giving the following error and I have tried everything to figure out what's going on with it: Parse error: syntax error, unexpected $end in /home/invision/public_html/portal/plr.php on line 132 Any idea what's going on or what I need to change? Any help would be greatly appreciated! 0 Quote Link to comment Share on other sites More sharing options...
microbolt Posted November 4, 2011 Share Posted November 4, 2011 Missing and } at the end for the if statement <?php define("CLIENTAREA",true); //define("FORCESSL",true); # Uncomment to force the page to use https:// require("dbconnect.php"); require("includes/functions.php"); require("includes/clientareafunctions.php"); $pagetitle = $_LANG['clientareatitle']; $breadcrumbnav = '<a href="index.php">'.$_LANG['globalsystemname'].'</a>'; $breadcrumbnav .= ' > <a href="plr.php">PLR Products</a>'; initialiseClientArea($pagetitle,'',$breadcrumbnav); # To assign variables to the template system use the following syntax. # These can then be referenced using {$variablename} in the template. $smartyvalues["variablename"] = $value; # Check login status if ($_SESSION['uid']) { # User is logged in - put any code you like here # Here's an example to get the currently logged in clients first name $result = mysql_query("SELECT firstname FROM tblclients WHERE id=".(int)$_SESSION['uid']); $data = mysql_fetch_array($result); $clientname = $data[0]; $smartyvalues["clientname"] = $clientname; } else { # User is not logged in } # Define the template filename to be used without the .tpl extension $templatefile = "plr"; outputClientArea($templatefile); ?><?php define("CLIENTAREA",true); //define("FORCESSL",true); # Uncomment to force the page to use https:// require("dbconnect.php"); require("includes/functions.php"); require("includes/clientareafunctions.php"); $breadcrumbnav .= '<strong>Here is some info about this page.</strong>'; initialiseClientArea('','',$breadcrumbnav); # To assign variables to the template system use the following syntax. # These can then be referenced using {$variablename} in the template. $smartyvalues["variablename"] = $value; # Check login status if ($_SESSION['uid']) { # User is logged in - put any code you like here # Here's an example to get the currently logged in clients first name $result = mysql_query("SELECT firstname FROM tblclients WHERE id=".(int)$_SESSION['uid']); $data = mysql_fetch_array($result); $clientname = $data[0]; $smartyvalues["clientname"] = $clientname; } else { # User is not logged in } # Define the template filename to be used without the .tpl extension $templatefile = "plr"; outputClientArea($templatefile); ?><?php define("CLIENTAREA",true); //define("FORCESSL",true); # Uncomment to force the page to use https:// require("dbconnect.php"); require("includes/functions.php"); require("includes/clientareafunctions.php"); $pagetitle = $_LANG['clientareatitle']; $breadcrumbnav .= '<strong>InvisionProfits has over 100,000 PLR products available for you to download!</strong>'; initialiseClientArea('','',$breadcrumbnav); # To assign variables to the template system use the following syntax. # These can then be referenced using {$variablename} in the template. $smartyvalues["variablename"] = $value; # Check login status if ($_SESSION['uid']) { $query = "SELECT packageid, domainstatus FROM tblhosting WHERE userid=".$_SESSION['uid']." AND packageid IN ('1','2')"; $result = mysql_query($query); $good = false; while($row = mysql_fetch_array($result)) { if ($row['domainstatus'] == "Active") { $good = true; } } # To assign variables in Smarty use the following syntax. # This can then be used as {$variablename} in the template $smartyvalues["hasauth"] = $good; # Define the template filename to be used without the .tpl extension $templatefile = "plr"; outputClientArea($templatefile); [b]} #<---- Missing this brace[/b] ?> 0 Quote Link to comment Share on other sites More sharing options...
EscalateSEO Posted November 4, 2011 Author Share Posted November 4, 2011 Thanks, do you see any issue with the SQL statement or code? For some reason it isn't showing the page to people who actually have packageid's 1 and 2. Any ideas? 0 Quote Link to comment Share on other sites More sharing options...
paddy Posted March 16, 2012 Share Posted March 16, 2012 Hi did you get this working? would be useful to me thanks 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.