minadreapta Posted March 23, 2008 Share Posted March 23, 2008 what i want to do is display the client first name on a page outside the whmcs directory, if the client is logged in. i did this: <?php require("whmcs_dir/dbconnect.php"); require("whmcs_dir/includes/functions.php"); require("whmcs_dir/init.php"); $firstname= $this->get_template_vars('clientsdetails.firstname'); if ($_SESSION['loggedinstatus']=="true") { echo "Welcome $firstname"; } else { echo "Please Login"; } ?> but $firstname= $this->get_template_vars('clientsdetails.firstname'); doesn't work. any ideas on how to output the first name on a page outside whmcs? 0 Quote Link to comment Share on other sites More sharing options...
nielsenj Posted March 25, 2008 Share Posted March 25, 2008 I ran into this the other day get_template_vars doesn't work properly. If it's setup as a sub-page of WHMCS (as it seems to be above) you should be able to access it directly with: $firstname = $GLOBALS['clientsdetails']['firstname']; Alternativly, i prefer this method which seems to have been created for integration purposes: if (!empty($GLOBALS['clientsdetails']['id'])) { require_once ("./includes/clientfunctions.php"); $userdetails = getclientsdetails($GLOBALS['clientsdetails']['id']); } $fullname= $userdetails['firstname']." ". $userdetails['lastname']; $email = $userdetails['email']; Note, the latter method is limited to those 3 variables from what i can tell. It seems to have been created specifically for the Kayako integration. 0 Quote Link to comment Share on other sites More sharing options...
minadreapta Posted March 25, 2008 Author Share Posted March 25, 2008 i used the second one, it worked like a charm. i only needed the $firstname. thank you. 0 Quote Link to comment Share on other sites More sharing options...
SilverNodashi Posted April 4, 2008 Share Posted April 4, 2008 Does anyone know how to put this on a website if it's on a different domain? Out hosting site is on http://www.softdux.com, and our billing on http://billing.softdux.com/whmcs/ 0 Quote Link to comment Share on other sites More sharing options...
bin_asc Posted April 11, 2008 Share Posted April 11, 2008 Would this also retrieve the users password ? 0 Quote Link to comment Share on other sites More sharing options...
JasonO Posted April 12, 2008 Share Posted April 12, 2008 Do you mean Client Area Password? I'm not sure, but if the password is encrypted in the database (I think it is) then you won't be able to decrypt it, as the method used only works one way (Text > Encrpyted). So, you won't be able to show the password string itself. 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.