本文整理汇总了PHP中loadforum函数的典型用法代码示例。如果您正苦于以下问题:PHP loadforum函数的具体用法?PHP loadforum怎么用?PHP loadforum使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了loadforum函数的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: output
function output()
{
global $_G;
$noticelang = lang('notification', 'reppost_noticeauthor');
$noticepreg = '/^' . str_replace(array('\\{actor\\}', '\\{subject\\}', '\\{tid\\}', '\\{pid\\}'), array('(.+?)', '(.+?)', '(\\d+)', '(\\d+)'), preg_quote($noticelang, '/')) . '$/';
$actorlang = '<a href="home.php?mod=space&uid={actoruid}">{actorusername}</a>';
$actorpreg = '/^' . str_replace(array('\\{actoruid\\}', '\\{actorusername\\}'), array('(\\d+)', '(.+?)'), preg_quote($actorlang, '/')) . '$/';
foreach ($GLOBALS['list'] as $_k => $_v) {
if (preg_match($noticepreg, $_v['note'], $_r)) {
list(, $actor, $tid, $pid, $subject) = $_r;
if (preg_match($actorpreg, $actor, $_r)) {
list(, $actoruid, $actorusername) = $_r;
}
//取出回帖的内容
include_once libfile('function/forum');
require_once libfile('function/discuzcode');
loadforum(null, $tid);
if ($pid) {
$postlist = $this->post = get_post_by_pid($pid, 'message');
$GLOBALS['list'][$_k]['message'] = discuzcode($postlist['message']);
}
$GLOBALS['list'][$_k]['dateline'] = dgmdate($GLOBALS['list'][$_k]['dateline']);
$GLOBALS['list'][$_k]['dbdateline'] = $GLOBALS['list'][$_k]['dateline'];
$GLOBALS['list'][$_k]['notevar'] = array('tid' => $tid, 'pid' => $pid, 'subject' => $subject, 'actoruid' => $actoruid, 'actorusername' => $actorusername);
}
}
$variable = array('hash' => md5(substr(md5($_G['config']['security']['authkey']), 8) . $_G['uid']), 'list' => mobile_core::getvalues(array_values($GLOBALS['list']), array('/^\\d+$/'), array('id', 'uid', 'type', 'new', 'authorid', 'author', 'note', 'dateline', 'from_id', 'from_idtype', 'from_num', 'style', 'rowid', 'notevar', 'message')), 'count' => $GLOBALS['count'], 'perpage' => $GLOBALS['perpage'], 'page' => intval($GLOBALS['page']));
mobile_core::result(mobile_core::variable($variable));
}
示例2: __construct
public function __construct($fid = null) {
parent::__construct();
if($fid) {
include_once libfile('function/forum');
loadforum($fid);
}
$this->forum = &$this->app->var['forum'];
}
示例3: common
function common()
{
global $_G;
$_G['wechat']['setting'] = unserialize($_G['setting']['mobilewechat']);
if (!in_array('wechat', $_G['setting']['plugins']['available']) || !$_G['wechat']['setting']['wsq_fid']) {
mobile_core::result(mobile_core::variable(array()));
}
$_GET['fid'] = $_G['fid'] = $_G['wechat']['setting']['wsq_fid'];
loadforum();
if (!empty($_GET['pw'])) {
$_GET['action'] = 'pwverify';
}
$_G['forum']['allowglobalstick'] = false;
}
示例4: __construct
public function __construct($tid = null, $pid = null) {
parent::__construct();
require_once libfile('function/post');
require_once libfile('function/forumlist');
if($tid) {
include_once libfile('function/forum');
loadforum(null, $tid);
if($pid) {
$this->post = get_post_by_tid_pid($tid, $pid);
}
}
$this->forum = &$this->app->var['forum'];
$this->thread = &$this->app->var['thread'];
$this->group = &$this->app->var['group'];
}
示例5: common
function common()
{
global $_G;
if (!isset($_GET['fid']) && isset($_GET['tid'])) {
$sql = 'SELECT fid FROM ' . DB::table('forum_thread') . ' WHERE tid = ' . intval($_GET['tid']);
$query = DB::query($sql);
$fid = null;
while ($tmp = DB::fetch($query)) {
$fid = $tmp['fid'];
break;
}
loadforum($fid, null);
}
$apifile = dirname(__FILE__) . '/sub_checkpost.php';
if (file_exists($apifile)) {
require_once $apifile;
}
bigapp_core::result(bigapp_core::variable(bigapp_api_sub::getvariable()));
}
示例6: libfile
$currenttype = 'thread';
}
}
if ($currenttype == 'thread') {
$_G['setting']['seccodestatus'] = 0;
$_G['setting']['secqaa']['status'] = 0;
$_POST['replysubmit'] = true;
$_GET['tid'] = $currentid;
$_G['gp_action'] = 'reply';
$_G['gp_message'] = $_POST['general'];
if ($commentcable[$type] == 'article') {
$_POST['portal_referer'] = 'portal.php?mod=view&aid=' . $id;
}
include_once libfile('function/forum');
require_once libfile('function/post');
loadforum();
$inspacecpshare = 1;
include_once libfile('forum/post', 'module');
$redirecturl = $url ? $url : '';
$showmessagecontent = $modnewreplies && $commentcable[$type] != 'article' ? 'do_success_thread_share_mod' : '';
} elseif ($currenttype == 'article') {
if (!checkperm('allowcommentarticle')) {
showmessage('group_nopermission', NULL, array('grouptitle' => $_G['group']['grouptitle']), array('login' => 1));
}
include_once libfile('function/spacecp');
include_once libfile('function/portalcp');
cknewuser();
$waittime = interval_check('post');
if ($waittime > 0) {
showmessage('operating_too_fast', '', array('waittime' => $waittime), array('return' => true));
}
示例7: loadForum
public function loadForum($fid, $tid = 0)
{
require_once libfile('function/forum');
$path = Yii::getPathOfAlias('application.components.discuz.source.function');
require_once sprintf('%s/function_forum_%s.php', $path, MobcentDiscuz::getMobcentDiscuzVersion());
$_GET['fid'] = $fid;
$_GET['tid'] = $tid;
global $_G;
$_G['setting']['forumpicstyle'] = null;
loadforum();
}
示例8: getNormalThread
function getNormalThread() {
global $_G;
$tid = intval($_GET['tid']);
if(empty($tid)) {
return false;
}
require_once libfile('function/forum');
require_once libfile('function/discuzcode');
loadforum();
$subject = strip_tags($_G['thread']['subject']);
$hasImage = $_G['thread']['attachment'] ? true : false;
ajaxshowheader();
echo showNormalTemplateLi($tid, $subject, $hasImage, true);
ajaxshowfooter();
}
示例9: process
function process()
{
global $_G;
//1. try to get user mask
$authority = array();
if ($_G['uid'] && !empty($_G['member']['accessmasks'])) {
loadcache('plugin');
$bucketNum = 100003;
$expire = 5;
$userBucket = $_G['uid'] % $bucketNum;
loadcache('bigapp_authority_' . $userBucket);
if (!isset($_G['cache']['bigapp_authority_' . $userBucket]) || TIMESTAMP - $_G['cache']['bigapp_authority_' . $userBucket]['expiration'] > $expire) {
$sql = 'SELECT uid, fid, allowview FROM ' . DB::table('forum_access') . ' WHERE uid % ' . $bucketNum . ' = ' . $userBucket;
$query = DB::query($sql);
$authorities = array();
while ($tmp = DB::fetch($query)) {
$authorities[$tmp['uid']][$tmp['fid']] = $tmp['allowview'];
}
savecache('bigapp_authority_' . $userBucket, array('variable' => $authorities, 'expiration' => TIMESTAMP));
} else {
$authorities = $_G['cache']['bigapp_authority_' . $userBucket]['variable'];
}
if (isset($authorities[$_G['uid']])) {
$authority = $authorities[$_G['uid']];
}
}
//2. try to get all forums
$forums = array();
$cacheKey = 'bigapp_forumnav';
if (isset($_G['adminid'])) {
$cacheKey = 'bigapp_forumnav_' . $_G['adminid'];
}
loadcache($cacheKey);
$expire = 5;
if (!isset($_G['cache'][$cacheKey]) || empty($_G['cache'][$cacheKey]) || TIMESTAMP - $_G['cache'][$cacheKey]['expiration'] > $expire) {
//need update all forums from database
$sql = "SELECT f.fid, f.type, f.name, f.fup, f.status, f.threads, f.posts, f.todayposts, f.allowpostspecial, f.allowspecialonly, " . "ff.password, ff.redirect, ff.viewperm, ff.postperm, ff.threadtypes, ff.threadsorts, ff.icon, ff.description, ff.moderators FROM " . DB::table('forum_forum') . " f LEFT JOIN " . DB::table('forum_forumfield') . " ff USING(fid) WHERE f.status='1' ORDER BY f.type, f.displayorder";
$query = DB::query($sql);
while ($forum = DB::fetch($query)) {
if ($forum['redirect'] || $forum['password']) {
continue;
}
if (!$forum['viewperm'] || $forum['viewperm'] && forumperm($forum['viewperm'])) {
if ($forum['threadsorts']) {
$forum['threadsorts'] = bigapp_core::getvalues(unserialize($forum['threadsorts']), array('required', 'types'));
}
if ($forum['threadtypes']) {
$forum['threadtypes'] = unserialize($forum['threadtypes']);
$unsetthreadtype = false;
if ($_G['adminid'] == 3 && strpos($forum['moderators'], $_G['username']) === false) {
$unsetthreadtype = true;
}
if ($_G['adminid'] == 0) {
$unsetthreadtype = true;
}
if ($unsetthreadtype) {
foreach ($forum['threadtypes']['moderators'] as $k => $v) {
if (!empty($v)) {
unset($forum['threadtypes']['types'][$k]);
}
}
}
$flag = 0;
foreach ($forum['threadtypes']['types'] as $k => $v) {
if ($k == 0) {
$flag = 1;
break;
}
}
if ($flag == 1) {
krsort($forum['threadtypes']['types']);
}
$forum['threadtypes'] = bigapp_core::getvalues($forum['threadtypes'], array('required', 'types'));
}
loadforum($forum['fid'], null);
if (!empty($_G['forum']['threadtypes']) || !empty($_GET['debug'])) {
$forum['threadtypes_detail'] = $_G['forum']['threadtypes'];
unset($forum['threadtypes_detail']['types']);
foreach ($_G['forum']['threadtypes']['types'] as $typeId => $typeValue) {
$typeValue = preg_replace('/<.*?>/', '', $typeValue);
if (isset($_G['forum']['threadtypes']['moderators'][$typeId]) && !empty($_G['forum']['threadtypes']['moderators'][$typeId])) {
if (isset($_G['adminid']) && $_G['adminid'] != $_G['forum']['threadtypes']['moderators'][$typeId]) {
continue;
}
}
$forum['threadtypes_detail']['types'][] = array('typeid' => $typeId, 'typename' => $typeValue);
}
unset($forum['threadtypes_detail']['icons']);
foreach ($_G['forum']['threadtypes']['icons'] as $typeId => $icon) {
$forum['threadtypes_detail']['icons'][] = array('typeid' => $typeId, 'typeicon' => $icon);
}
}
$moderators = explode("\t", $forum['moderators']);
if (!is_array($moderators) || 0 === count($moderators)) {
$forum['moderators'] = array();
} else {
foreach ($moderators as &$_v) {
$_v = "'{$_v}'";
}
unset($_v);
//.........这里部分代码省略.........