PDA

View Full Version : Do not show expired domains over 30 days or canceled domains



newgenservices
05-05-11, 11:11 AM
1) Backup \templates\portal\clientareadomains.tpl (or the same file under any other template you use) and Open the file in notepad or any code editor you use
2) Add the following code before line #1


{php}
$clientarea_domainlist = $this->_tpl_vars['domains'];
for($domi=0;$domi<count($clientarea_domainlist);$domi++){
$clientarea_domainlist[$domi]['nextduedate'] = str_replace("/","-",$clientarea_domainlist[$domi]['nextduedate']);
$domainexpiryts = strtotime($clientarea_domainlist[$domi]['nextduedate']);
$before30daysts = time()- (30 * 24 * 60 * 60);
if( ( ($clientarea_domainlist[$domi]['status'] == "expired") && ($domainexpiryts>$before30daysts) ) || ($clientarea_domainlist[$domi]['status'] == "cancelled") ){
unset($clientarea_domainlist[$domi]);
}
}
sort($clientarea_domainlist); $this->_tpl_vars['domains'] = $clientarea_domainlist; $this->_tpl_vars['numproducts'] = count($clientarea_domainlist);
{/php}
3) Save the file and overwrite existing \templates\portal\clientareadomains.tpl on your server.

If you are using WHMCS 4.4.2 and portal template, you can as well download the attached clientareadomains.tpl.zip in this post, extract and overwrite it. DO NOT overwrite with attached if you are using a different or custom template.

This will hide all expired domains over 30 days or canceled domains from your clientarea domains list.

Manchester Web Hosting
07-17-11, 02:19 PM
If you are using WHMCS 4.4.2 and portal template, you can as well download the attached clientareadomains.tpl.zip in this post, extract and overwrite it. DO NOT overwrite with attached if you are using a different or custom template.

Does this work for the latest version of WHMCS? as i see your using 4.4.2 and the template from there..any users tried this on the new version?:roll:

Si
07-18-11, 07:14 AM
Does this work for the latest version of WHMCS? as i see your using 4.4.2 and the template from there..any users tried this on the new version?:roll:

4.5.2 - It works (kind of).

It works when you go to the domains page, but if the client clicks on the 'Show 100' domains link or 'show all' etc, the resulting pages show the expired/cancelled domains.

ie, the url that ends with: clientarea.php?action=domains&page=3

When the customer goes back to his domain's main page, all of the domains older than 30 days show up again. :-(

Almost does the job, but not quite.

Si