\n";
echo "\n";
global $directory,$dbsize;
function format_size($rawSize) {
global $db_prefix;
if ($rawSize / 1048576 > 1)
return round($rawSize/1048576, 1) . ' MB';
else if ($rawSize / 1024 > 1)
return round($rawSize/1024, 1) . ' KB';
else
return round($rawSize, 1) . ' bytes';
}
$phpv = phpversion();
$mysql_version = mysql_get_server_info();
function dirsize($directory) {
global $db_prefix;
if (!is_dir($directory)) return -1;
$size = 0;
if ($DIR = opendir($directory)) {
while (($dirfile = readdir($DIR)) !== false) {
if (is_link($directory . '/' . $dirfile) || $dirfile == '.' || $dirfile == '..')
continue;
if (is_file($directory . '/' . $dirfile))
$size += filesize($directory . '/' . $dirfile);
else if (is_dir($directory . '/' . $dirfile)) {
$dirSize = dirsize($directory . '/' . $dirfile);
if ($dirSize >= 0) $size += $dirSize;
else return -1;
}
}
closedir($DIR);
}
return $size;
}
$mysql_size = $dbsize;
$estore_size = dirsize('.');
$images_size = dirsize(INFUSIONS."hosted/users/");
$total_size = $estore_size + $mysql_size;
$estore_size = format_size($estore_size);
$images_size = format_size($images_size);
$total_size = format_size($total_size);
$rs = dbquery ("SHOW TABLE STATUS FROM $db_name");
$mysql_size = 0;
while ($r = dbarray($rs)) {
$mysql_size += $r['Data_length'] + $r['Index_length'] ;
}
$mysql_size = format_size($mysql_size);
// Check if locale file is available matching the current site locale setting.
if (file_exists(INFUSIONS."site_info_panel/locale/".$settings['locale'].".php")) {
// Load the locale file matching the current site locale setting.
include INFUSIONS."site_info_panel/locale/".$settings['locale'].".php";
} else {
// Load the infusion's default locale file.
include INFUSIONS."site_info_panel/locale/English.php";
}
openside($locale['sip_01']);
echo "".THEME_BULLET." \n";
echo $locale['sip_02']."\n";
echo "
\n";
//sitetop download
$result=dbquery("
SELECT *
FROM ".DB_PDP_DOWNLOADS."
ORDER BY dl_count DESC
LIMIT 0,10
");
if(dbrows($result)!=0){
echo "
\n";
} else {
echo "
".$locale['sip_nodata']."\n";
}
echo "
\n";
echo "\n";
//sitetop weblink
$result=dbquery("
SELECT * FROM ".DB_WEBLINKS."
ORDER BY weblink_count DESC
LIMIT 0,10
");
if(dbrows($result)!=0) {
echo "
\n";
} else {
echo "
".$locale['sip_nodata']."\n";
}
echo "
\n";
echo "\n";
//sitetop threads
$result = dbquery("
SELECT tf.forum_id, tt.thread_id, tt.thread_subject, COUNT(tp.post_id) as count_posts
FROM ".DB_FORUMS." tf
INNER JOIN ".DB_THREADS." tt USING(forum_id)
INNER JOIN ".DB_POSTS." tp USING(thread_id)
WHERE forum_access<='".iUSER."'
GROUP BY thread_id
ORDER BY count_posts DESC, thread_lastpost DESC
LIMIT 10
");
if (dbrows($result) != 0) {
echo "
\n";
while($data = dbarray($result)) {
$itemsubject = trimlink($data['thread_subject'], 17);
echo " ".THEME_BULLET." \n";
echo "$itemsubject | \n";
echo "[".($data['count_posts']-1)."] | \n
\n";
}
echo "
\n";
} else {
echo "
".$locale['sip_nodata']."\n";
}
echo "
\n";
echo "\n";
//sitetop user
$result=dbquery("
SELECT user_name, user_location, user_id, count(user_id) AS post_count
FROM ".DB_POSTS."
INNER JOIN ".DB_USERS." ON post_author=user_id
GROUP BY user_name
ORDER BY post_count DESC
LIMIT 0,10
");
if(dbrows($result)!=0){
echo "
\n";
} else {
echo "
".$locale['sip_nodata']."\n";
}
echo "
";
echo "\n";
//sitetop news
$result=dbquery("
SELECT * FROM ".DB_NEWS."
ORDER BY news_reads DESC
LIMIT 0,10
");
if(dbrows($result)!=0){
echo "
\n";
} else {
echo "
".$locale['sip_nodata']."\n";
}
echo "
\n";
echo "\n";
//sitetoparticles
$result=dbquery("
SELECT * FROM ".DB_ARTICLES."
ORDER BY article_reads DESC
LIMIT 0,10
");
if(dbrows($result)!=0){
echo "
\n";
} else {
echo "
".$locale['sip_nodata']."\n";
}
echo "
\n";
closeside();
?>