TheGamer Posted January 20, 2007 Share Posted January 20, 2007 Is it possible for me to display text on my site that is displayed to a user only if he is logged in and vice versa? Basically I'm looking at a "Manage Your Account v.s. Signup for an account" type thing. 0 Quote Link to comment Share on other sites More sharing options...
yabado Posted January 20, 2007 Share Posted January 20, 2007 Yes. Look n the header template for an example of how it is done via Smarty. {if $loggedin} Show logged in stuff {else} Show non-logged in stuff {/if} HTH:) 0 Quote Link to comment Share on other sites More sharing options...
TheGamer Posted January 20, 2007 Author Share Posted January 20, 2007 Mmm, nice. Since I want this on my other pages of the site do I need to call any files at the top for config or anything? 0 Quote Link to comment Share on other sites More sharing options...
TheGamer Posted January 20, 2007 Author Share Posted January 20, 2007 To clarify, do I need: <?php require("dbconnect.php"); require("includes/functions.php"); php?> ? 0 Quote Link to comment Share on other sites More sharing options...
WHMCS CEO Matt Posted January 20, 2007 WHMCS CEO Share Posted January 20, 2007 No, that variable is available on all pages. 0 Quote Link to comment Share on other sites More sharing options...
TheGamer Posted January 20, 2007 Author Share Posted January 20, 2007 You do not understand. I don't want to put it onto another page within the client area. I'd like to put this somewhere on my site. Like the homepage of http://www.registraramerica.com or something. On another note, I did the "impossible", I have a registration form on my site http://www.registraramerica.com/register.php 0 Quote Link to comment Share on other sites More sharing options...
MACscr Posted January 20, 2007 Share Posted January 20, 2007 You do not understand. I don't want to put it onto another page within the client area. I'd like to put this somewhere on my site. Like the homepage of http://www.registraramerica.com or something. On another note, I did the "impossible", I have a registration form on my site http://www.registraramerica.com/register.php Who said it was impossible and what are you trying to accomplish? 0 Quote Link to comment Share on other sites More sharing options...
TheGamer Posted January 20, 2007 Author Share Posted January 20, 2007 I'm trying to accomplish this. If a user's logged in, display Manage My Account | Logout If a user's logged out, display Login | Register Account And 'impossible' was not the exact terminology, but I was lead to believe it could not be done here: http://www.whmcs.com/forums/viewtopic.php?t=2215&highlight=register 0 Quote Link to comment Share on other sites More sharing options...
generic Posted January 20, 2007 Share Posted January 20, 2007 Yes. Look n the header template for an example of how it is done via Smarty. {if $loggedin} Show logged in stuff {else} Show non-logged in stuff {/if} what is suggested here should work for you then. 0 Quote Link to comment Share on other sites More sharing options...
TheGamer Posted January 20, 2007 Author Share Posted January 20, 2007 I want to display that on every page inside my top.php include file, which consists of the whole area from the main menu up on every page of my site at http://www.registraramerica.com 0 Quote Link to comment Share on other sites More sharing options...
generic Posted January 21, 2007 Share Posted January 21, 2007 so why not do it then. should work just fine. 0 Quote Link to comment Share on other sites More sharing options...
MACscr Posted January 21, 2007 Share Posted January 21, 2007 so why not do it then. should work just fine. generic, that would only work if all the pages of his site used the whmcs templates or he included this in his header (note: he has already been told to do this): require("PATHTOWHMCSINSTALL/dbconnect.php"); require("PATHTOWHMCSINSTALL/includes/functions.php"); in your case, the header would be top.php and your paths would be require("clients/dbconnect.php"); require("clients/includes/functions.php"); 0 Quote Link to comment Share on other sites More sharing options...
generic Posted January 21, 2007 Share Posted January 21, 2007 i was under the inpression he could just cheeck for the logged in variable and use the results. all he wants to do is show a link or not, not use the actual data. 0 Quote Link to comment Share on other sites More sharing options...
MACscr Posted January 21, 2007 Share Posted January 21, 2007 but the logged in variable wouldnt be set for his files. 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.