sparky Posted November 29, 2008 Share Posted November 29, 2008 See post #15 If you have your php file in the public_html and WHMCS in a directory say "whmcs" then change the includes at the top to this bellow require 'whmcs/dbconnect.php';require 'whmcs/includes/functions.php'; require 'whmcs/init.php'; 0 Quote Link to comment Share on other sites More sharing options...
jlounds Posted January 28, 2009 Share Posted January 28, 2009 I am trying to get this to work, but cannot find the "init.php" file to include. I am running 3.8.1 Stable. Did something change in this version? Thank you! Jeremy 0 Quote Link to comment Share on other sites More sharing options...
sparky Posted January 28, 2009 Share Posted January 28, 2009 I am trying to get this to work, but cannot find the "init.php" file to include. I am running 3.8.1 Stable. Did something change in this version? Thank you! Jeremy init.php is not used anymore with V3.8.1 0 Quote Link to comment Share on other sites More sharing options...
jlounds Posted January 28, 2009 Share Posted January 28, 2009 That's what I figured -- so what file do I need to include instead? Or, how can I test to see if the session is valid? Thanks! 0 Quote Link to comment Share on other sites More sharing options...
marlonsouza Posted March 11, 2009 Share Posted March 11, 2009 hi Sparky, im a usuly a sample and like more think to using a template Smarty in my code, please a post from a sample code complete from development a new pages in WHMCS 0 Quote Link to comment Share on other sites More sharing options...
sparky Posted March 12, 2009 Share Posted March 12, 2009 hi Sparky, im a usuly a sample and like more think to using a template Smarty in my code, please a post from a sample code complete from development a new pages in WHMCS Please be a little clearer in your english. I don't understand what me mean. 0 Quote Link to comment Share on other sites More sharing options...
marlonsouza Posted March 24, 2009 Share Posted March 24, 2009 (edited) how do you include the language file in the client area @sparky, Im need help to develop pages in client area, and use a example http://whmcs.blog.br/principal/criando-uma-pagina-no-whmcs/comment-page-1/ now i'm need include a language file, why not appears text. how can show a text in header.tpl {$LANG.globalsystemname}{$LANG.clientareatitle}{$LANG.announcementstitle}{$LANG.knowledgebasetitle}{$LANG.supportticketspagetitle} Edited March 24, 2009 by marlonsouza 0 Quote Link to comment Share on other sites More sharing options...
sparky Posted March 24, 2009 Share Posted March 24, 2009 The link to the example you supplied is for the older versions of whmcs. If you are running V3.8 + then try here http://wiki.whmcs.com/Creating_Pages 0 Quote Link to comment Share on other sites More sharing options...
Chinmi Posted June 17, 2009 Share Posted June 17, 2009 hey guys, do you have the code for v4? there is no init.php file... what do I do instead? 0 Quote Link to comment Share on other sites More sharing options...
sparky Posted June 17, 2009 Share Posted June 17, 2009 There was no init.php in V3.8 either!! See post #33 0 Quote Link to comment Share on other sites More sharing options...
Chinmi Posted June 17, 2009 Share Posted June 17, 2009 my bad! I am not exactly an experienced php coder but this is what I gather so far... ?php echo date("l F jS Y "); require("dbconnect.php"); require("includes/functions.php"); require("includes/clientareafunctions.php"); if ($_SESSION['uid']) { $result = mysql_query("SELECT firstname,lastname FROM tblclients WHERE id=" . $_SESSION['uid'] . ""); $data = mysql_fetch_array ($result); echo "<hr/><strong>Welcome Back</strong><br>"; echo "<strong>{$data['firstname']}</strong> "; echo "<strong>{$data['lastname']}</strong><br><br>"; echo "<br><br><form method=post action=http://domain.com/logout.php><input type=submit class=submitbutton value=Logout /></form>"; } else { echo '<form method="post" action="http://domain.com/dologin.php?goto=clientarea"> <input type="hidden" name="token" value="##removed##" /> Email Address: <input type="text" name="username" size="50"><br> Password: <input type="password" name="password" size="20"><br> <input type="submit" value="Login"> </form>'; } ?> Now I am just getting the login box despite the fact that I am logged in (as client). I suspect there's something that needs to be changed under the if ($_SESSION['uid']) statement? Care to lend us a hand? 0 Quote Link to comment Share on other sites More sharing options...
BAJI26 Posted June 17, 2009 Share Posted June 17, 2009 my bad! I am not exactly an experienced php coder but this is what I gather so far... ?php echo date("l F jS Y "); require("dbconnect.php"); require("includes/functions.php"); require("includes/clientareafunctions.php"); if ($_SESSION['uid']) { $result = mysql_query("SELECT firstname,lastname FROM tblclients WHERE id=" . $_SESSION['uid'] . ""); $data = mysql_fetch_array ($result); echo "<hr/><strong>Welcome Back</strong><br>"; echo "<strong>{$data['firstname']}</strong> "; echo "<strong>{$data['lastname']}</strong><br><br>"; echo "<br><br><form method=post action=http://domain.com/logout.php><input type=submit class=submitbutton value=Logout /></form>"; } else { echo '<form method="post" action="http://domain.com/dologin.php?goto=clientarea"> <input type="hidden" name="token" value="##removed##" /> Email Address: <input type="text" name="username" size="50"><br> Password: <input type="password" name="password" size="20"><br> <input type="submit" value="Login"> </form>'; } ?> Now I am just getting the login box despite the fact that I am logged in (as client). I suspect there's something that needs to be changed under the if ($_SESSION['uid']) statement? Care to lend us a hand? Looking at that you should only get the Welcome Back, Name and Logout Button... If you are logged out then you should see the Login Box. 0 Quote Link to comment Share on other sites More sharing options...
Chinmi Posted June 17, 2009 Share Posted June 17, 2009 BAJI26: Yeah but even if I am logged in, I still see the login box.. Does it have to do with the fact that I have this login box outside the whmcs folder? (I did do require("whmcs/dbconnect.php"); I just removed them from my post) 0 Quote Link to comment Share on other sites More sharing options...
BAJI26 Posted June 17, 2009 Share Posted June 17, 2009 did you correct the paths for relative to whmcs dir? require("dbconnect.php"); require("includes/functions.php"); require("includes/clientareafunctions.php"); 0 Quote Link to comment Share on other sites More sharing options...
Chinmi Posted June 17, 2009 Share Posted June 17, 2009 I did, I just removed them for the post. I had require("whmcs/dbconnect.php"); require("whmcs/includes/functions.php"); require("whmcs/includes/clientareafunctions.php"); 0 Quote Link to comment Share on other sites More sharing options...
Bucket Posted June 24, 2009 Share Posted June 24, 2009 doesn't work for me :-/ The reason it is not working, is because u might be still using an older version of whmcs. 0 Quote Link to comment Share on other sites More sharing options...
InteraNetworks Posted August 3, 2009 Share Posted August 3, 2009 I use this in my header.tpl above the header image and it shows the login box until client logs on then it shows the welcome message and a logout link What do you think, is there a way to clean up this code a bit? Thanks! ---------------------------------------------------------------------- <table style="width: 100%" cellpadding="0"> <tr> <td> <div align="left"> {if $loggedin} Welcome back {$clientsdetails.firstname} {$clientsdetails.lastname}! :: <a href="logout.php">{$LANG.logouttitle}</a> {else} <form method="post" action="http://www.YOURSITE.COM/YOURDIRECTORY/dologin.php?goto=clientarea"><input type="hidden" name="token" value="FROMYOURWHMCSINTEGRATIONCODEFORLOGIN" /> Email Address: <input type="text" name="username" size="20">Password: <input type="password" name="password" size="12"><input type="submit" value="Login"> </form> {/if} </div> </td> </tr> </table> 0 Quote Link to comment Share on other sites More sharing options...
mknjhill Posted February 5, 2011 Share Posted February 5, 2011 whmcs 4.4.2 only get login box as well. 0 Quote Link to comment Share on other sites More sharing options...
tjmartin Posted March 7, 2011 Share Posted March 7, 2011 Here is the working code that works for me. What this does is adds the login information on your html site and connects to your whmcs database which is in another directory. This code was partly derived from Ronnie at Nextinspire.com and others that have posted on these forums with their various code. <div id="header_login"> <?php require("clients/dbconnect.php"); if ($_SESSION['uid']) { $query="SELECT * FROM tblclients WHERE id='" .$_SESSION['uid'] . "'"; $result = mysql_query($query) or die(mysql_error()); if($row = mysql_fetch_array($result, MYSQL_ASSOC)) { $clientsdetails['firstname']=$row['firstname']; $clientsdetails['lastname']=$row['lastname']; $clientsdetails['email']=$row['email']; } echo " <ul> <li>Welcome back ".($row['firstname'])."!</li> <li><a href=\"/clients/clientarea.php\" title=\"My Dashboard\">My Dashboard</a></li> <li><a href=\"/clients/clientarea.php?action=changepw\" title=\"Change Password\">Change Password</a></li> <li><a href=\"/clients/logout.php\" title=\"Logout\" style=\"border: none;\">Logout</a></li> </ul> "; } else { echo '<form method="post" action="http://domain.com/clients/dologin.php"> <input type="hidden" name="token" value="xxxxxxxxxxxxxxxxxxxxxxxx" /> <dl> <dt>Email Address :</dt><dd><input type="username" type="text" name="username" class="inputbox" /></dd> <dt>Password :</dt><dd><input name="password" type="password" name="password" class="inputbox" /></dd> <dd><button type="submit" class="BtnGo"></button></dd> </dl></form>'; } ?> </div> 0 Quote Link to comment Share on other sites More sharing options...
iPhone Posted March 8, 2011 Share Posted March 8, 2011 Here is the working code that works for me. What this does is adds the login information on your html site and connects to your whmcs database which is in another directory. This code was partly derived from Ronnie at Nextinspire.com and others that have posted on these forums with their various code. <div id="header_login"> <?php require("clients/dbconnect.php"); if ($_SESSION['uid']) { $query="SELECT * FROM tblclients WHERE id='" .$_SESSION['uid'] . "'"; $result = mysql_query($query) or die(mysql_error()); if($row = mysql_fetch_array($result, MYSQL_ASSOC)) { $clientsdetails['firstname']=$row['firstname']; $clientsdetails['lastname']=$row['lastname']; $clientsdetails['email']=$row['email']; } echo " <ul> <li>Welcome back ".($row['firstname'])."!</li> <li><a href=\"/clients/clientarea.php\" title=\"My Dashboard\">My Dashboard</a></li> <li><a href=\"/clients/clientarea.php?action=changepw\" title=\"Change Password\">Change Password</a></li> <li><a href=\"/clients/logout.php\" title=\"Logout\" style=\"border: none;\">Logout</a></li> </ul> "; } else { echo '<form method="post" action="http://domain.com/clients/dologin.php"> <input type="hidden" name="token" value="xxxxxxxxxxxxxxxxxxxxxxxx" /> <dl> <dt>Email Address :</dt><dd><input type="username" type="text" name="username" class="inputbox" /></dd> <dt>Password :</dt><dd><input name="password" type="password" name="password" class="inputbox" /></dd> <dd><button type="submit" class="BtnGo"></button></dd> </dl></form>'; } ?> </div> For this code to work, will I need to use .php files or can .html files be used? 0 Quote Link to comment Share on other sites More sharing options...
sol2010 Posted June 22, 2012 Share Posted June 22, 2012 I tried adding this to a WordPress header - it only shows the login box, even if client is logged in on WHMCS - so, there seems no way to show the "welcome back Joe" messages outside of the WHMCS install ? 0 Quote Link to comment Share on other sites More sharing options...
disgruntled Posted June 22, 2012 Share Posted June 22, 2012 (edited) see this thread http://forum.whmcs.com/showthread.php?48351-Possible-to-show-quot-Welcome-back-name-quot-otherwise-show-login-form for future reference, you can search the forums before posting, often you will find your answer Edited June 22, 2012 by disgruntled 0 Quote Link to comment Share on other sites More sharing options...
kingblink Posted June 25, 2012 Share Posted June 25, 2012 I need to make changes to WHCMS system (its a content management system) The template file comes with .tpl files, how do i edit them in a WYSIWYG environment? 0 Quote Link to comment Share on other sites More sharing options...
disgruntled Posted June 25, 2012 Share Posted June 25, 2012 Well I'm trying to integrate it with Joomla as far as a wrapper is concerned so creating the extra pages within WHMCS is just not feasible You are not creating an extra page in whmcs, you are creating an extra file that will be called by your external pages. the extra file is never meant to be called as a page/directly. the whole point of it is to allow you to use whmcs logins outside of whmcs root directory. Failing that you could just bite the bullet and use whmcs as the website, adding pages is a very simple process.. Kingblink you would have a problem with this because the template files are not a complete layout, it takes several tpl files to create each and every page. The only solution is to make the page in html in your wysiwyg and then convert (cut and paste) the html file into the correct sections so that the template matches your design. this isnt difficult to do, you just need to ensure that when you put together your template you use the whmcs layout to speed up the process of positioning the sections correctly. Failing that, you can simply use your own design, + css and integrate into it in the templates the whmcs logic but the other way is less problematic. 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.