'.lang('plugin/xj_event', 'qianglou').'';
}else{
$return[$thread['tid']] = '';
}
}
if(!$return[$thread['tid']]){
$xj_event = DB::result_first("SELECT * FROM ".DB::table('xj_event')." WHERE tid = ".$thread['tid']);
if($xj_event){
$return[$thread['tid']] = ''.lang('plugin/xj_event', 'huodong').'';
}else{
$return[$thread['tid']] = '';
}
}
}
return $return;
}
function viewthread_threadTop() {
require_once DISCUZ_ROOT.'./source/plugin/wechat/wechat.lib.class.php';
global $_G;
//调用微信支付设置
if(file_exists($xj_event_wxset = DISCUZ_ROOT.'./data/sysdata/cache_xj_event_wxset.php')) {
@include $xj_event_wxset;
}
$return = '';
$timestamp = time();
$tid = $_GET['tid'];
$siteid = $_G['wechat']['setting']['wsq_siteid'];
$items = DB::fetch_first("SELECT A.*,B.authorid FROM ".DB::table('xj_event')." A LEFT JOIN ".DB::table('forum_thread')." B ON A.tid = B.tid WHERE A.tid = $tid");
if($items){
if(file_exists(DISCUZ_ROOT.'./source/plugin/xj_event/module/wsqcenter/event_view.php')) {
return "event_view();";
}
}
if($items && $items['onlineclass']<101){
//二级地区分类调用
if($_G['cache']['plugin']['xj_event']['event_city']){
if($items['citys']){
$upid = DB::result_first("SELECT upid FROM ".DB::table('common_district')." WHERE name = '".$items['citys']."'");
$upid = intval($upid);
$items['province'] = DB::result_first("SELECT name FROM ".DB::table('common_district')." WHERE id = $upid");
}
}
$extcredits = $_G['setting']['extcredits'];
$setting = unserialize($items['setting']);
if($items['postclass']==1){
$postclass = lang('plugin/xj_event', 'xxhd');
$tmp = explode("\n",$_G['cache']['plugin']['xj_event']['event_offline_class']);
foreach($tmp as $key=>$value){
$eventclass = explode("|",$value);
if($eventclass[0] == $items['offlineclass']){
break;
}
}
}else{
$postclass = lang('plugin/xj_event', 'xshd');
$tmp = explode("\n",$_G['cache']['plugin']['xj_event']['event_online_class']);
foreach($tmp as $key=>$value){
$eventclass = explode("|",$value);
if($eventclass[0] == $items['onlineclass']){
break;
}
}
}
foreach($extcredits as $key=>$value){
if($key == $items['use_extcredits']){
$extcredit_title = $value['title'];
}
}
$citys = $items['citys'];
$starttime = dgmdate($items['starttime'],'dt');
$endtime = dgmdate($items['endtime'],'dt');
$activitybegin = dgmdate($items['activitybegin'],'dt');
$activityexpiration = dgmdate($items['activityexpiration'],'dt');
if(!$items['activityaid'] and $items['activityaid_url']){
$imgurl = $items['activityaid_url'];
}else{
//$imgurl = $this->_getpicurl($items['activityaid'],$tid);
$imgurl = $_G['siteurl'].getforumimg($items['activityaid'],0,360,230);
}
if(!$items['activityaid'] && !$items['activityaid_url']){
$imgurl = $_G['siteurl'].'static/image/common/nophoto.gif';
}
//活动管理列表
$event_adminlist = implode(',',$setting['event_admin']);
//报名审核状态
$apply = DB::fetch_first("SELECT applyid,pay_state,verify,seccode FROM ".DB::table('xj_eventapply')." WHERE tid='$tid' and uid=".$_G['uid']);
$verify = $apply['verify'];
$pay_state = $apply['pay_state'];
$return .= '

';
$return .= '
'.lang('plugin/xj_event', 'huodongfs').':'.$postclass.'
';
$return .= '
'.lang('plugin/xj_event', 'huodonglx').':'.$eventclass[1].'
';
$return .= '
'.lang('plugin/xj_event', 'huodongdq').':'.$items['province'].$citys.'
';
$return .= '
'.lang('plugin/xj_event', 'kashisj').':'.$starttime.'
';
$return .= '
'.lang('plugin/xj_event', 'jieshusj').':'.$endtime.'
';
$return .= '
'.lang('plugin/xj_event', 'huodongdd').':'.$items['event_address'].'
';
$return .= '
'.lang('plugin/xj_event', 'huodonggl').':'.$event_adminlist.'
';
if($items[event_number]==0){
$cjme = lang('plugin/xj_event', 'buxian');
}else{
$cjme = $items['event_number'].lang('plugin/xj_event', 'ren');
}
$return .= '
'.lang('plugin/xj_event', 'canjiame').':'.$cjme.'
';
//报名通过总人数
$applycountnumber = DB::result_first("SELECT SUM(applynumber) FROM ".DB::table('xj_eventapply')." WHERE tid='$tid' and verify=1");
$applycountnumber = !$applycountnumber?0:$applycountnumber;
$applycountnumberd = DB::result_first("SELECT SUM(applynumber) FROM ".DB::table('xj_eventapply')." WHERE tid='$tid' and verify=0");
$applycountnumberd = !$applycountnumberd?0:$applycountnumberd;
$return .= '
'.lang('plugin/xj_event', 'baomingrs').':'.$applycountnumber.lang('plugin/xj_event', 'rendaish').$applycountnumberd.lang('plugin/xj_event', 'ren').'
';
//参加费用
if($setting['eventaa']){
$cjfy = 'AA';
if($items['use_cost']>0){
$cjfy .= ' '.$items['use_cost'].lang('plugin/xj_event', 'yuanzy');
}
}else{
$cjfy = $items['use_cost'].lang('plugin/xj_event', 'yuan');
}
$return .= '
'.lang('plugin/xj_event', 'canjiafy').':'.$cjfy.'
';
$return .= '
'.lang('plugin/xj_event', 'baomingks').':'.$activitybegin.'
';
$return .= '
'.lang('plugin/xj_event', 'baominjz').':'.$activityexpiration.'
';
foreach($setting['moreitem'] as $value){
$return .= '
'.$value['itemname'].':'.$value['itemcontent'].'
';
}
$bmurl = $_G['siteurl']."plugin.php?id=xj_event:event_join&tid=$tid";
$qxbmurl = $_G['siteurl']."plugin.php?id=xj_event:wsq_join_save&action=cannel&tid=$tid&&formhash=".$_G['formhash'];
$xgbmurl = $_G['siteurl']."plugin.php?id=xj_event:event_join_modify&tid=$tid";
if($wxset['wsqonly']){
$zffyurl = $_G['siteurl']."plugin.php?id=xj_event:wsq_pay&tid=$tid";
}else{
$zffyurl = $_G['siteurl']."plugin.php?id=xj_event:event_pay&tid=$tid";
}
$bmyzmurl = WeChatHook::getPluginUrl('xj_event:wsq_join_vcode', array('applyid' => $apply['applyid']));
//发作业URL
if($setting['eventzy_fid']){
$fbzyurl = $_G['siteurl']."forum.php?mod=post&action=newthread&fid=".$setting['eventzy_fid']."&eid=".$items['eid'];
}else{
$fbzyurl = $_G['siteurl']."forum.php?mod=post&action=newthread&fid=".$_G['fid']."&eid=".$items['eid'];
}
//回复才可以报名
$bmbtnshow = true;
if($setting['reply']){
$replys = DB::result_first("SELECT count(*) FROM ".DB::table('forum_post')." WHERE tid='$tid' AND first<>1 AND invisible>=0 AND authorid = ".$_G['uid']);
if($replys<1){
$bmbtnshow = false;
}
}
//线下活动报名按钮
if($items['postclass']==1){
//线下活动按钮-->
//条件当前时间小于(活动结束+30天)的时间
if($_G['timestamp']<($items['endtime']+2592000)){
if($items['activityexpiration']<=$_G['timestamp'] and $verify==null){
$return .= '
'.lang('plugin/xj_event', 'baominjz').'';
}else{
if(!$_G['uid']){
$return .= '
'.lang('plugin/xj_event', 'woycjqdl').'';
}else{
if($items['activitybegin']<$_G['timestamp'] and $items['activityexpiration']>$timestamp and $verify==null){
if($bmbtnshow){
$return .= '
'.lang('plugin/xj_event', 'woyaocj').'';
}
if($setting[reply] && $replys<1){
$return .= '
'.lang('plugin/xj_event', 'hfhkybm').'';
}
}elseif($items['activitybegin']>$timestamp and $verify==null){
$return .= '
'.lang('plugin/xj_event', 'baomhwks').'';
}else{
if($verify==0){
if(!$pay_state){
$return .= '
'.lang('plugin/xj_event', 'quxiaobm').'';
}
if($setting['eventpay']){
if($pay_state){
$return .= '
'.lang('plugin/xj_event', 'fyyfdsh').'';
}else{
$return .= '
'.lang('plugin/xj_event', 'zhifufy').'';
}
}
}else{
if($setting['eventzy_enable']){
$return .= '
'.lang('plugin/xj_event', 'fabiao').$setting['eventzy_name'].'';
}
if($setting['canceljoin']==1 && $items['activityexpiration']>$timestamp){
$return .= '
'.lang('plugin/xj_event', 'quxiaobm').'';
}
if($setting['seccode']){
$return .= '
'.lang('plugin/xj_event', 'hdrcj').'';
}
}
if($_G['timestamp'] < $items['activityexpiration']){
$return .= '
'.lang('plugin/xj_event', 'xgbmzl').'';
}
}
}
}
}
}
//线上活动报名按钮
if($items['postclass']==2){
//线下活动按钮-->
//条件当前时间小于(活动结束+30天)的时间
if($_G['timestamp']<($items['endtime'])){
if($items['activityexpiration']<=$_G['timestamp'] and $verify==null){
$return .= '
'.lang('plugin/xj_event', 'baominjz').'';
}else{
if(!$_G['uid']){
$return .= '
'.lang('plugin/xj_event', 'woycjqdl').'';
}else{
if($items['activitybegin']<$_G['timestamp'] and $items['activityexpiration']>$timestamp and $verify==null){
if($bmbtnshow){
$return .= '
'.lang('plugin/xj_event', 'woyaocj').'';
}
if($setting[reply] && $replys<1){
$return .= '
'.lang('plugin/xj_event', 'hfhkybm').'';
}
}elseif($items['activitybegin']>$timestamp and $verify==null){
$return .= '
'.lang('plugin/xj_event', 'baomhwks').'';
}else{
if($verify==0){
if(!$pay_state){
$return .= '
'.lang('plugin/xj_event', 'quxiaobm').'';
}
if($setting['eventpay']){
if($pay_state){
$return .= '
'.lang('plugin/xj_event', 'fyyfdsh').'';
}else{
$return .= '
'.lang('plugin/xj_event', 'zhifufy').'';
}
}
}else{
if($setting['eventzy_enable']){
$return .= '
'.lang('plugin/xj_event', 'fabiao').$setting['eventzy_name'].'';
}
if($setting['canceljoin']==1 && $items['activityexpiration']>$timestamp){
$return .= '
'.lang('plugin/xj_event', 'quxiaobm').'';
}
if($setting['seccode']){
$return .= '
'.lang('plugin/xj_event', 'hdrcj').'';
}
}
if($_G['timestamp'] < $items['activityexpiration']){
$return .= '
'.lang('plugin/xj_event', 'xgbmzl').'';
}
}
}
}
}
}
//微社区美化版功能
if(file_exists(DISCUZ_ROOT.'./source/plugin/xj_event/module/wsqcenter/center.php')) {
if($_G['uid'] == $items['authorid']){
$return .= '
'.lang('plugin/xj_event','xghdlr').'';
}
}
$return .= '
';
}
$num = DB::result_first("SELECT COUNT(*) FROM ".DB::table('xj_eventthread')." WHERE tid=".$tid);
if($num>0){
$items = DB::fetch_first("SELECT A.eid,A.votes,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']);
//$variables['xj_event']['vote'] = 'fff';
if($setting[vote][openvote]==1 && $nowtime>$setting['vote']['votestarttime'] && $nowtime<$setting['vote']['voteendtime']){
$return = '