AL8 Forum
   登錄註冊幫助


標題: [D4.1] cache.func.php 問題 找大大幫幫
 samspson
 0043778
Rank: 4Rank: 4Rank: 4Rank: 4
點擊查看 samspson 的詳細資料

頭銜: Lord

帖子: 391

精華: 0

積分: 3750 點

現金: 49 元

存款: 0 元

閱讀權限: 25

註冊: 2006-4-20

狀態: 離線
 
發表於 2006-4-28 23:33  資料  個人空間  短消息  加為好友 
cache.func.php 問題 找大大幫幫

Fatal error: Cannot redeclare arrayeval() (previously declared in /home/hzone28/domains/zone-28.com/public_html/bbs/include/cache.func.php:21) in /home/hzone28/domains/zone-28.com/public_html/bbs/include/cache.func.php on line 21
大大教教我如何修改這問題..

<?php

/*
        [Discuz!] (C)2001-2006 Comsenz Inc.
        This is NOT a freeware, use is subject to license terms

        $RCSfile: cache.func.php,v $
        $Revision: 1.22.2.3 $
        $Date: 2006/03/07 06:44:55 $
*/

define('DISCUZ_KERNEL_VERSION', '4.1.0');
define('DISCUZ_KERNEL_RELEASE', '20060303');

if(isset($_GET['kernel_version'])) {
        exit('Crossday Discuz! Board<br>Developed by Comsenz Inc.<br><br>Version: '.DISCUZ_KERNEL_VERSION.'<br>Release: '.DISCUZ_KERNEL_RELEASE);
} elseif(!defined('IN_DISCUZ')) {
        exit('Access Denied');
}

function arrayeval($array, $level = 0) {
        $space = '';
        for($i = 0; $i <= $level; $i++) {
                $space .= "\t";
        }
        $evaluate = "Array\n$space(\n";
        $comma = $space;
        foreach($array as $key => $val) {
                $key = is_string($key) ? '\''.addcslashes($key, '\'\\').'\'' : $key;
                $val = !is_array($val) && (!preg_match("/^\-?[1-9]\d*$/", $val) || strlen($val) > 12) ? '\''.addcslashes($val, '\'\\').'\'' : $val;
                if(is_array($val)) {
                        $evaluate .= "$comma$key => ".arrayeval($val, $level + 1);
                } else {
                        $evaluate .= "$comma$key => $val";
                }
                $comma = ",\n$space";
        }
        $evaluate .= "\n$space)";
        return $evaluate;
}

function updatecache($cachename = '') {
        global $db, $bbname, $tablepre;

        $cachescript = array
                (
                'settings'        => array('settings'),
                'index'                => array('announcements', 'onlinelist', 'forumlinks'),
                'forumdisplay'        => array('announcements_forum', 'globalstick', 'forums', 'icons', 'onlinelist'),
                'viewthread'        => array('forums', 'usergroups', 'ranks', 'bbcodes', 'smilies', 'fields_thread'),
                'post'                => array('bbcodes', 'smilies_display', 'smilies', 'icons'),
                'blog'                => array('usergroups', 'ranks', 'bbcodes', 'smilies'),
                'forums'        => array('forums'),
                'profilefields'        => array('fields_required', 'fields_optional'),
                'censor'        => array('censor'),
                'ipbanned'        => array('ipbanned'),
                'bbcodes'        => array('bbcodes', 'smilies'),
                'poststar'      => array('daystar', 'weekstar', 'monthstar', 'yearstar'),
                'medals'        => array('medals'),
                'newtopic'      => array('newtopic'),
                'newreply'      => array('newreply'),
                'todayvisit'    => array('todayvisit')
                );

        foreach($cachescript as $script => $cachenames) {
                if(!$cachename || ($cachename && in_array($cachename, $cachenames))) {
                        writetocache($script, $cachenames);
                }
        }

        if(!$cachename || $cachename == 'styles') {
                $stylevars = array();
                $query = $db->query("SELECT * FROM {$tablepre}stylevars");
                while($var = $db->fetch_array($query)) {
                        $stylevars[$var['styleid']][$var['variable']] = $var['substitute'];
                }
                $query = $db->query("SELECT s.*, t.directory AS tpldir FROM {$tablepre}styles s LEFT JOIN {$tablepre}templates t ON s.templateid=t.templateid");
                while($data = $db->fetch_array($query)) {
                        $data = array_merge($data, $stylevars[$data['styleid']]);

                        $data['bgcode'] = strpos($data['bgcolor'], '.') ? "background-image: url(\"$data[imgdir]/$data[bgcolor]\")" : "background-color: $data[bgcolor]";
                        $data['maintablebgcode'] = strpos($data['maintablecolor'], '.') ? "background=\"$data[maintablecolor]\"" : "bgcolor=\"$data[maintablecolor]\"";
                        $data['catbgcode'] = strpos($data['catcolor'], '.') ? "background-image: url(\"$data[imgdir]/$data[catcolor]\")" : "background-color: $data[catcolor]";
                        $data['headerbgcode'] = strpos($data['headercolor'], '.') ? "background-image: url(\"$data[imgdir]/$data[headercolor]\")" : "background-color: $data[headercolor]";
                        $data['boardlogo'] = image($data['boardimg'], $data['imgdir'], "alt=\"$bbname\"");
                        $data['bold'] = $data['nobold'] ? 'normal' : 'bold';

                        writetocache($data['styleid'], '', getcachevars($data, 'CONST'), 'style_');
                }
        }

        if(!$cachename || $cachename == 'usergroups') {
                $query = $db->query("SELECT * FROM {$tablepre}usergroups u
                                        LEFT JOIN {$tablepre}admingroups a ON u.groupid=a.admingid");
                while($data = $db->fetch_array($query)) {
                        $ratearray = array();
                        if($data['raterange']) {
                                foreach(explode("\n", $data['raterange']) as $rating) {
                                        $rating = explode("\t", $rating);
                                        $ratearray[$rating[0]] = array('min' => $rating[1], 'max' => $rating[2], 'mrpd' => $rating[3]);
                                }
                        }
                        $data['raterange'] = $ratearray;
                        $data['grouptitle'] = $data['color'] ? '<font color="'.$data['color'].'">'.$data['grouptitle'].'</font>' : $data['grouptitle'];
                        $data['grouptype'] = $data['type'];
                        $data['grouppublic'] = $data['system'] != 'private';
                        $data['groupcreditshigher'] = $data['creditshigher'];
                        $data['groupcreditslower'] = $data['creditslower'];
                        unset($data['type'], $data['system'], $data['creditshigher'], $data['creditslower'], $data['color'], $data['groupavatar'], $data['admingid']);
                        foreach($data as $key => $val) {
                                if(!isset($data[$key])) {
                                        unset($data[$key]);
                                }
                        }
                        writetocache($data['groupid'], '', getcachevars($data), 'usergroup_');
                }
        }

        if(!$cachename || $cachename == 'admingroups') {
                $query = $db->query("SELECT * FROM {$tablepre}admingroups");
                while($data = $db->fetch_array($query)) {
                        writetocache($data['admingid'], '', getcachevars($data), 'admingroup_');
                }
        }

        if(!$cachename || $cachename == 'plugins') {
                $query = $db->query("SELECT pluginid, available, adminid, name, identifier, datatables, directory, copyright, modules FROM {$tablepre}plugins");
                while($plugin = $db->fetch_array($query)) {
                        $data = array_merge($plugin, array('modules' => array()), array('vars' => array()));
                        $plugin['modules'] = unserialize($plugin['modules']);
                        if(is_array($plugin['modules'])) {
                                foreach($plugin['modules'] as $module) {
                                        $data['modules'][$module['name']] = $module;
                                }
                        }
                        $queryvars = $db->query("SELECT variable, value FROM {$tablepre}pluginvars WHERE pluginid='$plugin[pluginid]'");
                        while($var = $db->fetch_array($queryvars)) {
                                $data['vars'][$var['variable']] = $var['value'];
                        }
                        writetocache($plugin['identifier'], '', "\$_DPLUGIN['$plugin[identifier]'] = ".arrayeval($data), 'plugin_');
                }
        }
}

function updatesettings() {
        global $_DCACHE;
        if(isset($_DCACHE['settings']) && is_array($_DCACHE['settings'])) {
                writetocache('settings', '', '$_DCACHE[\'settings\'] = '.arrayeval($_DCACHE['settings']));
        }
}

function writetocache($script, $cachenames, $cachedata = '', $prefix = 'cache_') {
        if(is_array($cachenames) && !$cachedata) {
                foreach($cachenames as $name) {
                        $cachedata .= getcachearray($name);
                }
        }

        $dir = DISCUZ_ROOT.'./forumdata/cache/';
        if(!is_dir($dir)) {
                @mkdir($dir, 0777);
        }
        if(@$fp = fopen("$dir$prefix$script.php", 'w')) {
                fwrite($fp, "<?php\n//Discuz! cache file, DO NOT modify me!\n".
                        "//Created on ".date("M j, Y, G:i")."\n\n$cachedata?>");
                fclose($fp);
        } else {
                dexit('Can not write to cache files, please check directory ./forumdata/ and ./forumdata/cache/ .');
        }
}

function getcachearray($cachename) {
        global $db, $timestamp, $tablepre;

        $cols = '*';
        $conditions = '';
        switch($cachename) {
                case 'settings':
                        $table = 'settings';
                        $conditions = "WHERE variable NOT IN ('bbrules', 'bbrulestxt', 'maxonlines', 'welcomemsg', 'welcomemsgtxt', 'newsletter', 'creditsnotify', 'custombackup')";
                        break;
                case 'crons':
                        $table = 'crons';
                        $cols = 'cronid, name, filename, nextrun, weekday, day, hour, minute';
                        $conditions = "WHERE available>'0'";
                        break;
                case 'usergroups':
                        $table = 'usergroups';
                        $cols = 'groupid, type, grouptitle, creditshigher, creditslower, stars, color, groupavatar, readaccess, allowavatar, allowcusbbcode, allowuseblog';
                        $conditions = "ORDER BY creditslower";
                        break;
                case 'ranks':
                        $table = 'ranks';
                        $cols = 'ranktitle, postshigher, stars, color';
                        $conditions = "ORDER BY postshigher DESC";
                        break;
                case 'announcements':
                        $table = 'announcements';
                        $cols = 'id, subject, starttime, endtime';
                        $conditions = "WHERE starttime<='$timestamp' ORDER BY displayorder, starttime DESC, id DESC";
                        break;
                case 'announcements_forum':
                        $table = 'announcements a';
                        $cols = 'a.id, a.author, a.message, m.uid AS authorid, a.subject, a.starttime';
                        $conditions = "LEFT JOIN {$tablepre}members m ON m.username=a.author WHERE a.starttime<='$timestamp' ORDER BY a.displayorder, a.starttime DESC, a.id DESC LIMIT 1";
                        break;
                case 'globalstick':
                        $table = 'forums';
                        $cols = 'fid, type, fup';
                        $conditions = "WHERE status='1' AND type IN ('forum', 'sub') ORDER BY type";
                        break;
                case 'forums':
                        $table = 'forums f';
                        $cols = 'f.fid, f.type, f.name, f.fup, ff.viewperm, a.uid';
                        $conditions = "LEFT JOIN {$tablepre}forumfields ff ON ff.fid=f.fid LEFT JOIN {$tablepre}access a ON a.fid=f.fid AND a.allowview='1' WHERE f.status='1' ORDER BY displayorder";
                        break;
                case 'onlinelist':
                        $table = 'onlinelist';
                        $conditions = "ORDER BY displayorder";
                        break;
                case 'forumlinks':
                        $table = 'forumlinks';
                        $conditions = "ORDER BY displayorder";
                        break;
                case 'bbcodes':
                        $table = 'bbcodes';
                        $conditions = "WHERE available='1'";
                        break;
                case 'smilies':
                        $table = 'smilies';
                        $cols = 'code, url';
                        $conditions = "WHERE type='smiley' ORDER BY LENGTH(code) DESC";
                        break;
                case 'smilies_display':
                        $table = 'smilies';
                        $cols = 'code, url';
                        $conditions = "WHERE type='smiley' ORDER BY displayorder";
                        break;
                case 'icons':
                        $table = 'smilies';
                        $cols = 'id, url';
                        $conditions = "WHERE type='icon' ORDER BY displayorder";
                        break;
                case 'fields_required':
                        $table = 'profilefields';
                        $cols = 'fieldid, invisible, title, description, required, unchangeable, selective, choices';
                        $conditions = "WHERE available='1' AND required='1' ORDER BY displayorder";
                        break;
                case 'fields_optional':
                        $table = 'profilefields';
                        $cols = 'fieldid, invisible, title, description, required, unchangeable, selective, choices';
                        $conditions = "WHERE available='1' AND required='0' ORDER BY displayorder";
                        break;
                case 'fields_thread':
                        $table = 'profilefields';
                        $cols = 'fieldid, title, selective, choices';
                        $conditions = "WHERE available='1' AND invisible='0' AND showinthread='1' ORDER BY displayorder";
                        break;
                case 'ipbanned':
                        $db->query("DELETE FROM {$tablepre}banned WHERE expiration<'$timestamp'");
                        $table = 'banned';
                        $cols = 'ip1, ip2, ip3, ip4, expiration';
                        break;
                case 'censor':
                        $table = 'words';
                        $cols = 'find, replacement';
                        break;
                //===============社區明星BY 33201 開始
                case 'daystar':
                        $month=date(n);
                        $date=date(j);
                        $year=date(Y);
                        $time=mktime(0,0,0,$month,$date,$year);
                        $table = 'posts p';
                        $cols = 'count(p.pid) as num,p.author,p.authorid,m.uid,m.credits,m.posts,m.digestposts ,me.avatar,m.oltime,me.avatarwidth,me.avatarheight';
                        $conditions = "left join {$tablepre}members m on p.authorid=m.uid  left join cdb_memberfields me on p.authorid=me.uid where p.dateline>$time  group by p.authorid order by num desc limit 0,10";
                        break;

                case 'weekstar':
                        $month=date(n);
                        $date=date(j);
                        $year=date(Y);
                        $week=date(w);
                        $time=mktime(0,0,0,$month,$date,$year);
                        $weektime=mktime(0,0,0,$month,$date+1-$week,$year);
                        $table = 'posts p';
                        $cols = 'count(p.pid) as num,p.author,p.authorid,m.uid,m.credits,m.posts,m.digestposts ,me.avatar,m.oltime,me.avatarwidth,me.avatarheight';
                        $conditions = "left join {$tablepre}members m on p.authorid=m.uid  left join cdb_memberfields me on p.authorid=me.uid where p.dateline>=$weektime  group by p.authorid order by num desc limit 0,10";
                        break;
                case 'monthstar':
                        $month=date(n);
                        $year=date(Y);
                        $monthtime=mktime(0,0,0,$month,1,$year);
                        $table = 'posts p';
                        $cols = 'count(p.pid) as num,p.author,p.authorid,m.uid,m.credits,m.posts,m.digestposts ,me.avatar,m.oltime,me.avatarwidth,me.avatarheight';
                        $conditions = "left join {$tablepre}members m on p.authorid=m.uid  left join cdb_memberfields me on p.authorid=me.uid where p.dateline>=$monthtime  group by p.authorid order by num desc limit 0,10";
                        break;
               
                case 'yearstar':
                        $year=date(Y);
                        $yeartime=mktime(0,0,0,1,1,$year);
                        $table = 'posts p';
                        $cols = 'count(p.pid) as num,p.author,p.authorid,m.uid,m.credits,m.posts,m.digestposts ,me.avatar,m.oltime,me.avatarwidth,me.avatarheight';
                        $conditions = "left join {$tablepre}members m on p.authorid=m.uid  left join cdb_memberfields me on p.authorid=me.uid where p.dateline>=$yeartime  group by p.authorid order by num desc limit 0,10";
                        break;

//===================社區明星BY 33201 結束

        case 'medals':
                        $table = 'medals';
                        $cols = 'medalid, name, image';
                        $conditions = "WHERE available='1'";
                        break;

               case 'newtopic':
                        $table = 'threads t, cdb_forums f';
                        $cols = "t.tid, t.subject, t.author, t.dateline, t.views, t.replies, t.lastpost, t.lastposter, t.highlight, f.name";
                        $fids="40,41,42,43,44,53,54,78,61,62,60,77,47,50,51,49,48,46,32,64,65,38,58,57,56,70,68,67,69,72,73,14,16,5,6,7,12,13,8,11,9,10,19,34";
                        $conditions = "WHERE t.fid<>'$fid' AND f.fid=t.fid AND f.fid IN ($fids) ORDER BY t.dateline DESC LIMIT 0, 11";
                        break;
                case 'newreply':
                        $table = 'threads t, cdb_forums f';
                        $cols = "t.tid, t.subject, t.author, t.dateline, t.views, t.replies, t.lastpost, t.lastposter, t.highlight, f.name";
                        $fids="40,41,42,43,44,53,54,78,61,62,60,77,47,50,51,49,48,46,32,64,65,38,58,57,56,70,68,67,69,72,73,14,16,5,6,7,12,13,8,11,9,10,19,34";
                        $conditions = "WHERE t.fid<>'$fid' AND f.fid=t.fid AND f.fid IN ($fids) AND  t.replies !=0 ORDER BY t.lastpost DESC LIMIT 0, 11";
                        break;
                case 'todayvisit':
                        $table = 'members';
                        $cols = "COUNT(*)";
                        $datecut = time() - (3600 * 24);
                        $conditions = "WHERE lastactivity>='$datecut' ORDER BY lastvisit DESC";
                        break;

        }

        $data = array();

        $query = $db->query("SELECT $cols FROM {$tablepre}$table $conditions");
        switch($cachename) {
               
//===================社區明星BY 33201 開始
                case 'daystar':
                        while($toppost = $db->fetch_array($query)) {
                                $toppost['author'] = $toppost['author'] ? $toppost['author'] : '遊客';
                                $toppost['authorid'] = $toppost['authorid'] ? $toppost['authorid'] : '遊客';
                                $toppost['avatar'] = $toppost['avatar'] ? $toppost['avatar'] : 'images/nopic.gif';
                                $toppost['avatarwidth'] = $toppost['avatarwidth'] ? $toppost['avatarwidth'] : '80';
                                $toppost['avatarheight'] = $toppost['avatarheight'] ? $toppost['avatarheight'] : '80';
                                $data[] = $toppost;
                        }
                        break;
                case 'weekstar':
                        while($toppost = $db->fetch_array($query)) {
                                $toppost['author'] = $toppost['author'] ? $toppost['author'] : '遊客';
                                $toppost['authorid'] = $toppost['authorid'] ? $toppost['authorid'] : '遊客';
                                $toppost['avatar'] = $toppost['avatar'] ? $toppost['avatar'] : 'images/nopic.gif';
                                $toppost['avatarwidth'] = $toppost['avatarwidth'] ? $toppost['avatarwidth'] : '80';
                                $toppost['avatarheight'] = $toppost['avatarheight'] ? $toppost['avatarheight'] : '80';
                                $data[] = $toppost;
                        }
                        break;
                case 'monthstar':
                        while($toppost = $db->fetch_array($query)) {
                                $toppost['author'] = $toppost['author'] ? $toppost['author'] : '遊客';
                                $toppost['authorid'] = $toppost['authorid'] ? $toppost['authorid'] : '遊客';
                                $toppost['avatar'] = $toppost['avatar'] ? $toppost['avatar'] : 'images/nopic.gif';
                                $toppost['avatarwidth'] = $toppost['avatarwidth'] ? $toppost['avatarwidth'] : '80';
                                $toppost['avatarheight'] = $toppost['avatarheight'] ? $toppost['avatarheight'] : '80';
                                $data[] = $toppost;
                        }
                        break;
                case 'yearstar':
                        while($toppost = $db->fetch_array($query)) {
                                $toppost['author'] = $toppost['author'] ? $toppost['author'] : '遊客';
                                $toppost['authorid'] = $toppost['authorid'] ? $toppost['authorid'] : '遊客';
                                $toppost['avatar'] = $toppost['avatar'] ? $toppost['avatar'] : 'images/nopic.gif';
                                $toppost['avatarwidth'] = $toppost['avatarwidth'] ? $toppost['avatarwidth'] : '80';
                                $toppost['avatarheight'] = $toppost['avatarheight'] ? $toppost['avatarheight'] : '80';
                                $data[] = $toppost;
                        }
                        break;

//=====================社區明星BY 33201 結束


case 'settings':
                        $data['qihoo_links'] = array();
                        while($setting = $db->fetch_array($query)) {
                                if($setting['variable'] == 'extcredits') {
                                        if(is_array($setting['value'] = unserialize($setting['value']))) {
                                                foreach($setting['value'] as $key => $value) {
                                                        if($value['available']) {
                                                                unset($setting['value'][$key]['available']);
                                                        } else {
                                                                unset($setting['value'][$key]);
                                                        }
                                                }
                                        }
                                } elseif($setting['variable'] == 'qihoo_keywords') {
                                        foreach(explode("\n", trim($setting['value'])) as $keyword) {
                                                if($keyword = trim($keyword)) {
                                                        $data['qihoo_links']['keywords'][] = '<a href="search.php?srchtype=qihoo&srchtxt='.rawurlencode($keyword).'&searchsubmit=yes" target="_blank">'.dhtmlspecialchars(trim($keyword)).'</a>';
                                                }
                                        }
                                } elseif($setting['variable'] == 'qihoo_topics') {
                                        if(is_array($topics = unserialize($setting['value']))) {
                                                foreach($topics as $topic) {
                                                        if($topic['topic'] = trim($topic['topic'])) {
                                                                $data['qihoo_links']['topics'][] = '<a href="topic.php?topic='.rawurlencode($topic['topic']).'&keyword='.rawurlencode($topic['keyword']).'&stype='.$topic['stype'].'&length='.$topic['length'].'&relate='.$topic['relate'].'" target="_blank">'.dhtmlspecialchars(trim($topic['topic'])).'</a>';
                                                        }
                                                }
                                        }
                                } elseif($setting['variable'] == 'creditspolicy') {
                                        $setting['value'] = unserialize($setting['value']);
                                } elseif($setting['variable'] == 'creditsformula') {
                                        $setting['value'] = preg_replace("/(digestposts|posts|pageviews|oltime|extcredits[1-8])/", "\$member['\\1']", $setting['value']);
                                } elseif($setting['variable'] == 'maxsmilies') {
                                        $setting['value'] = $setting['value'] <= 0 ? -1 : $setting['value'];
                                }

                                if(!in_array($setting['variable'], array('qihoo_keywords', 'qihoo_topics'))) {
                                        $GLOBALS[$setting['variable']] = $data[$setting['variable']] = $setting['value'];
                                }
                        }
                        if($data['stylejump']) {
                                $data['stylejump'] = array();
                                $query = $db->query("SELECT styleid, name FROM {$tablepre}styles WHERE available='1'");
                                while($style = $db->fetch_array($query)) {
                                        $data['stylejump'][$style['styleid']] = dhtmlspecialchars($style['name']);
                                }
                        }
                        $query = $db->query("SELECT COUNT(*) FROM {$tablepre}members");
                        $GLOBALS['totlamembers'] = $data['totalmembers'] = $db->result($query, 0);

                        $datecut = time() - (3600 * 24);
                        $query = $db->query("SELECT COUNT(*) FROM {$tablepre}members WHERE regdate>='$datecut'");
                        $GLOBALS['todaynewmems'] = $data['todaynewmems'] = $db->result($query, 0);

                        $query = $db->query("SELECT username FROM {$tablepre}members ORDER BY uid DESC LIMIT 1");
                        $GLOBALS['lastmember'] = $data['lastmember'] = $db->result($query, 0);
                        $GLOBALS['version'] = $data['version'] = DISCUZ_KERNEL_VERSION;
                        $modreasonsarray = array();
                        foreach(explode("\n", trim($data['modreasons'])) as $reason) {
                                $reason = trim($reason);
                                $modreasonarray[] = $reason ? array(dhtmlspecialchars($reason), $reason) : array('', '--------');
                        }
                        $GLOBALS['modreasons'] = $data['modreasons'] = $modreasonarray;

                        $query = $db->query("SELECT nextrun FROM {$tablepre}crons WHERE available>'0' AND nextrun>'$timestamp' ORDER BY nextrun LIMIT 1");
                        $data['cronnextrun'] = $db->result($query, 0);

                        $data['todaysbdays'] = '';
                        if($data['bdaystatus']) {
                                if(empty($_DCACHE['settings']['todaysbdays'])) {
                                        $bdaymembers = array();
                                        $query = $db->query("SELECT uid, username, email, bday FROM {$tablepre}members WHERE bday LIKE '%-".gmdate('m-d', $timestamp + $data['timeoffset'] * 3600)."' ORDER BY bday");
                                        while($bdaymember = $db->fetch_array($query)) {
                                                $birthyear = intval($bdaymember['bday']);
                                                $bdaymembers[] = '<a href="viewpro.php?uid='.$bdaymember['uid'].'" target="_blank" '.($birthyear ? 'alt="'.$bdaymember['bday'].'"' : '').'>'.$bdaymember['username'].'</a>';
                                        }
                                        $data['todaysbdays'] = implode(', ', $bdaymembers);
                                } else {
                                        $data['todaysbdays'] = $_DCACHE['settings']['todaysbdays'];
                                }
                        }

                        $data['advertisements'] = array();
                        $query = $db->query("SELECT * FROM {$tablepre}advertisements WHERE available>'0' AND starttime<='$timestamp' ORDER BY displayorder");
                        if($db->num_rows($query)) {
                                while($adv = $db->fetch_array($query)) {
                                        $data['advertisements']['items'][$adv['advid']] = $adv['code'];
                                        if($adv['targets'] == '') {
                                                $data['advertisements']['types'][$adv['type']]['all'][] = $adv['advid'];
                                        } else {
                                                foreach(explode("\t", $adv['targets']) as $target) {
                                                        if($target == 0) {
                                                                $data['advertisements']['types'][$adv['type']]['index'][] = $adv['advid'];
                                                        } else {
                                                                $data['advertisements']['types'][$adv['type']]['forum_'.$target][] = $adv['advid'];
                                                        }
                                                }
                                        }
                                }
                                $query = $db->query("SELECT starttime FROM {$tablepre}advertisements WHERE available>'0' AND starttime>'$timestamp' ORDER BY starttime LIMIT 1");
                                $data['advertisements']['lateststarttime'] = intval($db->result($query, 0));
                                $query = $db->query("SELECT endtime FROM {$tablepre}advertisements WHERE available>'0' AND endtime>'$timestamp' ORDER BY endtime LIMIT 1");
                                $data['advertisements']['latestendtime'] = intval($db->result($query, 0));
                        }

                        $data['plugins'] = array();
                        $query = $db->query("SELECT available, name, identifier, directory, datatables, modules FROM {$tablepre}plugins");
                        while($plugin = $db->fetch_array($query)) {
                                $plugin['modules'] = unserialize($plugin['modules']);
                                if(is_array($plugin['modules'])) {
                                        foreach($plugin['modules'] as $module) {
                                                if($plugin['available'] && isset($module['name'])) {
                                                        switch($module['type']) {
                                                                case 1:
                                                                        $data['plugins']['links'][$plugin['identifier']][$module['name']] = array('adminid' => $module['adminid'], 'url' => "<a href=\"$module[url]\">$module[menu]</a>");
                                                                        break;
                                                                case 2:
                                                                        $data['plugins']['links'][$plugin['identifier']][$module['name']] = array('adminid' => $module['adminid'], 'url' => "<a href=\"plugin.php?identifier=$plugin[identifier]&module=$module[name]\">$module[menu]</a>", 'directory' => $plugin['directory']);
                                                                        break;
                                                                case 4:
                                                                        $data['plugins']['include'][] = array('adminid' => $module['adminid'], 'script' => $plugin['directory'].$module['name']);
                                                                        break;
                                                        }
                                                }
                                        }
                                }
                        }

                        $data['hooks'] = array();
                        $query = $db->query("SELECT ph.title, ph.code, p.identifier FROM {$tablepre}plugins p
                                LEFT JOIN {$tablepre}pluginhooks ph ON ph.pluginid=p.pluginid AND ph.available='1'
                                WHERE p.available='1' ORDER BY p.identifier");
                        while($hook = $db->fetch_array($query)) {
                                if($hook['title'] && $hook['code']) {
                                        $data['hooks'][$hook['identifier'].'_'.$hook['title']] = $hook['code'];
                                }
                        }
                        break;
                case 'crons':
                        while($cron = $db->fetch_array($query)) {
                                $cronid = $cron['cronid'];
                                $cron['filename'] = str_replace(array('..', '/', '\\'), array('', '', ''), $cron['filename']);
                                $cron['minute'] = explode("\t", $cron['minute']);
                                unset($cron['cronid']);
                                $data[$cronid] = $cron;
                        }
                        break;
                case 'usergroups':
                        global $userstatusby;
                        while($group = $db->fetch_array($query)) {
                                $groupid = $group['groupid'];
                                $group['grouptitle'] = $group['color'] ? '<font color="'.$group['color'].'">'.$group['grouptitle'].'</font>' : $group['grouptitle'];
                                if($userstatusby == 2) {
                                        $group['byrank'] = $group['type'] == 'member' ? 1 : 0;
                                }
                                if($userstatusby == 0 || ($userstatusby == 2 && $group['type'] == 'member')) {
                                        unset($group['grouptitle'], $group['stars']);
                                }
                                if($group['type'] != 'member') {
                                        unset($group['creditshigher'], $group['creditslower']);
                                }
                                unset($group['groupid'], $group['color']);
                                $data[$groupid] = $group;
                        }
                        break;
                case 'ranks':
                        global $userstatusby;
                        if($userstatusby == 2) {
                                while($rank = $db->fetch_array($query)) {
                                        $rank['ranktitle'] = $rank['color'] ? '<font color="'.$rank['color'].'">'.$rank['ranktitle'].'</font>' : $rank['ranktitle'];
                                        unset($rank['color']);
                                        $data[] = $rank;
                                }
                        }
                        break;
                case 'announcements_forum':
                        if($data = $db->fetch_array($query)) {
                                $data['authorid'] = intval($data['authorid']);
                                $data['message'] = cutstr(strip_tags($data['message']), 18);
                        } else {
                                $data = array();
                        }
                        break;
                case 'globalstick':
                        $fuparray = $threadarray = array();
                        while($forum = $db->fetch_array($query)) {
                                switch($forum['type']) {
                                        case 'forum':
                                                $fuparray[$forum['fid']] = $forum['fup'];
                                                break;
                                        case 'sub':
                                                $fuparray[$forum['fid']] = $fuparray[$forum['fup']];
                                                break;
                                }
                        }
                        $query = $db->query("SELECT




 AL8 Forum © All rights reserved.
頂部
 alan888
 0000001
Rank: 9Rank: 9Rank: 9Rank: 9Rank: 9Rank: 9Rank: 9Rank: 9Rank: 9

頭銜: Administrator

自述: skywalker

帖子: 21877

精華: 195

積分: 558095 點

現金: 78355948 元

存款: 144392954 元

閱讀權限: 120

註冊: 2003-11-13

來自: Hong Kong

狀態: 離線
 
發表於 2006-4-28 23:49  資料  個人空間  主頁 短消息  加為好友 
與 cache.func.php 無關

是你那個有關 php 檔重覆 require 了 cache.func.php 這個檔
即類似下語法
require_once DISCUZ_ROOT.'./include/cache.func.php';




 AL8 Forum © All rights reserved.
頂部
 qazxcdews88
 0095018
Rank: 3Rank: 3Rank: 3

頭銜: Conqueror

帖子: 109

精華: 0

積分: 1370 點

現金: 95 元

存款: 0 元

閱讀權限: 20

註冊: 2008-1-21

狀態: 離線
 
發表於 2008-2-12 23:54  資料  個人空間  短消息  加為好友 
可以請問是在哪個檔案嗎??

我找遍了cache.func.php , index.php 都沒有!

我的論壇是d5.5版的,

請大大幫我解決!

謝謝




 AL8 Forum © All rights reserved.
頂部
 8783
 0047230
Rank: 6Rank: 6Rank: 6Rank: 6Rank: 6Rank: 6

頭銜: Forum Legend

帖子: 1693

精華: 0

積分: 18888 點

現金: 1013 元

存款: 0 元

閱讀權限: 70

註冊: 2006-6-27

狀態: 離線
 
發表於 2008-2-13 00:03  資料  個人空間  短消息  加為好友  添加 8783 為MSN好友 通過MSN和 8783 交談
回覆 #3 qazxcdews88 的帖子

你是samspson 嗎?
用dz5.5版的去dz4.0及4.1問問題?




 AL8 Forum © All rights reserved.
頂部
 qazxcdews88
 0095018
Rank: 3Rank: 3Rank: 3

頭銜: Conqueror

帖子: 109

精華: 0

積分: 1370 點

現金: 95 元

存款: 0 元

閱讀權限: 20

註冊: 2008-1-21

狀態: 離線
 
發表於 2008-2-13 02:23  資料  個人空間  短消息  加為好友 
我是在收尋找到這個主題的......

但是在d5.5版裡面也是有這個問題存在的!

因為正好alan888有回復就想說問問看,

這樣都有意見=  =".....無言




 AL8 Forum © All rights reserved.
頂部
 alan888
 0000001
Rank: 9Rank: 9Rank: 9Rank: 9Rank: 9Rank: 9Rank: 9Rank: 9Rank: 9

頭銜: Administrator

自述: skywalker

帖子: 21877

精華: 195

積分: 558095 點

現金: 78355948 元

存款: 144392954 元

閱讀權限: 120

註冊: 2003-11-13

來自: Hong Kong

狀態: 離線
 
發表於 2008-2-13 03:54  資料  個人空間  主頁 短消息  加為好友 
回覆 #5 qazxcdews88 的帖子

係邊個動作出現問題就改那個 php 檔, 例如發帖就改 include/newthread.inc.php




 AL8 Forum © All rights reserved.
頂部
 qazxcdews88
 0095018
Rank: 3Rank: 3Rank: 3

頭銜: Conqueror

帖子: 109

精華: 0

積分: 1370 點

現金: 95 元

存款: 0 元

閱讀權限: 20

註冊: 2008-1-21

狀態: 離線
 
發表於 2008-2-13 12:09  資料  個人空間  短消息  加為好友 
可是我不懂......

我的論壇newthread.inc.php檔案內容是這樣:

QUOTE:
<?php

if(!defined('IN_DISCUZ')) {
        exit('Access Denied');
}

$discuz_action = 11;

if(empty($forum['fid']) || $forum['type'] == 'group') {
        showmessage('forum_nonexistence');
}

$sgid = intval($sgid);
if($iscircle) {
        $mycircles = array();
        if($discuz_uid) {
                supe_dbconnect();
                $query = $supe['db']->query("SELECT gid, groupname FROM {$supe[tablepre]}groupuid WHERE uid='$discuz_uid' AND flag=1");
                while($mycircle = $supe['db']->fetch_array($query)) {
                        $mycircles[$mycircle['gid']] = cutstr($mycircle['groupname'], 30);
                }
        }
        if($sgid) {
                supe_dbconnect();
                $query = $supe['db']->query("SELECT g.groupname, gf.headerimage, gf.css FROM {$supe[tablepre]}groups g, {$supe[tablepre]}groupfields gf WHERE g.gid='$sgid' AND g.flag=1 AND g.gid=gf.gid");
                $circle = $supe['db']->fetch_array($query);
                if(!$discuz_uid || !$supe['db']->result($supe['db']->query("SELECT COUNT(*) FROM {$supe[tablepre]}groupuid WHERE uid='$discuz_uid' AND gid='$sgid' AND flag=1"), 0)) {
                        showmessage('circle_nopermission');
                }
        }
}

if(!$discuz_uid && !((!$forum['postperm'] && $allowpost) || ($forum['postperm'] && forumperm($forum['postperm'])))) {
        showmessage('group_nopermission', NULL, 'NOPERM');
} elseif(empty($forum['allowpost'])) {
        if(!$forum['postperm'] && !$allowpost) {
                showmessage('group_nopermission', NULL, 'NOPERM');
        } elseif($forum['postperm'] && !forumperm($forum['postperm'])) {
                showmessage('post_forum_newthread_nopermission', NULL, 'HALTED');
        }
}

$isblog = empty($isblog) ? '' : 'yes';
if($isblog && (!$allowuseblog || !$forum['allowshare'])) {
        showmessage('post_newthread_blog_invalid', NULL, 'HALT');
}

.........................................(省略).........................................