Mam pytanko. Przerobiłem trochę panel dodając obsługę Professional Download System 1.8.5. Jest ok w momencie wyświetlania na podstronie "/infusions/pro_download_panel/" wyświetla prawidłowo "Top 10 pobrań:"
na pozostałych stronach podaje że nie ma dostępu do bazy.
Mój side info panel
<?php
/*-------------------------------------------------------+
| PHP-Fusion Content Management System
| Copyright © 2002 - 2008 Nick Jones
| http://www.php-fusion.co.uk/
+--------------------------------------------------------+
| Site Info Panel
| Copyright © 2006 - 2008 Ausimods & Claus Pedersen (flyingduck) & Stephan Hansson (StarglowOne)
| http://www.ausimods.net / http://www.flyingduck.dk / http://www.starglowone.com
+--------------------------------------------------------+
| Filename: site_info_panel.php
| Author: Ausimods & Claus Pedersen (flyingduck) & Stephan Hansson (StarglowOne)
+--------------------------------------------------------+
| This program is released as free software under the
| Affero GPL license. You can redistribute it and/or
| modify it under the terms of this license which you
| can read by viewing the included agpl.txt or online
| at http://www.gnu.org/licenses/agpl.html. Removal of this
| copyright header is strictly prohibited without
| written permission from the original author(s).
+--------------------------------------------------------*/
if (!defined("IN_FUSION")) { die("Access Denied"); }
//echo "<script src='".INFUSIONS."site_info_panel/js/gpe.js' language='javascript' type='text/javascript'></script>\n";
echo "<script src='".INFUSIONS."site_info_panel/js/site.js' language='javascript' type='text/javascript'></script>\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 "<span>".THEME_BULLET." <a onclick=\"expandcontent('sitetop1')\" style='cursor: pointer;'>\n";
echo $locale['sip_02']."</a></span>\n";
echo "<div id='sitetop1' class='switchcontent'>\n";
echo "<table width='100%' cellpadding='0' cellspacing='0'>\n<tr class='small'>\n";
echo "<td> ".THEME_BULLET." ".$locale['sip_03']."</td>\n";
echo "<td>[$mysql_size]</td>\n";
echo "</tr>\n<tr class='small'>\n";
echo "<td> ".THEME_BULLET." ".$locale['sip_04']."</td>\n";
echo "<td>[$total_size]</td>\n";
echo "</tr>\n</table>\n</div>\n";
echo "<br /><span>".THEME_BULLET." <a onclick=\"expandcontent('sitetop2')\" style='cursor: pointer;'>\n";
echo $locale['sip_05']."</a></span>\n";
echo "<div id='sitetop2' class='switchcontent'>\n";
echo "<table width='100%' cellpadding='0' cellspacing='0'>\n<tr class='small'>\n";
echo "<td> ".THEME_BULLET." ".$locale['sip_06']." </td>\n";
echo "<td>[".dbcount("(inf_id)", DB_INFUSIONS)."]</td>\n";
echo "</tr>\n<tr class='small'>\n";
echo "<td> ".THEME_BULLET." ".$locale['sip_07']." </td>\n";
echo "<td>[".dbcount("(user_id)", DB_USERS, "user_status<='1'")."]</td>\n";
echo "</tr>\n<tr class='small'>\n";
echo "<td> ".THEME_BULLET." ".$locale['sip_08']." </td>\n";
echo "<td>[".dbcount("(post_id)", DB_POSTS)."]</td>\n";
echo "</tr>\n<tr class='small'>\n";
echo "<td> ".THEME_BULLET." ".$locale['sip_09']." </td>\n";
echo "<td>[".dbcount("(download_id)", DB_PDP_DOWNLOADS)."]</td>\n";
echo "</tr>\n</table>\n</div>\n";
echo "<br /><span>".THEME_BULLET." <a onclick=\"expandcontent('sitetop3')\" style='cursor: pointer;'>\n";
echo $locale['sip_10']."</a></span>\n";
echo "<div id='sitetop3' class='switchcontent'>\n";
//sitetop download
$result=dbquery("
SELECT *
FROM ".DB_PDP_DOWNLOADS."
ORDER BY dl_count DESC
LIMIT 0,10
");
if(dbrows($result)!=0){
echo "<table width='100%' cellpadding='0' cellspacing='0'>\n";
while($data=dbarray($result)){
echo "<tr><td class='small' align='left'> ".THEME_BULLET." \n";
echo "<a href='".BASEDIR."infusions/pro_download_panel/download.php?did=".$data['download_id']."' class='slink'>\n";
echo trimlink($data['dl_name'], 17)."</a></td>\n<td class='small' align='right'>\n";
echo "[".$data['download_id']."]\n</td>\n</tr>\n";
}
echo "</table>\n";
} else {
echo "<center>".$locale['sip_nodata']."</center>\n";
}
echo "</div>\n";
echo "<br /><span>".THEME_BULLET." <a onclick=\"expandcontent('sitetop4')\" style='cursor: pointer;'>\n";
echo $locale['sip_11']."</a></span>\n";
echo "<div id='sitetop4' class='switchcontent'>\n";
//sitetop weblink
$result=dbquery("
SELECT * FROM ".DB_WEBLINKS."
ORDER BY weblink_count DESC
LIMIT 0,10
");
if(dbrows($result)!=0) {
echo "<table width='100%' cellpadding='0' cellspacing='0'>\n";
while($data=dbarray($result)){
echo "<tr><td class='small' align='left'> ".THEME_BULLET." \n";
echo "<a href='".BASEDIR."weblinks.php?weblink_id=".$data['weblink_id']."' target='_blank'>\n";
echo trimlink($data['weblink_name'], 17)."</a></td>\n<td class='small' align='right'>\n";
echo "[".$data['weblink_count']."]</td>\n</tr>\n";
}
echo "</table>\n";
} else {
echo "<center>".$locale['sip_nodata']."</center>\n";
}
echo "</div>\n";
echo "<br /><span>".THEME_BULLET." <a onclick=\"expandcontent('sitetop5')\" style='cursor: pointer;'>\n";
echo $locale['sip_12']."</a></span>\n";
echo "<div id='sitetop5' class='switchcontent'>\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 "<table width='100%' cellpadding='0' cellspacing='0'>\n";
while($data = dbarray($result)) {
$itemsubject = trimlink($data['thread_subject'], 17);
echo "<tr><td class='small' align='left'> ".THEME_BULLET." \n";
echo "<a href='".FORUM."viewthread.php?forum_id=".$data['forum_id']."&thread_id=".$data['thread_id']."' class='side'>$itemsubject</a></td>\n";
echo "<td align='right' class='side-small'>[".($data['count_posts']-1)."]</td>\n</tr>\n";
}
echo "</table>\n";
} else {
echo "<center>".$locale['sip_nodata']."</center>\n";
}
echo "</div>\n";
echo "<br /><span>".THEME_BULLET." <a onclick=\"expandcontent('sitetop6')\" style='cursor: pointer;'>\n";
echo $locale['sip_13']."</a></span>\n";
echo "<div id='sitetop6' class='switchcontent'>\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 "<table width='100%' cellpadding='0' cellspacing='0'>\n";
while($data=dbarray($result)){
echo "<tr><td class='small' align='left'> ".THEME_BULLET." \n";
echo "<a href='".BASEDIR."profile.php?lookup=".$data['user_id']."'>\n";
echo $data['user_name']."</a></td><td class='small2' align='right'>[".$data['post_count']."]</td></tr>\n";
}
echo "</table>\n";
} else {
echo "<center>".$locale['sip_nodata']."</center>\n";
}
echo "</div>";
echo "<br /><span>".THEME_BULLET." <a onclick=\"expandcontent('sitetop7')\" style='cursor: pointer;'>\n";
echo $locale['sip_14']."</a></span>\n";
echo "<div id='sitetop7' class='switchcontent'>\n";
//sitetop news
$result=dbquery("
SELECT * FROM ".DB_NEWS."
ORDER BY news_reads DESC
LIMIT 0,10
");
if(dbrows($result)!=0){
echo "<table width='100%' cellpadding='0' cellspacing='0'>\n";
while($data=dbarray($result)){
echo "<tr><td class='small' align='left'> ".THEME_BULLET." <a href='".BASEDIR."news.php?readmore=".$data['news_id']."'>\n";
echo trimlink($data['news_subject'], 17)."</a></td>\n";
echo "<td class='small' align='right'>[".$data['news_reads']."]</td>\n</tr>\n";
}
echo "</table>\n";
} else {
echo "<center>".$locale['sip_nodata']."</center>\n";
}
echo "</div>\n";
echo "<br /><span>".THEME_BULLET." <a onclick=\"expandcontent('sitetop8')\" style='cursor: pointer;'>\n";
echo $locale['sip_15']."</a></span>\n";
echo "<div id='sitetop8' class='switchcontent'>\n";
//sitetoparticles
$result=dbquery("
SELECT * FROM ".DB_ARTICLES."
ORDER BY article_reads DESC
LIMIT 0,10
");
if(dbrows($result)!=0){
echo "<table width='100%' cellpadding='0' cellspacing='0'>\n";
while($data=dbarray($result)){
echo "<tr><td class='small' align='left'> ".THEME_BULLET." <a href='".BASEDIR."articles.php?article_id=".$data['article_id']."'>\n";
echo trimlink($data['article_subject'], 17)."</a></td>\n";
echo "<td class='small' align='right'>[".$data['article_reads']."]</td>\n</tr>\n";
}
echo "</table>\n";
} else {
echo "<center>".$locale['sip_nodata']."</center>\n";
}
echo "</div>\n";
closeside();
?>
Co może być przyczyną?
|