本文整理汇总了PHP中C::m方法的典型用法代码示例。如果您正苦于以下问题:PHP C::m方法的具体用法?PHP C::m怎么用?PHP C::m使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类C
的用法示例。
在下文中一共展示了C::m方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: unset
if ($_G['setting']['bannedmessages']) {
$post['groupid'] = $users[$post['authorid']]['groupid'];
}
$postlist[$k] = $post;
}
}
unset($uids, $users);
if ($_G['group']['allowpostattach'] || $_G['group']['allowpostimage']) {
$attachlist = getattach(0);
$attachs = $attachlist['attachs'];
$imgattachs = $attachlist['imgattachs'];
unset($attachlist);
}
getgpc('infloat') ? include template('forum/post_infloat') : (include template('forum/post'));
} else {
$modpost = C::m('forum_post', $_G['tid']);
$bfmethods = $afmethods = array();
$params = array('subject' => $subject, 'message' => $message, 'special' => $special, 'extramessage' => $extramessage, 'bbcodeoff' => $_GET['bbcodeoff'], 'smileyoff' => $_GET['smileyoff'], 'htmlon' => $_GET['htmlon'], 'parseurloff' => $_GET['parseurloff'], 'usesig' => $_GET['usesig'], 'isanonymous' => $_GET['isanonymous'], 'noticetrimstr' => $_GET['noticetrimstr'], 'noticeauthor' => $_GET['noticeauthor'], 'from' => $_GET['from'], 'sechash' => $_GET['sechash'], 'geoloc' => diconv($_GET['geoloc'], 'UTF-8'));
if (!empty($_GET['trade']) && $thread['special'] == 2 && $_G['group']['allowposttrade']) {
$bfmethods[] = array('class' => 'extend_thread_trade', 'method' => 'before_newreply');
}
$attentionon = empty($_GET['attention_add']) ? 0 : 1;
$attentionoff = empty($attention_remove) ? 0 : 1;
$bfmethods[] = array('class' => 'extend_thread_rushreply', 'method' => 'before_newreply');
if ($_G['group']['allowat']) {
$bfmethods[] = array('class' => 'extend_thread_allowat', 'method' => 'before_newreply');
}
$bfmethods[] = array('class' => 'extend_thread_comment', 'method' => 'before_newreply');
$modpost->attach_before_method('newreply', array('class' => 'extend_thread_filter', 'method' => 'before_newreply'));
if ($_G['group']['allowat']) {
$afmethods[] = array('class' => 'extend_thread_allowat', 'method' => 'after_newreply');
示例2: showmessage
if (!$article['allowcomment']) {
showmessage('no_privilege_commentadd', '', array(), array('return' => true));
}
if ($article['idtype'] == 'blogid') {
$currentid = $article['id'];
$currenttype = 'blogid';
} elseif ($article['idtype'] == 'tid') {
$currentid = $article['id'];
$currenttype = 'thread';
}
}
if ($currenttype == 'thread') {
if ($commentcable[$type] == 'article') {
$_POST['portal_referer'] = $article_url ? $article_url : 'portal.php?mod=view&aid=' . $id;
}
$modpost = C::m('forum_post', $currentid);
$params = array('subject' => '', 'message' => $_POST['general']);
$modpost->newreply($params);
if ($_POST['portal_referer']) {
$redirecturl = $_POST['portal_referer'];
} else {
if ($modnewreplies) {
$redirecturl = "forum.php?mod=viewthread&tid=" . $currentid;
} else {
$redirecturl = "forum.php?mod=viewthread&tid=" . $currentid . "&pid=" . $modpost->pid . "&page=" . $modpost->param('page') . "&extra=" . $extra . "#pid" . $modpost->pid;
}
}
$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));
示例3: getgpc
getgpc('infloat') ? include template('forum/post_infloat') : (include template('forum/post'));
} else {
if ($_GET['mygroupid']) {
$mygroupid = explode('__', $_GET['mygroupid']);
$mygid = intval($mygroupid[0]);
if ($mygid) {
$mygname = $mygroupid[1];
if (count($mygroupid) > 2) {
unset($mygroupid[0]);
$mygname = implode('__', $mygroupid);
}
$message .= '[groupid=' . intval($mygid) . ']' . $mygname . '[/groupid]';
C::t('forum_forum')->update_commoncredits(intval($mygroupid[0]));
}
}
$modthread = C::m('forum_thread');
$bfmethods = $afmethods = array();
$params = array('subject' => $subject, 'message' => $message, 'typeid' => $typeid, 'sortid' => $sortid, 'special' => $special);
$_GET['save'] = $_G['uid'] ? $_GET['save'] : 0;
if ($_G['group']['allowsetpublishdate'] && $_GET['cronpublish'] && $_GET['cronpublishdate']) {
$publishdate = strtotime($_GET['cronpublishdate']);
if ($publishdate > $_G['timestamp']) {
$_GET['save'] = 1;
} else {
$publishdate = $_G['timestamp'];
}
} else {
$publishdate = $_G['timestamp'];
}
$params['publishdate'] = $publishdate;
$params['save'] = $_GET['save'];
示例4: template
$imgattachs['unused'] = !$sortid ? $imgattachs['unused'] : '';
include template('forum/post');
} else {
if ($_GET['mygroupid']) {
$mygroupid = explode('__', $_GET['mygroupid']);
$mygid = intval($mygroupid[0]);
if ($mygid) {
$mygname = $mygroupid[1];
if (count($mygroupid) > 2) {
unset($mygroupid[0]);
$mygname = implode('__', $mygroupid);
}
$message .= '[groupid=' . intval($mygid) . ']' . $mygname . '[/groupid]';
}
}
$modpost = C::m('forum_post', $_G['tid'], $pid);
$modpost->param('redirecturl', "forum.php?mod=viewthread&tid={$_G['tid']}&page={$_GET['page']}&extra={$extra}" . ($vid && $isfirstpost ? "&vid={$vid}" : '') . "#pid{$pid}");
if (empty($_GET['delete'])) {
if ($isfirstpost) {
if ($thread['special'] == 1 && ($_G['group']['alloweditpoll'] || $isorigauthor) && !empty($_GET['polls'])) {
} elseif ($thread['special'] == 3 && $isorigauthor) {
} elseif ($thread['special'] == 4 && $_G['group']['allowpostactivity']) {
} elseif ($thread['special'] == 5 && $_G['group']['allowpostdebate']) {
} elseif ($specialextra) {
@(include_once DISCUZ_ROOT . './source/plugin/' . $_G['setting']['threadplugins'][$specialextra]['module'] . '.class.php');
$classname = 'threadplugin_' . $specialextra;
if (class_exists($classname) && method_exists($threadpluginclass = new $classname(), 'editpost_submit')) {
$threadpluginclass->editpost_submit($_G['fid'], $_G['tid']);
}
}
} else {