- //---设置---start
- $shownums = 5;//演示个数 6以内
- $searchnums = 50;//搜索总数
- $cachelife = 1800;//缓存时间
- $orderby = 'dateline';//搜索顺序:按日期dateline/按浏览次数downloads/随机rand
- $cachename = 'showpic';//缓存名.若与何插件冲突请修改,只要不冲突不会影响使用.
- $searchfid = '';//搜索fid范围.不限制留空.请用逗号相隔,如'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/jpeg' OR filetype='image/pjpeg' $fids GROUP BY attach.tid ORDER BY $orderby DESC LIMIT $searchnums");
复制代码 LZ你这浏览图片是怎么提取的啊
我想把这 这一周的图片 随机 提取出来应该怎么做啊 |