/***************************************************************************
Jupiter Content System @ Jupiterportal.com
Copyright (C) 2005 Cosmin Flavius (highstrike@gmail.com)
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
More Info About The Licence At http://www.gnu.org/copyleft/gpl.html
****************************************************************************/
//-----------------------------------------------------------------
// Filter Acces Rightes
//-----------------------------------------------------------------
if(isset($is_guest))
{ header("location: $PHP_SELF?i=2"); exit; }
//-----------------------------------------------------------------
// Get Logged in User's Info
//-----------------------------------------------------------------
$user_info = $db->getLine("SELECT forumposts, lastvisit FROM users WHERE id = '{$_SESSION['id']}' AND username = '{$_SESSION['username']}'");
//-----------------------------------------------------------------
// Count Bans
//-----------------------------------------------------------------
$TotalBansCount = $db->getInfo_countRows("bans");
//-----------------------------------------------------------------
// Count Forum Topics and Posts
//-----------------------------------------------------------------
$TotalTopicsCount = $db->getInfo_countRows("forum_topics","type != 3");
$TotalPostsCount = $db->getInfo_countRows("forum_replies");
//-----------------------------------------------------------------
// Calculate the hit averages
//-----------------------------------------------------------------
$days_uptime = intval(abs((((($misc['site_opened'] - time())/60)/60)/24)));
$daily_average = @round(($misc['total_hits']/$days_uptime), 0);
$weekly_average = @round(($misc['total_hits']/($days_uptime/7)), 0);
$monthly_average = @round(($misc['total_hits']/($days_uptime/30)), 0);
//-----------------------------------------------------------------
// UNIX load
//-----------------------------------------------------------------
if (@file_exists('/proc/loadavg'))
{
$fh = @fopen('/proc/loadavg', 'r');
$load_averages = @fread($fh, 64);
@fclose($fh);
$load_averages = @explode(' ', $load_averages);
$server_load = $load_averages[0].' '.$load_averages[1].' '.$load_averages[2];
}
else
$server_load = $language['HQ server desc8'];
//-----------------------------------------------------------------
// PHP Accelerator
//-----------------------------------------------------------------
if (function_exists('mmcache')) $php_accelerator = 'Turck MMCache';
else if (isset($_PHPA)) $php_accelerator = 'ionCube PHP Accelerator';
else $php_accelerator = 'N/A';
//-----------------------------------------------------------------
// Database system version
//-----------------------------------------------------------------
$result = $db->query('SELECT version()');
$db_version = @mysql_result($result, 0);
//-----------------------------------------------------------------
// Collect some info about MySQL
//-----------------------------------------------------------------
$result = $db->query("SHOW TABLE STATUS FROM `$database_name`");
$num_tables = @mysql_num_rows($result);
$total_records = NULL;
$total_size = NULL;
while ($num_tables--)
{
$status = @mysql_fetch_row($result);
$total_records += $status[4];
$total_size += $status[6] + $status[8];
}
$total_size = $total_size / 1024;
if ($total_size > 1024) $total_size = round($total_size / 1024, 2).' MB';
else $total_size = round($total_size, 2).' KB';
//-----------------------------------------------------------------
// Check site for update
//-----------------------------------------------------------------
if(isset($is_webmaster)) // Slows site down, so it's avalable only for the webmaster
{
$update = @file_get_contents("http://www.jupiterportal.com/index.php?n=modules/update&a=1&d=$url");
//-----------------------------------------------------------------
// Variables for differit messages
//-----------------------------------------------------------------
if($update)
{
if (!ini_get('allow_url_fopen')) $status = ''.$language['HQ update desc6'].'';
elseif($update > $script_version) $status = ''.$language['HQ update desc3'].'';
elseif($script_version > $update) $status = ''.$language['HQ update desc4'].'';
elseif($script_version == $update) $status = ''.$language['HQ update desc5'].'';
}
else $status = ''.$language['HQ update desc7'].'';
}
//-----------------------------------------------------------------
// Count PM
//-----------------------------------------------------------------
$new_pm_count = $db->getInfo_countRows("pm","r_user_id = '{$_SESSION['id']}' AND r_user_user = '{$_SESSION['username']}' AND r_date = 'unread' AND r_delete = 1");
//-----------------------------------------------------------------
// Display information
//-----------------------------------------------------------------
?>
= $language['HQ user title'] ?> |
= "{$language['HQ user desc']} {$_SESSION['username']}" ?> |
= "{$language['HQ user desc2']} ".find_authorization($_SESSION['authorization'])."" ?> |
= "{$language['HQ user desc3']} $new_pm_count {$language['HQ user desc6']}" ?> |
= "{$language['HQ user desc4']} {$user_info['forumposts']}" ?> |
= "{$language['HQ user desc5']} "; if(!last_visit($user_info['lastvisit'])) echo "0 {$language['Time Definition Seconds']} {$language['HQ user desc7']}"; else echo last_visit($user_info['lastvisit']) ?> |
if(isset($is_moderator) || isset($is_administrator) || isset($is_webmaster)){ ?>
= $language['HQ site title'] ?> |
= "{$language['HQ site desc']} $TotalTopicsCount" ?> |
= "{$language['HQ site desc2']} $TotalPostsCount" ?> |
= "{$language['HQ site desc3']} $TotalBansCount" ?> |
= "{$language['HQ site desc4']} $TotalOnlineCount" ?> |
= "{$language['HQ site desc5']} {$misc['total_hits']}" ?> |
= "{$language['HQ site desc6']} {$misc['unique_hits']}" ?> |
= "{$language['HQ site desc7']} ".($daily_average ? $daily_average : $language['HQ site desc10']) ?> |
= "{$language['HQ site desc8']} ".($weekly_average ? $weekly_average : $language['HQ site desc10']) ?> |
= "{$language['HQ site desc9']} ".($monthly_average ? $monthly_average : $language['HQ site desc10']) ?> |
= "{$language['HQ site desc11']} {$misc['totalonline']}" ?> |
} if(isset($is_administrator) || isset($is_webmaster)) { ?>
= $language['HQ server title'] ?> |
= "{$language['HQ server desc']} $server_load ($TotalOnlineCount users online)" ?> |
= "{$language['HQ server desc2']} PHP_OS" ?> |
= "{$language['HQ server desc3']} ".phpversion() ?> |
= "{$language['HQ server desc4']} $php_accelerator" ?> |
= "{$language['HQ server desc5']} $db_version" ?> |
= "{$language['HQ server desc6']} $total_records" ?> |
= "{$language['HQ server desc7']} $total_size" ?> |
} if(isset($is_webmaster)) { ?>
= $language['HQ update title'] ?> |
= "{$language['HQ update desc']} $update / {$language['HQ update desc2']} $script_version" ?> |
= $status ?> |
} ?>