Mar
15
2009

WHMCS How to: Only display affiliates link to active affiliates

First find the header.tpl file in your templates folder.

Now go down to the clientarealinks paragraph and find the line that looks like :

Code:
<a href="affiliates.php"><img src="images/affiliates.gif" border="0" hspace="5" alt="" />{$LANG.affiliatestitle}</a>

Now replace that line with the following code

Code:
{* Check for active affiliate *}
{php}
	extract($this->_tpl_vars);
	$query = 'SELECT count(*) as count FROM tblaffiliates WHERE clientid = '.$clientsdetails['userid'];
	$result = mysql_query ($query);
	$data = @mysql_fetch_array ($result);
	if ($data['count'] > 0) {
{/php}
<a href="affiliates.php"><img src="images/affiliates.gif" border="0" hspace="5" alt="" />{$LANG.affiliatestitle}</a>
{php} } {/php}

Save and reupload to your server. Let me know if you find it useful!

tags: ,
posted in Guides by Owen

Follow comments via the RSS Feed | Leave a comment | Trackback URL

1 Comment to "WHMCS How to: Only display affiliates link to active affiliates"

  1. KrisBelucci wrote:

    Hi, good post. I have been wondering about this issue,so thanks for posting. I’ll definitely be coming back to your site.

Leave Your Comment

 
© 2008 - 2010 — All Rights Reserved — Ideamesh, Inc. 23 queries. 0.237 seconds.