AL8 Forum
   登錄註冊幫助


標題: [D5.0 & D5.5] 統計圖表程序與詳細教學 (適合 Discuz! 3.0F β1或以上)
  本主題被作者加入到個人文集中  
 8783
 0047230
Rank: 6Rank: 6Rank: 6Rank: 6Rank: 6Rank: 6

頭銜: Forum Legend

帖子: 1693

精華: 0

積分: 18888 點

現金: 1013 元

存款: 0 元

閱讀權限: 70

註冊: 2006-6-27

狀態: 離線
 
發表於 2008-6-25 17:31  資料  個人空間  短消息  加為好友  添加 8783 為MSN好友 通過MSN和 8783 交談
http://8783main.hkhostcity.com/statspng.php

點解會死圖= =


<?php

/*
        [DISCUZ!] statspng.php - board images statistics
        This is NOT a freeware, use is subject to license terms

        Version: 3.0.0
        Author: Loveyuki (webmaster@loveyuki.com)
        Discuz 3.0F Modified by: alan888 (http://www.alan888.com/Discuz/index.php)
        Copyright: Soar Computer Studio (www.loveyuki.com)
        Last Modified: 2005/10/8 17:00
*/

define('IN_DISCUZ', TRUE);
define('DISCUZ_ROOT', '');
Header("Content-type: image/PNG");

require 'config.inc.php';
require 'include/db_'.$database.'.class.php';
$tables = array('members', 'posts', 'sessions', 'stats');
foreach($tables as $tablename) {
        ${'table_'.$tablename} = $tablepre.$tablename;
}
unset($tablename);

$db = new dbstuff;
$db->connect($dbhost, $dbuser, $dbpw, $dbname, $pconnect);
$db->select_db($dbname);
unset($dbhost, $dbuser, $dbpw, $dbname, $pconnect);

$query = $db->query("SELECT count,type,variable FROM $table_stats WHERE type='total' and variable='hits'");
$stats = $db->fetch_array($query);
$stats = $stats['count'];
$query = $db->query("SELECT count(*) FROM $table_members");
$members = $db->result($query,0);
$query = $db->query("SELECT count(*) FROM $table_posts");
$posts = $db->result($query,0);
$query = $db->query("SELECT count(*) FROM $table_sessions");
$online = $db->result($query,0);

if(getenv('HTTP_CLIENT_IP')) {
        $onlineip = getenv('HTTP_CLIENT_IP');
} elseif(getenv('HTTP_X_FORWARDED_FOR')) {
        $onlineip = getenv('HTTP_X_FORWARDED_FOR');
} elseif(getenv('REMOTE_ADDR')) {
        $onlineip = getenv('REMOTE_ADDR');
} else {
        $onlineip = $HTTP_SERVER_VARS['REMOTE_ADDR'];
}

$currenttime = date("Y-m-d A");

$im = @imagecreatefromgif("images/statspng.gif");
$white = ImageColorAllocate($im, 255,255,255);
$black = ImageColorAllocate($im, 0,0,0);
$black = ImageColorAllocate($im, 0,0,0);
$blue = ImageColorAllocate($im, 0,0,255);
$green = ImageColorAllocate($im, 0,255,0);
$red = ImageColorAllocate($im, 255,0,0);

$bbname1 = ''; //論壇英文名稱(不需要填寫[FORUM];
$bbname2 = 'FORUM';
$link = ''; //論壇連結

imagestring($im, 7, 33, 16, $bbname1, $black);
imagestring($im, 7, 32, 15, $bbname1, $white);

imagestring($im, 7, 26, 37, $bbname2, $black);
imagestring($im, 7, 25, 36, $bbname2, $white);

imagestring($im, 3, 160, 2, $stats, $black);
imagestring($im, 3, 159, 1, $stats, $white);

imagestring($im, 3, 160, 17, $posts, $black);
imagestring($im, 3, 159, 16, $posts, $white);

imagestring($im, 3, 160, 32, $members, $black);
imagestring($im, 3, 159, 31, $members, $white);

imagestring($im, 3, 287, 2, $onlineip, $black);
imagestring($im, 3, 286, 1, $onlineip, $white);

imagestring($im, 3, 287, 17, $online, $black);
imagestring($im, 3, 286, 16, $online, $white);

imagestring($im, 3, 287, 32, $currenttime, $black);
imagestring($im, 3, 286, 31, $currenttime, $white);

imagestring($im, 3, 143, 49, $link, $black);
imagestring($im, 3, 142, 48, $link, $white);

ImagePNG($im);
ImageDestroy($im);
?>




 AL8 Forum © All rights reserved.
頂部
 kingjames
 0097617
Rank: 4Rank: 4Rank: 4Rank: 4
點擊查看 kingjames 的詳細資料

頭銜: Lord

帖子: 488

精華: 0

積分: 2920 點

現金: 95 元

存款: 0 元

閱讀權限: 25

註冊: 2008-3-8

來自: 美國的無限

狀態: 離線
 
發表於 2008-7-19 06:53  資料  個人空間  主頁 短消息  加為好友  添加 kingjames 為MSN好友 通過MSN和 kingjames 交談 QQ
thank you so much




 AL8 Forum © All rights reserved.
頂部
 po1234
 0104173
Rank: 3Rank: 3Rank: 3

頭銜: Conqueror

帖子: 109

精華: 0

積分: 1221 點

現金: 100 元

存款: 0 元

閱讀權限: 20

註冊: 2008-6-30

狀態: 離線
 
發表於 2008-9-11 14:57  資料  個人空間  短消息  加為好友 
我簽名個到出唔到?
得個網




 AL8 Forum © All rights reserved.
頂部
聯繫我們 - AL8 Forum - 網頁空間由 I-SERVICES 提供 - Archiver - WAP
清除 Cookies, 當前時區 GMT+8, 現在時間是 2008-11-23 18:58
Processed in 0.023744 second(s), 7 queries , Gzip enabled
Powered by Discuz! 5.5.0  © 2001-2007 Comsenz Inc.