ae6dx Posted February 3, 2013 Share Posted February 3, 2013 Sorry to post to an old thread but in post #1 I can't find the code you are supposed to find to add below. Where do i add this code? using v 5.1.x 0 Quote Link to comment Share on other sites More sharing options...
jvriends Posted February 18, 2013 Share Posted February 18, 2013 Is there a new version for 5.1.3? 0 Quote Link to comment Share on other sites More sharing options...
xxxmicrobexxx Posted March 27, 2013 Share Posted March 27, 2013 (edited) BUG? I have some hosting I give for free. The upcoming hosting renewals continues to show them despite them having no Next Due Date - see attachments. Maybe it needs a tweak "if amount due == $0 then do not display". If I wasn't heading away for 6 weeks from Saturday I would try to sort it myself. Edited March 27, 2013 by xxxmicrobexxx 0 Quote Link to comment Share on other sites More sharing options...
arroyof Posted April 11, 2013 Share Posted April 11, 2013 Show Upcoming Domain Renewals on the Admin V4 homepage that will expire in the next 90 days.Change the number in $range = "<= 90"; to the number of days before expiry that you want to display. Open admin/templates/v4/homepage.tpl Find: <div class="errorbox" style="font-size:14px;"><a href="supporttickets.php">{$sidebarstats.tickets.awaitingreply} Ticket(s) Awaiting Reply</a> || <a href="cancelrequests.php">{$stats.cancellations.pending} Pending Cancellation(s)</a> || <a href="todolist.php">{$stats.todoitems.due} To-Do Item(s) Due</a> || <a href="networkissues.php">{$stats.networkissues.open} Open Network Issue(s)</a></div> <br /> Underneath it insert this code: <!-- START ADMIN UPCOMING DOMAIN RENEWALS --> <h3 align="center">Upcoming Domain Renewals</h3> <table bgcolor="#cccccc" align="center" style="margin-bottom:5px;width:100%;" cellspacing="1"> <tr bgcolor="#efefef" style="text-align:center;font-weight:bold;"><td>Domain</td><td>Registrar</td><td>Period</td><td>Next Due Date</td><td>Expiration Date</td><td>Amount</td><td>Do Not<br />Renew</td></tr> {php} $x=1; $range = "<= 90"; $result = mysql_query("SELECT * FROM `tbldomains` WHERE DATEDIFF(`expirydate`, Now()) $range AND `status` = 'Active' ORDER BY `expirydate` ASC"); while ($data = @mysql_fetch_array ($result)) { echo '<tr bgcolor="#ffffff" style="text-align:center;"><td><a href="clientsdomains.php?userid='.$data['userid'].'&id='.$data['id'].'">'.$data['domain'].'</a></td><td>'.$data['registrar'].'</td><td>'.$data['registrationperiod'].'</td><td>'.fromMySQLDate($data['nextduedate']).'</td><td>'.fromMySQLDate($data['expirydate']).'</td><td>'.formatCurrency($data['recurringamount']).'</td><td>'.$data['donotrenew'].'</td></tr>'; $x=0; } if($x) echo '<tr bgcolor="#ffffff" style="text-align:center;"><td colspan="7">No upcoming domain renewals</td></tr>'; {/php} </table> <br /> <!-- END ADMIN UPCOMING DOMAIN RENEWALS --> Perfect, thank you! 0 Quote Link to comment Share on other sites More sharing options...
arroyof Posted April 11, 2013 Share Posted April 11, 2013 BUG? I have some hosting I give for free. The upcoming hosting renewals continues to show them despite them having no Next Due Date - see attachments. Maybe it needs a tweak "if amount due == $0 then do not display". If I wasn't heading away for 6 weeks from Saturday I would try to sort it myself. [ATTACH=CONFIG]4486[/ATTACH] [ATTACH=CONFIG]4483[/ATTACH] This is not a bug, you had set the product as free, by this not there renews, if you change to monthly or anyone, will change to true date. 0 Quote Link to comment Share on other sites More sharing options...
Dgital Essence Posted March 24, 2014 Share Posted March 24, 2014 (edited) If anyone is interested, I've taken Sparky's code and created a Widget for the homepage. This is running on my version 5.3.5 Just create a new file in modules/widgets and paste this code in. Then head over to Setup > Staff Management > Administrator Roles > Edit and scroll down to Widgets and then tick yours (in this example it's called "Expiring Domains". I've no idea if this is the correct way to do it or won't break everything and make the sky fall down but it works for me. <?php if (!defined("WHMCS")) die("This file cannot be accessed directly"); function widget_domains_expiring() { $content = '<table bgcolor="#cccccc" align="center" style="margin-bottom:5px;width:100%;" cellspacing="1"> <tr bgcolor="#efefef" style="text-align:center;font-weight:bold;"><td>Domain</td><td>Registrar</td><td>Period</td><td>Next Due Date</td><td>Expiration Date</td><td>Amount</td><td>Do Not<br />Renew</td></tr>'; $x=1; $range = "<= 90"; $result = mysql_query("SELECT * FROM `tbldomains` WHERE DATEDIFF(`expirydate`, Now()) $range AND `status` = 'Active' ORDER BY `expirydate` ASC"); while ($data = @mysql_fetch_array ($result)) { $content .= '<tr bgcolor="#ffffff" style="text-align:center;"><td><a href="clientsdomains.php?userid='.$data['userid'].'&id='.$data['id'].'">'.$data['domain'].'</a></td><td>'.$data['registrar'].'</td><td>'.$data['registrationperiod'].'</td><td>'.fromMySQLDate($data['nextduedate']).'</td><td>'.fromMySQLDate($data['expirydate']).'</td><td>'.formatCurrency($data['recurringamount']).'</td><td>'.$data['donotrenew'].'</td></tr>'; $x=0; } if($x) $content = '<tr bgcolor="#ffffff" style="text-align:center;"><td colspan="7">No upcoming domain renewals</td></tr>'; $content .= '</table>'; return array( 'title' => 'Expiring Domains', 'content' => $content ); } add_hook("AdminHomeWidgets",1,"widget_domains_expiring"); ?> Edited March 24, 2014 by Dgital Essence Added PHP code tags around code 0 Quote Link to comment Share on other sites More sharing options...
blakeh Posted September 28, 2014 Share Posted September 28, 2014 If anyone is interested, I've taken Sparky's code and created a Widget for the homepage. This is running on my version 5.3.5 Just create a new file in modules/widgets and paste this code in. Then head over to Setup > Staff Management > Administrator Roles > Edit and scroll down to Widgets and then tick yours (in this example it's called "Expiring Domains". I've no idea if this is the correct way to do it or won't break everything and make the sky fall down but it works for me. Thank you! This is fantastic and I've already integrated it. In one of my whmcs installs I changed the range to 30 days so the list wasn't so long. bh 0 Quote Link to comment Share on other sites More sharing options...
Dgital Essence Posted September 29, 2014 Share Posted September 29, 2014 Thank you! This is fantastic and I've already integrated it. In one of my whmcs installs I changed the range to 30 days so the list wasn't so long. bh Glad I could help. 0 Quote Link to comment Share on other sites More sharing options...
jin Posted September 29, 2014 Share Posted September 29, 2014 Glad I could help. Very nice, thank you for providing this. 0 Quote Link to comment Share on other sites More sharing options...
Dgital Essence Posted September 29, 2014 Share Posted September 29, 2014 Very nice, thank you for providing this. Remember all I did was slap some code around it to make it into a widget. Sparky did all the complicated magic! 0 Quote Link to comment Share on other sites More sharing options...
Aequitas Posted March 5, 2015 Share Posted March 5, 2015 Thanks, this widget also works for me on the latest - 5.3.12 0 Quote Link to comment Share on other sites More sharing options...
Stephens Posted May 8, 2015 Share Posted May 8, 2015 @Dgital Essence, This is great. It works with 5.3.13. Could you help do the rest as well and convert them to widget? It could be hosting expiring and add-on expiring. Regards Stephen If anyone is interested, I've taken Sparky's code and created a Widget for the homepage. This is running on my version 5.3.5 Just create a new file in modules/widgets and paste this code in. Then head over to Setup > Staff Management > Administrator Roles > Edit and scroll down to Widgets and then tick yours (in this example it's called "Expiring Domains". I've no idea if this is the correct way to do it or won't break everything and make the sky fall down but it works for me. <?php if (!defined("WHMCS")) die("This file cannot be accessed directly"); function widget_domains_expiring() { $content = '<table bgcolor="#cccccc" align="center" style="margin-bottom:5px;width:100%;" cellspacing="1"> <tr bgcolor="#efefef" style="text-align:center;font-weight:bold;"><td>Domain</td><td>Registrar</td><td>Period</td><td>Next Due Date</td><td>Expiration Date</td><td>Amount</td><td>Do Not<br />Renew</td></tr>'; $x=1; $range = "<= 90"; $result = mysql_query("SELECT * FROM `tbldomains` WHERE DATEDIFF(`expirydate`, Now()) $range AND `status` = 'Active' ORDER BY `expirydate` ASC"); while ($data = @mysql_fetch_array ($result)) { $content .= '<tr bgcolor="#ffffff" style="text-align:center;"><td><a href="clientsdomains.php?userid='.$data['userid'].'&id='.$data['id'].'">'.$data['domain'].'</a></td><td>'.$data['registrar'].'</td><td>'.$data['registrationperiod'].'</td><td>'.fromMySQLDate($data['nextduedate']).'</td><td>'.fromMySQLDate($data['expirydate']).'</td><td>'.formatCurrency($data['recurringamount']).'</td><td>'.$data['donotrenew'].'</td></tr>'; $x=0; } if($x) $content = '<tr bgcolor="#ffffff" style="text-align:center;"><td colspan="7">No upcoming domain renewals</td></tr>'; $content .= '</table>'; return array( 'title' => 'Expiring Domains', 'content' => $content ); } add_hook("AdminHomeWidgets",1,"widget_domains_expiring"); ?> 0 Quote Link to comment Share on other sites More sharing options...
kran Posted June 19, 2015 Share Posted June 19, 2015 This script sttoped working? for domains? 0 Quote Link to comment Share on other sites More sharing options...
Himeko Posted July 27, 2015 Share Posted July 27, 2015 It doesn't work anymore in 6.x as they seem to have removed support for "{php}" in the templates. 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted July 27, 2015 Share Posted July 27, 2015 It doesn't work anymore in 6.x as they seem to have removed support for "{php}" in the templates. just tested the above code and it works fine for me in v6 - the {php} is irrelevant as this isn't used in a template, it's a widget and goes in the widgets folder. http://docs.whmcs.com/Widgets 0 Quote Link to comment Share on other sites More sharing options...
caisc Posted August 29, 2015 Share Posted August 29, 2015 @brian can you plz share your widget code with us, I tried to create the widget with Sparky's code but it broke down the whmcs Admin home page, thus i had to revert back. Also I wud request Sparky to update this code snippet in widget form so that its easier for all of us to use this one. Thanks 0 Quote Link to comment Share on other sites More sharing options...
rota919 Posted August 29, 2015 Share Posted August 29, 2015 @brian can you plz share your widget code with us, I tried to create the widget with Sparky's code but it broke down the whmcs Admin home page, thus i had to revert back. Also I wud request Sparky to update this code snippet in widget form so that its easier for all of us to use this one. Thanks A couple of posts up is the code for a widget version of the script. it is working just fine in ver 6.02 0 Quote Link to comment Share on other sites More sharing options...
Himeko Posted August 29, 2015 Share Posted August 29, 2015 Yep widget is working fine. 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted August 29, 2015 Share Posted August 29, 2015 @brian can you plz share your widget code with us, I tried to create the widget with Sparky's code but it broke down the whmcs Admin home page, thus i had to revert back. i've posted my code in the thread you started. http://forum.whmcs.com/showthread.php?105270-Admin-Home-Page-Widget-for-Upcoming-Hosting-Renewals-v6-template&p=433535#post433535 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.