alirazakhalid Posted August 14, 2014 Share Posted August 14, 2014 Hello Guys, I need some info about client area email link. I am trying to finding a client area email link auto counting. the link i am asking for is that when you log in your client area under the ACCOUNT OVERVIEW on the 4th position i want to change to Affiliate to Emails. Below you will find the code that i am trying to change but couldn't find the way to get it right one. This is code: <p>{$LANG.navemailssent}: <a href="clientarea.php?action=emails"><strong>{$clientsstats.numaffiliatesignups}</strong> - {$LANG.view} »</a></p> I want to change this part to email part. {$clientsstats.numaffiliatesignups} ---> {$clientsstats.xxxxxxxx}---- ??? I hope you will get my point please advise me where i can find this code or add the clientsstats email ? Regard. If someone don't understand please find the picture in attachment. 0 Quote Link to comment Share on other sites More sharing options...
edwardmill Posted August 14, 2014 Share Posted August 14, 2014 Same problem i am facing too. 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted August 14, 2014 Share Posted August 14, 2014 i'll answer this as Edward pm'd me and i'm not travelling until later today... the short answer is that you can't do this directly because the "number of emails" value is not available on that page - therefore, you will need to query the database to obtain this value and then assign it to a Smarty variable so that you can use it wherever you want to. so in clientareahome.tpl, you should see the following code... <p>{$LANG.statsnumreferredsignups}: <a href="affiliates.php"><strong>{$clientsstats.numaffiliatesignups}</strong> - {$LANG.view} »</a></p> now before this line (anywhere before will do), you will need to add the code that queries the database and obtains the number of emails for that customer - to do that, you add this code to the template... {php} $clientsdetails = $this->get_template_vars(clientsdetails); $smartyuserid = $clientsdetails['userid']; $query = mysql_query("SELECT COUNT(userid) AS userid FROM tblemails WHERE userid = $smartyuserid"); $result = mysql_fetch_array($query); $emailcount = $result["userid"]; $this->assign("emailcount", $emailcount); {/php} this will store the result in a Smarty variable called "emailcount" - which you can then display anywhere on this page using {$emailcount} now you can change the line that you want to change... <p>{$LANG.statsnumemails}: <a href="clientarea.php?action=emails"><strong>{$emailcount}</strong> - {$LANG.view} »</a></p> one other thing that you will need to do is add the $LANG.statsnumemails value to your language file(s) - ideally using Language Overrides - http://docs.whmcs.com/Language_Overrides $_LANG['statsnumemails'] = "Number of Emails"; if you've make the changes correctly, you should now see something like this... 0 Quote Link to comment Share on other sites More sharing options...
edwardmill Posted August 14, 2014 Share Posted August 14, 2014 Thank you so much brain. You made my day. i'll answer this as Edward pm'd me and i'm not travelling until later today... the short answer is that you can't do this directly because the "number of emails" value is not available on that page - therefore, you will need to query the database to obtain this value and then assign it to a Smarty variable so that you can use it wherever you want to. so in clientareahome.tpl, you should see the following code... <p>{$LANG.statsnumreferredsignups}: <a href="affiliates.php"><strong>{$clientsstats.numaffiliatesignups}</strong> - {$LANG.view} »</a></p> now before this line (anywhere before will do), you will need to add the code that queries the database and obtains the number of emails for that customer - to do that, you add this code to the template... {php} $clientsdetails = $this->get_template_vars(clientsdetails); $smartyuserid = $clientsdetails['userid']; $query = mysql_query("SELECT COUNT(userid) AS userid FROM tblemails WHERE userid = $smartyuserid"); $result = mysql_fetch_array($query); $emailcount = $result["userid"]; $this->assign("emailcount", $emailcount); {/php} this will store the result in a Smarty variable called "emailcount" - which you can then display anywhere on this page using {$emailcount} now you can change the line that you want to change... <p>{$LANG.statsnumemails}: <a href="clientarea.php?action=emails"><strong>{$emailcount}</strong> - {$LANG.view} »</a></p> one other thing that you will need to do is add the $LANG.statsnumemails value to your language file(s) - ideally using Language Overrides - http://docs.whmcs.com/Language_Overrides $_LANG['statsnumemails'] = "Number of Emails"; if you've make the changes correctly, you should now see something like this... 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.