本帖最后由 gaodasong111 于 2009-2-9 00:49 编辑
为什么SD+非主流图片调用那里只能显示2个图呢?我里面传了很多了!
我的代码:- //SD+非主流图片模块随机调用
- $hack_cut_str =15; //修改标题显示字数
- $new_d1qqpicsdt_threadlist = array();
- $sort_time = $today - (60*60*24*100); //本周
- $hack_cut_comiismsstr=120;
- $comiisphoto= array();
- $query = $db->query("SELECT attach.aid, attach.attachment, attach.uid, t.tid, t.fid, t.subject,p.dateline, p.message FROM {$tablepre}attachments attach LEFT JOIN {$tablepre}threads t ON t.tid=attach.tid LEFT JOIN {$tablepre}posts p on p.tid=attach.tid WHERE attach.readperm='0' and t.fid in (41,42) AND filetype IN ('image/pjpeg','image/gif') and t.dateline > $sort_time GROUP BY attach.tid ORDER BY rand() DESC LIMIT 8");
- while ($d1qqphoto = $db->fetch_array($query)) {
- $d1qqphoto['uid'] = $d1qqphoto['uid'];
- $d1qqphoto['fnn'] = $isnum;
- $d1qqphoto['message']=d1qq_ubb($d1qqphoto['message']);
- $d1qqphoto['photo_message'] = d1qqleftstr($d1qqphoto['message'],$hack_cut_d1qqmsstr);
-
- $d1qqphoto['photo_dateline'] = gmdate("$dateformat $timeformat", $d1qqphoto['dateline'] + $timeoffset * 3600);
- $d1qqphoto['photo_id'] = $d1qqphoto['aid'];
- $d1qqphoto['photo_picurl'] = 'attachments/'.$d1qqphoto['attachment'];
- $d1qqphoto['photo_tid'] = $d1qqphoto['tid'];
- $d1qqphoto['photo_fid'] = $d1qqphoto['fid'];
- $d1qqphoto['photo_subject'] = d1qqleftstr($d1qqphoto['subject'],$hack_cut_str);
-
- if($d1qqphoto['highlight']) {
- $string = sprintf('%02d', $d1qqphoto['highlight']);
- $stylestr = sprintf('%03b', $string[0]);
- $d1qqphoto['highlight'] = 'style="';
- $d1qqphoto['highlight'] .= $stylestr[0] ? 'font-weight: bold;' : '';
- $d1qqphoto['highlight'] .= $stylestr[1] ? 'font-style: italic;' : '';
- $d1qqphoto['highlight'] .= $stylestr[2] ? 'text-decoration: underline;' : '';
- $d1qqphoto['highlight'] .= $string[1] ? 'color: '.$colorarray[$string[1]] : '';
- $d1qqphoto['highlight'] .= '"';
- } else {
- $d1qqphoto['highlight'] = '';
- }
- if($isnum== 4){
- $isnum=1;
- }
- else{
- $isnum++; }
- $new_d1qqpicsdt_threadlist[] = $d1qqphoto;
- }
- //结束//
复制代码 |