我使用的是wxh的,可以帮改一个吗??
我已经不小心把一开始的改进去了……<?php
/*
design by Clement
*/
//---ÉèÖÃ---start
$shownums = 10;//ÑÝʾ¸öÊý,³¬¹ý6ÔòÎÞ·¨Ê¹Óõ¼º½Ìõ.
$searchnums = 20;//ËÑË÷×ÜÊý.
$cachelife = 1000;//°´ÕÕ×Ô¼ºµÄʵ¼ÊÇé¿öÉèÖã¬Ä¬ÈÏΪ1800Ãë.
$orderby = 'dateline';//ËÑË÷˳Ðò.°´ÕÕÈÕÆÚËÑË÷ÊäÈëdateline.°´ÕÕä¯ÀÀ´ÎÊýÊäÈëdownloads.Ëæ»úËÑË÷ÇëÊäÈërand.
$cachename = 'showpic';//»º´æÃû.ÈôÓëºÎ²å¼þ³åÍ»ÇëÐÞ¸Ä,Ö»Òª²»³åÍ»²»»áÓ°ÏìʹÓÃ.
$searchfid = '';//ËÑË÷·¶Î§.²»ÏÞÖÆÁô¿Õ.ÇëÓöººÅÏà¸ô,Èç'1,2,3'.
//---ÉèÖÃ---end
if((@!include('forumdata/cache/cache_'.$cachename.'.php')) || $expiration < time() || $cacheshownums != $shownums || $cachesearchnums != $searchnums || $cachecachelife != $cachelife || $cacheorderby != $orderby || $cachecachename != $cachename || $cachesearchfid != $searchfid) {
require_once './include/common.inc.php';
$orderby = $orderby != 'rand' ? 'attach.'.$orderby : 'rand()';
$fids = $searchfid ? 'AND '."t.fid IN ($searchfid)" : '';
$data = array();
$query = $db->query("SELECT attach.aid, attach.attachment, t.tid, t.fid, t.subject FROM {$tablepre}attachments attach LEFT JOIN {$tablepre}threads t ON t.tid=attach.tid WHERE attach.readperm='0' AND displayorder>='0' AND filetype='image/pjpeg' $fids GROUP BY attach.tid ORDER BY $orderby DESC LIMIT $searchnums");
while ($pic = $db->fetch_array($query)) {
$data['pic'][$pic[aid]]['showpicpics'] = $attachurl.'/'.$pic['attachment'];
$data['pic'][$pic[aid]]['showpiclinks'] = "viewthread.php?tid=$pic[tid]";
$data['pic'][$pic[aid]]['showpictexts'] = str_replace('\'', ' ',$pic['subject']);
}
if($_DCACHE['settings']['qihoo_image']['senable']) {
require_once './include/qcomic.inc.php';
$qcomic_data = array();
$gids = '';
$query = $db->query("SELECT qi.phid, t.tid, t.fid, t.subject FROM {$tablepre}qihooimages qi LEFT JOIN {$tablepre}threads t ON t.tid=qi.tid WHERE qi.phid<>'-1' GROUP BY qi.tid ORDER BY qi.tid DESC LIMIT $shownums");
while ($pic = $db->fetch_array($query)) {
$qcomic_data[$pic[phid]]['showpicpics'] = '';
$qcomic_data[$pic[phid]]['showpiclinks'] = "viewthread.php?tid=$pic[tid]";
$qcomic_data[$pic[phid]]['showpictexts'] = str_replace('\'', ' ',$pic['subject']);
$gids.= ','.$pic[phid];
}
if ($gids) {
$ret = qcomic_fopen("http://comic.qihoo.com/discuz/info_get_by_gid.php?sid=".$_DCACHE['settings']['qihoo_image']['sid']."&code=".urlencode(authcode("spassword=".$_DCACHE['settings']['qihoo_image']['spassword'], '', $_DCACHE['settings']['qihoo_image']['skey']))."&gids=".urlencode(substr($gids, 1)), 10000, '', '', TRUE, '', 20, TRUE);
$ret = unserialize($ret);
foreach($qcomic_data as $phid=>$val) {
if (isset($ret['info'][$phid])) {
$data['pic'][$phid] = $qcomic_data[$phid];
$data['pic'][$phid]['showpicpics'] = $ret['info'][$phid]['iurl'];
}
}
function qcomic_compare_imgpos($a, $b) {
$aid = substr($a['showpiclinks'], 19);
$bid = substr($b['showpiclinks'], 19);
if ($aid==$bid) return 0;
return ($aid < $bid) ? 1 : -1;
}
usort($data['pic'], "qcomic_compare_imgpos");
}
}
$data['expiration'] = $cachelife + time();
$data['cacheshownums'] = $shownums;
$data['cachesearchnums'] = $searchnums;
$data['cachecachelife'] = $cachelife;
$data['cacheorderby'] = $orderby;
$data['cachecachename'] = $cachename;
$data['cachesearchfid'] = $searchfid;
require_once DISCUZ_ROOT.'./include/cache.func.php';
writetocache($cachename, '', getcachevars($data));
include(DISCUZ_ROOT.'./forumdata/cache/cache_'.$cachename.'.php');
}
shuffle($pic);
$i = 0;
$j = 0;
while ($j < $shownums && isset($pic[$i])) {
if(is_readable($pic[$i]['showpicpics']) || substr($pic[$i]['showpicpics'],0,4)=='http') {
$showpicpics .= $comma.$pic[$i]['showpicpics'];
$showpiclinks .= $comma.$pic[$i]['showpiclinks'];
$showpictexts .= cutstr($comma.$pic[$i]['showpictexts'],50);
$comma = '|';
$j++;
}
$i++;
}
?>
<script type="text/javascript">
var swf_width=480
var swf_height=275
var files='<?=$showpicpics?>'
var links='<?=$showpiclinks?>'
var texts='<?=$showpictexts?>'
document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="'+ swf_width +'" height="'+ swf_height +'">');
document.write('<param name="movie" value="images/focus.swf"><param name="quality" value="high">');
document.write('<param name="menu" value="false"><param name=wmode value="opaque">');
document.write('<param name="FlashVars" value="bcastr_file='+files+'&bcastr_link='+links+'&bcastr_title='+texts+'">');
document.write('<embed src="images/focus.swf" wmode="opaque" FlashVars="bcastr_file='+files+'&bcastr_link='+links+'&bcastr_title='+texts+'& menu="false" quality="high" width="'+ swf_width +'" height="'+ swf_height +'" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />'); document.write('</object>');
</script> 请大大救命啊!!! |