Lawrence Posted September 15, 2008 Share Posted September 15, 2008 Hi, I've been trying to integrate the Upcoming Domain Renewals bit into my clients area for our clients. I can get it to work fine when coded directly into clientareahome.tpl. Below is the code I am using: {php} $display_domain=0; $result = mysql_query("SELECT * FROM tbldomains WHERE userid = ".$_SESSION['uid']." AND status = 'Active' LIMIT 1"); if(mysql_num_rows($result) > 0){ $display_domain=1; } if($display_domain){ {/php} <p><strong>Upcoming Domain Renewals</strong></p> <table align="center" style="width:90%" class="clientareatable" cellspacing="1"> <tr class="clientareatableheading"><td>Domain</td><td>Expiration Date</td><td></td></tr> {php} $i=1; //$range = "<= 30"; //$range = "<= 45"; //$range = "<= 60"; $range = "BETWEEN 15 AND 60"; //$range = "BETWEEN 30 AND 60"; $result = mysql_query("SELECT *, DATE_FORMAT(expirydate, '%d/%m/%Y') AS fdate FROM tbldomains WHERE userid='".$_SESSION['uid']."' AND DATEDIFF(expirydate, NOW()) ".$range." AND status='Active' AND id NOT IN (SELECT relid FROM tblinvoiceitems t1 INNER JOIN tblinvoices t2 ON t1.invoiceid = t2.id WHERE t1.type = 'Domain' AND t2.status != 'Paid') ORDER BY `expirydate` ASC "); while($data = mysql_fetch_array($result)) { echo '<tr class="clientareatableactive"><td>'.$data['domain'].'</td><td>'.$data['fdate'].'</td><td><form method="post" action="clientarea.php?action=domainrenew"><input name="domainid" value="'.$data['id'].'" type="hidden"><input value="Renew Domain" class="button" type="submit"></form></td></tr>'; $i=0; } if($i)echo '<tr class="clientareatableactive"><td colspan="2">No upcoming domain renewals</td><td><a href="clientarea.php?action=domains">View Domains</a></td></tr>'; {/php} </table> {php} } {/php} However, when I move this to "upcomingdomainrenewals.tpl" and include the file on clientareahome.tpl using the following code, nothing appears (no content or errors): {include file='upcomingdomainrenewals.tpl'}; Any advice? 0 Quote Link to comment Share on other sites More sharing options...
Lawrence Posted September 15, 2008 Author Share Posted September 15, 2008 Found the answer on: http://forum.whmcs.com/showthread.php?t=12309&highlight=include+file Simply include the template name as part of the file= bit. In my case, I am using the "portal" template, so it was {include file='portal/upcomingdomainrenewals.tpl'} 0 Quote Link to comment Share on other sites More sharing options...
Zorro67 Posted September 16, 2008 Share Posted September 16, 2008 Sorry, that was my fault. I removed my template name for the link on my previous post. 0 Quote Link to comment Share on other sites More sharing options...
BAJI26 Posted September 16, 2008 Share Posted September 16, 2008 You got two errors in your code didn't know if you knew that. 0 Quote Link to comment Share on other sites More sharing options...
Lawrence Posted September 17, 2008 Author Share Posted September 17, 2008 You got two errors in your code didn't know if you knew that. What would those errors be? It works fine for me, so I am curious 0 Quote Link to comment Share on other sites More sharing options...
BAJI26 Posted September 17, 2008 Share Posted September 17, 2008 My appologies when I missed the ending of the code. 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.