Wh isn't something showing?

Status
Not open for further replies.

galaxyAbstractor

Community Advocate
Community Support
Messages
5,508
Reaction score
35
Points
48
http://jagf.net/bandwidth.php

I am using Brandons bandwidth meter script:

PHP:
 <?php

/*############################
Bandwidth From cPanel
Brandon's cPanel Bandwidth Checker!!!
Brandon, for x10 <brandon@x10hosting.com>
Support Info: http://www.blnetworks.net/showthread.php?p=197#post197
############################*/

// EDIT BELOW
$username = "username"; // cPanel Username
$password = "password"; // cPanel Password
$domain = "domain"; // cPanel Domain
$theme = "x"; // cPanel Theme



// DO NOT EDIT THIS CODE
ini_set("display_errors", "0");
$file = file_get_contents("http://$username:$password@$domain:2082/frontend/$theme/index.html") or die("<b>Critical Error, Please check your configuration</b>");
$string1 = strpos($file, "Bandwidth (this month)");
$file = substr($file,$string1);
$string2 = strpos($file, "Megabytes");
$length = strlen($file);
$take =  $length - $string2;
$finally = substr($file,0,-$take);
$number = explode("<td class=\"index2\">", $finally);
$number = explode(" ",$number[1]);
$bandwidth = $number[0];


// START EDITING
/*
 $bandwith is now the amount of bandwith you have used!
We are echoing it, but you can do whatever with it*/
echo $bandwidth;

?>
 

Penguin129

New Member
Messages
68
Reaction score
0
Points
0
Erm, that script is for cPanel 10. x10 uses cPanel 11, not cPanel 10 so it won't work.
 

Corey

I Break Things
Staff member
Messages
34,551
Reaction score
204
Points
63
Try changing the theme to x3 instead of x.
 

galaxyAbstractor

Community Advocate
Community Support
Messages
5,508
Reaction score
35
Points
48
Mhmmmm. Is there any scripts for 11? I found 1 but It only shows a bar and percentage...
 

Brandon

Former Senior Account Rep
Community Support
Messages
19,181
Reaction score
28
Points
48
We can change your theme to x2 for you, it'll just be the old cPanel theme, I am looking to re-write that script to x3 though soon.
 

galaxyAbstractor

Community Advocate
Community Support
Messages
5,508
Reaction score
35
Points
48
ok.

Btw, corey, I had changed x to x3 but I copied the code from brandons post in his thread
 

Brandon

Former Senior Account Rep
Community Support
Messages
19,181
Reaction score
28
Points
48
Ok, I changed it back to x2, if you want x3 again please let me know via a PM and I can rechange it.

I know this works because I am using it here: http://www.brandonsgames.com/holy_****.php, again, with the x2 theme, sometime tonight or tomorrow I will write a script for x3.
 

galaxyAbstractor

Community Advocate
Community Support
Messages
5,508
Reaction score
35
Points
48
Ty. And do you think it is possible that it can show all time bandwidth usage? So it shows the total from like today? Like every month it adds the bandwidth to a total ammount. Maybe using sql?
 

Brandon

Former Senior Account Rep
Community Support
Messages
19,181
Reaction score
28
Points
48
You could log it with SQL and do some math, all I can think of.
 
Status
Not open for further replies.
Top