d-j
April 23rd, 2007, 20:25
How to use 'Cpanel Analyzer ver 0.1':
- Copy and Paste this code to notepad (or your text editor)
- change username, password, domain, and theme in configuration section
- Save as => xxxx.php
- Test in your hosting :)
<?php
/*
- ------------------------
- Cpanel Analyzer ver 0.1
- by dj
- ------------------------
- You can modify this code as you want, but let my credit stay in your code ^_^
- I hope this script can be useful for you, guys...
- Let me know if you find bug(s), find me in FreeWebSpace.net/forum (username: d-j)
- ------------------------
- (work on Cpanel x and x2 theme)
- Special thx to:
- - Brandon <brandon@x10hosting.com> - inspiration code
- - FreeWebSpace.net - I find the new world :p
- - You - Have fun...
*/
// Configurations
$username = "your username"; // cPanel Username
$password = "your password"; // cPanel Password
$domain = "blablabla.com"; // cPanel Domain
$theme = "x2"; // cPanel Theme, x or x2
//GAI = General account information:
$gai[] = "Hosting package";
$gai[] = "Shared Ip Address";
//$gai[] = "Subdomains"; // Let's skip this section, because Cpanel have a fail html code in here
$gai[] = "Parked Domains";
$gai[] = "Addon Domains";
$gai[] = "MySQL Databases";
$gai[] = "Disk Space Usage";
$gai[] = "MySQL Disk Space";
$gai[] = "Disk space available";
$gai[] = "Bandwidth (this month)";
$gai[] = "Email Accounts";
$gai[] = "Email Forwarders";
$gai[] = "Auto-responders";
$gai[] = "Email Filters";
$gai[] = "Ftp Accounts";
//GSI = General server information:
$gsi[] = "Operating system";
$gsi[] = "Kernel version";
$gsi[] = "Machine Type";
$gsi[] = "Apache version";
$gsi[] = "PERL version";
$gsi[] = "Path to PERL";
$gsi[] = "Path to sendmail";
$gsi[] = "PHP version";
$gsi[] = "MySQL version";
$gsi[] = "cPanel Build";
$gsi[] = "Theme";
$gsi[] = "cPanel Pro";
// Core of the Cpanel Analyzer
function Analyze ($key, $file, $sp = " - "){
for ($i=0; $i<count($key) ;$i++){
$temp = explode(strtolower($key[$i])."</td>",$file); //Convert to array
$file = $temp[1]; //Never waste your resource we will use it for next section :)
$temp = str_replace(chr(34),"",$temp[1]); //We dont need " (quote)
$temp = trim(str_replace("<td class=index2>","",$temp)); //Remove <td class=index2>
$pos = strpos($temp, "</td>"); //Find the position of </td>
$result .= $key[$i].$sp.substr($temp,0,$pos)."<br>"; //Bingo... we get it that we want ^_^
}
return $result;
}
// Main Program
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>");
$file = strtolower($file);
// Do what do you want... ^_^
echo Analyze($gai,$file);
echo "<hr>";
echo Analyze($gsi,$file," => ");
?>
This's the output of 'Cpanel Analyzer ver 0.1':
Hosting package - xxxx
Shared Ip Address - xxxx
Parked Domains - 0 / 0
Addon Domains - 1 / 2
MySQL Databases - 6 / unlimited
Disk Space Usage - 66.67 megabytes
MySQL Disk Space - 3.45 megabytes
Disk space available - 433.33 megabytes
Bandwidth (this month) - 109.31 megabytes
Email Accounts - 3 / unlimited
Email Forwarders - 0
Auto-responders - 0
Email Filters - 0
Ftp Accounts - 2 / unlimited
--------------------------------------------------------------------------------
Operating system => linux
Kernel version => 2.6.9-42.0.3.elsmp
Machine Type => i686
Apache version => 1.3.37 (unix)
PERL version => 5.8.7
Path to PERL => /usr/bin/perl
Path to sendmail => /usr/sbin/sendmail
PHP version => 4.4.4
MySQL version => 4.1.21-standard
cPanel Build => 10.9.0-current 75
Theme => cpanel x v2.6.0
cPanel Pro => 1.0 (rc1)
- Copy and Paste this code to notepad (or your text editor)
- change username, password, domain, and theme in configuration section
- Save as => xxxx.php
- Test in your hosting :)
<?php
/*
- ------------------------
- Cpanel Analyzer ver 0.1
- by dj
- ------------------------
- You can modify this code as you want, but let my credit stay in your code ^_^
- I hope this script can be useful for you, guys...
- Let me know if you find bug(s), find me in FreeWebSpace.net/forum (username: d-j)
- ------------------------
- (work on Cpanel x and x2 theme)
- Special thx to:
- - Brandon <brandon@x10hosting.com> - inspiration code
- - FreeWebSpace.net - I find the new world :p
- - You - Have fun...
*/
// Configurations
$username = "your username"; // cPanel Username
$password = "your password"; // cPanel Password
$domain = "blablabla.com"; // cPanel Domain
$theme = "x2"; // cPanel Theme, x or x2
//GAI = General account information:
$gai[] = "Hosting package";
$gai[] = "Shared Ip Address";
//$gai[] = "Subdomains"; // Let's skip this section, because Cpanel have a fail html code in here
$gai[] = "Parked Domains";
$gai[] = "Addon Domains";
$gai[] = "MySQL Databases";
$gai[] = "Disk Space Usage";
$gai[] = "MySQL Disk Space";
$gai[] = "Disk space available";
$gai[] = "Bandwidth (this month)";
$gai[] = "Email Accounts";
$gai[] = "Email Forwarders";
$gai[] = "Auto-responders";
$gai[] = "Email Filters";
$gai[] = "Ftp Accounts";
//GSI = General server information:
$gsi[] = "Operating system";
$gsi[] = "Kernel version";
$gsi[] = "Machine Type";
$gsi[] = "Apache version";
$gsi[] = "PERL version";
$gsi[] = "Path to PERL";
$gsi[] = "Path to sendmail";
$gsi[] = "PHP version";
$gsi[] = "MySQL version";
$gsi[] = "cPanel Build";
$gsi[] = "Theme";
$gsi[] = "cPanel Pro";
// Core of the Cpanel Analyzer
function Analyze ($key, $file, $sp = " - "){
for ($i=0; $i<count($key) ;$i++){
$temp = explode(strtolower($key[$i])."</td>",$file); //Convert to array
$file = $temp[1]; //Never waste your resource we will use it for next section :)
$temp = str_replace(chr(34),"",$temp[1]); //We dont need " (quote)
$temp = trim(str_replace("<td class=index2>","",$temp)); //Remove <td class=index2>
$pos = strpos($temp, "</td>"); //Find the position of </td>
$result .= $key[$i].$sp.substr($temp,0,$pos)."<br>"; //Bingo... we get it that we want ^_^
}
return $result;
}
// Main Program
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>");
$file = strtolower($file);
// Do what do you want... ^_^
echo Analyze($gai,$file);
echo "<hr>";
echo Analyze($gsi,$file," => ");
?>
This's the output of 'Cpanel Analyzer ver 0.1':
Hosting package - xxxx
Shared Ip Address - xxxx
Parked Domains - 0 / 0
Addon Domains - 1 / 2
MySQL Databases - 6 / unlimited
Disk Space Usage - 66.67 megabytes
MySQL Disk Space - 3.45 megabytes
Disk space available - 433.33 megabytes
Bandwidth (this month) - 109.31 megabytes
Email Accounts - 3 / unlimited
Email Forwarders - 0
Auto-responders - 0
Email Filters - 0
Ftp Accounts - 2 / unlimited
--------------------------------------------------------------------------------
Operating system => linux
Kernel version => 2.6.9-42.0.3.elsmp
Machine Type => i686
Apache version => 1.3.37 (unix)
PERL version => 5.8.7
Path to PERL => /usr/bin/perl
Path to sendmail => /usr/sbin/sendmail
PHP version => 4.4.4
MySQL version => 4.1.21-standard
cPanel Build => 10.9.0-current 75
Theme => cpanel x v2.6.0
cPanel Pro => 1.0 (rc1)