-
Notifications
You must be signed in to change notification settings - Fork 0
/
xshow.inc.php
39 lines (35 loc) · 1.46 KB
/
xshow.inc.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<?php
include('./source/plugin/iltc_open/public.php');
$result = array();
$wzkk_xshow = $_G['cache']['plugin']['wzkk_xshow'];
switch($_G['gp_action']){
case 'image':
$datapic = array();
$fids = $wzkk_xshow['only_pic'] ? 'AND t.fid IN('.$wzkk_xshow['only_pic'].')' : '';
$PicNums = $wzkk_xshow['pic_schnum'];
/**ljm修改图片显示,禁止显示非显版块的图片*/
//echo $wzkk_xshow['not_show'];
$notshow = $wzkk_xshow['not_show'] ? 'AND t.fid not IN('.$wzkk_xshow['not_show'].')' : '';//不显示的版块 all
//插入到下面的sql中
/**end ljm*/
if ($wzkk_xshow['pic_transfer'] == 1) {
$orderby = 'tid';
} else if ($wzkk_xshow['pic_transfer'] == 2) {
$orderby = 'tid';
} else {
$orderby = 'rand';
}
$orderby = $orderby != 'rand' ? 'attach.'.$orderby : 'rand()';
$query = DB::query("SELECT attach.attachment,t.tid, t.fid, t.subject FROM ".DB::table('forum_threadimage')." attach INNER JOIN ".DB::table('forum_thread')." t ON t.tid=attach.tid WHERE t.isgroup=0 AND t.displayorder>=0 $fids $notshow GROUP BY attach.tid ORDER BY $orderby DESC LIMIT 0, ".$PicNums);
while($pic = DB::fetch($query)) {
$pics['src'] = $_G['setting']['attachurl'].'forum/'.$pic['attachment'];
$pics['tid'] = $pic['tid'];
$pics['subject'] = iconv("GBK", "UTF-8", str_replace('\'', ' ',$pic['subject']));
$datapic[] = $pics;
}
$result['images'] = $datapic;
showResult($result, 'success');
break;
default:
showError('Missing Parameter');
}