$showreward = isset($_G['setting']['extcredits'][$_G['setting']['creditstransextra'][2]]) && $_G['forum']['allowpostspecial'] & 4; $showactivity = $_G['forum']['allowpostspecial'] & 8; $showdebate = $_G['forum']['allowpostspecial'] & 16; } if ($_G['group']['allowpost']) { $_G['group']['allowpostpoll'] = $_G['group']['allowpostpoll'] && $showpoll; $_G['group']['allowposttrade'] = $_G['group']['allowposttrade'] && $showtrade; $_G['group']['allowpostreward'] = $_G['group']['allowpostreward'] && $showreward; $_G['group']['allowpostactivity'] = $_G['group']['allowpostactivity'] && $showactivity; $_G['group']['allowpostdebate'] = $_G['group']['allowpostdebate'] && $showdebate; } if ($action == 'index') { $newthreadlist = array(); if ($status != 2) { require_once libfile('function/feed'); $newthreadlist = getgroupcache($_G['fid'], array('dateline'), 0, 10, 0, 1); foreach ($newthreadlist['dateline']['data'] as $tid => $thread) { if ($thread['closed'] == 1) { $newthreadlist['dateline']['data'][$tid]['folder'] = 'lock'; } elseif (empty($_G['cookie']['oldtopics']) || strpos($_G['cookie']['oldtopics'], 'D' . $tid . 'D') === FALSE) { $newthreadlist['dateline']['data'][$tid]['folder'] = 'new'; } else { $newthreadlist['dateline']['data'][$tid]['folder'] = 'common'; } } $groupfeedlist = array(); if (!IS_ROBOT) { $activityuser = array_keys($groupcache['activityuser']['data']); if ($activityuser) { $query = DB::query("SELECT * FROM " . DB::table('home_feed') . " USE INDEX(dateline) WHERE uid IN (" . dimplode($activityuser) . ") ORDER BY dateline desc LIMIT 0, 5"); while ($feed = DB::fetch($query)) {
showmessage('forum_not_group', 'group.php'); } elseif ($status == 1) { showmessage('forum_group_status_off'); } elseif ($status == 2) { showmessage('forum_group_noallowed', 'forum.php?mod=group&fid=' . $_G['fid']); } elseif ($status == 3) { showmessage('forum_group_moderated', 'forum.php?mod=group&fid=' . $_G['fid']); } $_G['forum']['icon'] = get_groupimg($_G['forum']['icon'], 'icon'); $_G['grouptypeid'] = $_G['forum']['fup']; $_G['forum']['dateline'] = dgmdate($_G['forum']['dateline'], 'd'); $nav = get_groupnav($_G['forum']); $groupnav = $nav['nav']; $onlinemember = grouponline($_G['fid']); $groupmanagers = $_G['forum']['moderators']; $groupcache = getgroupcache($_G['fid'], array('replies', 'views', 'digest', 'lastpost', 'ranking', 'activityuser', 'newuserlist')); $seotype = 'grouppage'; $seodata['first'] = $nav['first']['name']; $seodata['second'] = $nav['second']['name']; $seodata['gdes'] = $_G['forum']['description']; $forumseoset = array(); } $_G['forum']['banner'] = get_forumimg($_G['forum']['banner']); list($navtitle, $metadescription, $metakeywords) = get_seosetting($seotype, $seodata, $forumseoset); if (!$navtitle) { $navtitle = get_title_page($_G['forum']['name'], $_G['page']); $nobbname = false; } else { $nobbname = true; } if (!empty($_G['gp_typeid']) && !empty($_G['forum']['threadtypes']['types'][$_G['gp_typeid']])) {
function syngroup($bid) { global $_G; $config = $_G['cache']['plugin']['sanree_brand']; if (intval($config['allowsyngroup']) != 1) { return; } $bids = array(); if (!is_array($bid)) { $bids[] = $bid; } else { $bids = $bid; } $category = C::t('#sanree_brand#sanree_brand_category')->fetch_all_category(); $cates = array(); foreach ($category as $v) { $cates[$v[cateid]] = $v; } require_once libfile('function/group'); foreach ($bids as $ibid) { $lastdata = C::t('#sanree_brand#sanree_brand_businesses')->fetch_first_bybid($ibid); if (!$lastdata) { continue; } $group = C::t('#sanree_brand#sanree_brand_group')->get_by_groupid(intval($lastdata['groupid'])); if (!$group) { continue; } if (intval($group['allowsyngroup']) != 1) { continue; } $lastdata['syngroupid'] = intval($cates[$lastdata['cateid']]['syngroupid']); if ($lastdata['syngroupid'] < 1) { continue; } $postgroup = getgroupcache($lastdata['syngrouptid']); if ($lastdata['syngrouptid'] && $postgroup) { $setarr = array(); $setarr['name'] = $lastdata['name']; $setarr['parentid'] = $lastdata['syngroupid']; $setarr['fup'] = $lastdata['syngroupid']; $setarr['descriptionnew'] = ''; $setarr['jointype'] = 0; //0自由加入 2审核加入 1邀请加入 $setarr['gviewperm'] = 1; //1所有人 0仅成员 $setarr['bid'] = $lastdata['bid']; $setarr['uid'] = $lastdata['uid']; $setarr['username'] = $lastdata['username']; $setarr['fid'] = $lastdata['syngrouptid']; srupdategroup($setarr); } else { $setarr = array(); $setarr['name'] = $lastdata['name']; $setarr['parentid'] = $lastdata['syngroupid']; $setarr['fup'] = $lastdata['syngroupid']; $setarr['descriptionnew'] = ''; $setarr['jointype'] = 0; //0自由加入 2审核加入 1邀请加入 $setarr['gviewperm'] = 1; //1所有人 0仅成员 $setarr['bid'] = $lastdata['bid']; $setarr['uid'] = $lastdata['uid']; $setarr['username'] = $lastdata['username']; srcreategroup($setarr); } } }