TheHostingHeroes Posted August 12, 2009 Share Posted August 12, 2009 (edited) Hi if anyone resells Rapidswitch Dedi or VPS Servers here is a perfect little bandwidth graph tool you can add in to WHMCS. firstly on the hosting plan for the Dedi/VPS add 2 custom fields: rsbwid (Display Order 0) rsbwkey (Display Order 1) in rapidswitch control panel open the bandwidth graphs so u can see weekly/monthly etc. right click one of the images and go to properties. you can get the serverID and Bandwidth key from here. Set this on the clients hosting plan in the correct fields. next open templates/YOUR-TEMPLATE/clientareaproductdetails.tpl find the line that begins with {$LANG.clientareaaccountaddons} the line above paste: {if $groupname eq "My Dedicated Server Group Name Goes Here"} <p class="heading2">Bandwidth Graphs</p> <table cellspacing="1" cellpadding="0" class="frame"> <tr> <td><table width="100%" cellpadding="2"> <tr> <td nowrap class="fieldarea"><strong>Total Usage:</strong></td> <td width="100%"><strong></strong></td> </tr> </table> <table border="0" cellpadding="0" cellspacing="5" class="frame"> <tr> <td nowrap class="fieldarea">Last 4 Hours<br>(Updated every 1 minute): </td> <td><div align="center"><img src="https://bandwidth.rapidswitch.com/BWGraph.aspx?serverid={$customfields.1.value}&graphkey={$customfields.2.value}&external=1&gd=newgraph1&timeperiod=4hour" /></div></td> </tr> <tr> <td nowrap class="fieldarea">Last 24 Hours<br>(5 minute average): </td> <td><div align="center"><img src="https://bandwidth.rapidswitch.com/BWGraph.aspx?serverid={$customfields.1.value}&graphkey={$customfields.2.value}&external=1&gd=newgraph1&timeperiod=1day" /></div></td> </tr> <tr> <td nowrap class="fieldarea">Last 7 Days<br>(5 minute average): </td> <td><div align="center"><img src="https://bandwidth.rapidswitch.com/BWGraph.aspx?serverid={$customfields.1.value}&graphkey={$customfields.2.value}&external=1&gd=newgraph1&timeperiod=1week" /></div></td> </tr> <tr> <td nowrap class="fieldarea">Last Month<br>(5 minute average): </td> <td><div align="center"><img src="https://bandwidth.rapidswitch.com/BWGraph.aspx?serverid={$customfields.1.value}&graphkey={$customfields.2.value}&external=1&gd=newgraph1&timeperiod=1month" /></div></td> </tr> <tr> <td nowrap class="fieldarea">Yearly Graph<br>(1 Day average): </td> <td><div align="center"><img src="https://bandwidth.rapidswitch.com/BWGraph.aspx?serverid={$customfields.1.value}&graphkey={$customfields.2.value}&external=1&gd=newgraph1&timeperiod=1year" /></div></td> </tr> </table></td> </tr> </table> {/if} replace My Dedicated Server Group Name Goes Here with the product group name Edited August 12, 2009 by cyberhostpro 0 Quote Link to comment Share on other sites More sharing options...
openmind Posted August 12, 2009 Share Posted August 12, 2009 Good stuff, I'll give this a blast 0 Quote Link to comment Share on other sites More sharing options...
Erik H. Posted August 12, 2009 Share Posted August 12, 2009 Hi, I am unable to get this working. The {$customfields.52.value} value stays emtpy. Why 52 ? In the table tblcustomfields this is the reference to it ? 52 product 10 Bandwithport text Can you tell me what I do wrong ? 0 Quote Link to comment Share on other sites More sharing options...
TheHostingHeroes Posted August 12, 2009 Author Share Posted August 12, 2009 hi dont look in to it too much like i did! just paste it as i put it with 1 & 2 it looks at the hosting plan custom field values not the DB values. ie if your first custom field is rsbwid then it is .1. just try it as it is otherwise PVT me and ill sort you out. 0 Quote Link to comment Share on other sites More sharing options...
jas Posted August 20, 2009 Share Posted August 20, 2009 Very useful, thanks. 0 Quote Link to comment Share on other sites More sharing options...
openmind Posted August 27, 2009 Share Posted August 27, 2009 Got tis working nicely now, good addon 0 Quote Link to comment Share on other sites More sharing options...
openmind Posted August 27, 2009 Share Posted August 27, 2009 Just found a small problem I have dedicated servers and VPS servers in two different groups namely "Dedicated Servers" and "VPS Servers" Now I though I could just update the template by adding a second table with a switch for VPS servers instead but it breaks the script by duplicating the product details. Any ideas? 0 Quote Link to comment Share on other sites More sharing options...
openmind Posted August 27, 2009 Share Posted August 27, 2009 Displaying graphs in admin area: http://forum.whmcs.com/showthread.php?p=120107#post120107 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.