Jump to content

Client Area Email Link


Recommended Posts

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.

 

picture.png

Link to comment
Share on other sites

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...

HQZ2J7n.png

Link to comment
Share on other sites

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...

HQZ2J7n.png

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated