0){ $items = DB::fetch_first("SELECT A.eid,B.setting,C.tid,C.subject FROM ".DB::table('xj_eventthread')." A,".DB::table('xj_event')." B,".DB::table('forum_thread')." C WHERE A.tid=".$_G['tid']." and A.eid=B.eid and B.tid=C.tid"); $nowtime = $_G["timestamp"]; $setting = unserialize($items['setting']); $eid=$items['eid']; $tid=intval($_G['tid']); $return[0] = '
'.lang('plugin/xj_event', 'btlzyhd').': '.$items['subject'].''; if($setting[vote][openvote]==1 && $nowtime>$setting['vote']['votestarttime'] && $nowtime<$setting['vote']['voteendtime']){ $return[0] = $return[0].'
'; } $return[0] = $return[0].'
'; } return $return; } function post_bottom_mobile(){ global $_G; if($_GET['specialextra']!='xj_event'){ if($_GET['action']!='albumphoto'){ if($_GET['action']=='edit'){ $eid = DB::result_first("SELECT eid FROM ".DB::table('xj_eventthread')." WHERE tid=".$_GET['tid']); } $i = 0; $uid = $_G['uid']; $nowtime = time(); $return = '
'.lang('plugin/xj_event', 'xghd').': ".lang('plugin/xj_event', 'xzncjdhdfbhdzy')."
"; if($i==0){ //判断是否有加参正在进行中的活动,没有就不调用 $return = ''; } } } return $return; } } class mobileplugin_xj_event_forum extends mobileplugin_xj_event { function post_xj_event_reply_output($a) { global $_G,$postinfo; if($_GET['action']=='reply'){ $postinfo['message'] = ''; } } function post_xj_event_message($a) { global $_G; if($a['param']['0'] == 'post_newthread_succeed' || $a['param']['0'] == 'post_newthread_mod_succeed') { $tid = $a['param'][2]['tid']; if($_GET['eid']>0){ $sort = intval($_GET['et_sort']); $eid = intval($_GET['eid']); $fid = intval($_G['fid']); $aid = DB::result_first("SELECT aid FROM ".DB::table('forum_attachment')." WHERE tid=$tid"); //生成缩略图 $imgtype = 1; $attach = array_keys($_G['gp_attachnew']); foreach($_G['gp_attachnew'] as $key => $value){ if(count($value) == 1){ $aid = $key; break; } } $basedir = !$_G['setting']['attachurl'] ? ('data/attachment/') : $_G['setting']['attachurl']; $coverdir = 'threadcover/'.substr(md5($tid), 0, 2).'/'.substr(md5($tid), 2, 2).'/'; if($aid){ //生成缩略图 if(mbeventsetthreadcover($a['param'][2]['pid'],$a['param'][2]['tid'],$aid,0,'',$imgtype,$fid)){ $coverurl = $basedir.'forum/'.$coverdir.$tid.'-event.jpg'; } }else{ preg_match("/\[img(.*)\](.+?)\[\/img\]/is",$_G['gp_message'],$match); if(mbeventsetthreadcover($a['param'][2]['pid'],$a['param'][2]['tid'],0,0,$match[2],$imgtype,$fid)){ $coverurl = $basedir.'forum/'.$coverdir.$tid.'-event.jpg'; } } DB::query("INSERT INTO ".DB::table('xj_eventthread')." (eid,tid,fid,coverurl,sort) VALUES ('$eid','$tid','$fid','$coverurl','$sort')"); } } if($a['param']['0'] =='post_edit_succeed'){ $tid = $a['param'][2]['tid']; if($_GET['eid']>0){ //获取此贴是否已关联其它活动 $num = DB::result_first("SELECT COUNT(*) FROM ".DB::table('xj_eventthread')." WHERE tid='$tid'"); if($num>0){ $eid = intval($_GET['eid']); DB::query("UPDATE ".DB::table('xj_eventthread')." SET eid='$eid' WHERE tid = '$tid'"); }else{ $sort = intval($_GET['et_sort']); $eid = intval($_GET['eid']); $fid = intval($_G['fid']); //生成缩略图 $imgtype = 1; $attach = array_keys($_G['gp_attachnew']); foreach($_G['gp_attachnew'] as $key => $value){ if(count($value) == 1){ $aid = $key; break; } } $basedir = !$_G['setting']['attachurl'] ? ('data/attachment/') : $_G['setting']['attachurl']; $coverdir = 'threadcover/'.substr(md5($tid), 0, 2).'/'.substr(md5($tid), 2, 2).'/'; if($aid){ //生成缩略图 if(mbeventsetthreadcover($a['param'][2]['pid'],$a['param'][2]['tid'],$aid,0,'',$imgtype,$fid)){ $coverurl = $basedir.'forum/'.$coverdir.$tid.'-event.jpg'; } }else{ preg_match("/\[img(.*)\](.+?)\[\/img\]/is",$_G['gp_message'],$match); if(mbeventsetthreadcover($a['param'][2]['pid'],$a['param'][2]['tid'],0,0,$match[2],$imgtype,$fid)){ $coverurl = $basedir.'forum/'.$coverdir.$tid.'-event.jpg'; } } DB::query("INSERT INTO ".DB::table('xj_eventthread')." (eid,tid,fid,coverurl,sort) VALUES ('$eid','$tid','$fid','$coverurl','$sort')"); } } } return; } } function mbeventsetthreadcover($pid, $tid = 0, $aid = 0, $countimg = 0, $imgurl = '',$imgtype = 1,$fid) { global $_G; $cover = 0; //图片大小 $imgheight = 165; $imgwidth = 165; if(empty($_G['uid']) || !intval($imgheight) || !intval($imgwidth)) { return false; } if(($pid || $aid) && empty($countimg)) { if(empty($imgurl)) { if($aid) { $attachtable = 'aid:'.$aid; $attach = C::t('forum_attachment_n')->fetch('aid:'.$aid, $aid, array(1, -1)); } else { $attachtable = 'pid:'.$pid; $attach = C::t('forum_attachment_n')->fetch_max_image('pid:'.$pid, 'pid', $pid); } if(!$attach) { return false; } if(empty($_G['forum']['ismoderator']) && $_G['uid'] != $attach['uid']) { return false; } $pid = empty($pid) ? $attach['pid'] : $pid; $tid = empty($tid) ? $attach['tid'] : $tid; $picsource = ($attach['remote'] ? $_G['setting']['ftp']['attachurl'] : $_G['setting']['attachurl']).'forum/'.$attach['attachment']; } else { $attachtable = 'pid:'.$pid; $picsource = $imgurl; } $basedir = !$_G['setting']['attachdir'] ? (DISCUZ_ROOT.'./data/attachment/') : $_G['setting']['attachdir']; $coverdir = 'threadcover/'.substr(md5($tid), 0, 2).'/'.substr(md5($tid), 2, 2).'/'; dmkdir($basedir.'./forum/'.$coverdir); require_once libfile('class/image'); $image = new image(); if($image->Thumb($picsource, 'forum/'.$coverdir.$tid.'-event.jpg', $imgwidth, $imgheight, 2)) { return true; } else { return false; } } } ?>