本文整理汇总了PHP中discuzcode函数的典型用法代码示例。如果您正苦于以下问题:PHP discuzcode函数的具体用法?PHP discuzcode怎么用?PHP discuzcode使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了discuzcode函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: processCollectionData
function processCollectionData($collection, $tf = array(), $orderby = '')
{
if (count($collection) <= 0) {
return array();
}
require_once libfile('function/discuzcode');
foreach ($collection as $ctid => &$curvalue) {
$curvalue['updated'] = $curvalue['lastupdate'] > $tf[$ctid]['lastvisit'] ? 1 : 0;
$curvalue['tflastvisit'] = $tf[$ctid]['lastvisit'];
$curvalue['lastupdate'] = dgmdate($curvalue['lastupdate']);
$curvalue['dateline'] = dgmdate($curvalue['dateline']);
$curvalue['lastposttime'] = dgmdate($curvalue['lastposttime']);
$curvalue['avgrate'] = number_format($curvalue['rate'], 1);
$curvalue['star'] = imgdisplayrate($curvalue['rate']);
$curvalue['lastposterhtml'] = rawurlencode($curvalue['lastposter']);
$curvalue['shortdesc'] = cutstr(strip_tags(discuzcode($curvalue['desc'])), 50);
$curvalue['arraykeyword'] = parse_keyword($curvalue['keyword'], false, false);
if ($curvalue['arraykeyword']) {
foreach ($curvalue['arraykeyword'] as $kid => $s_keyword) {
$curvalue['urlkeyword'][$kid] = rawurlencode($s_keyword);
}
}
if ($orderby == 'commentnum') {
$curvalue['displaynum'] = $curvalue['commentnum'];
} elseif ($orderby == 'follownum') {
$curvalue['displaynum'] = $curvalue['follownum'];
} else {
$curvalue['displaynum'] = $curvalue['threadnum'];
}
}
return $collection;
}
示例2: 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));
}
示例3: viewthread_modoption
public function viewthread_modoption()
{
global $_G;
if (!$_G['adminid']) {
return false;
}
$usergroupsfeedlist = unserialize($_G['setting']['qqgroup_usergroup_feed_list']);
if (empty($usergroupsfeedlist) || !in_array($_G['groupid'], $usergroupsfeedlist)) {
if (self::$util->isfounder($_G['member']) == false) {
return false;
}
}
$tid = $_G['tid'];
$title = urlencode(trim($_G['forum_thread']['subject']));
$post = C::t('forum_post')->fetch_all_by_tid_position($_G['fotum_thread']['posttableid'], $_G['tid'], 1);
include_once libfile('function/discuzcode');
$content = preg_replace("/\\[audio(=1)*\\]\\s*([^\\[\\<\r\n]+?)\\s*\\[\\/audio\\]/ies", '', trim($post[0]['message']));
$content = preg_replace("/\\[flash(=(\\d+),(\\d+))?\\]\\s*([^\\[\\<\r\n]+?)\\s*\\[\\/flash\\]/ies", '', $content);
$content = preg_replace("/\\[media=([\\w,]+)\\]\\s*([^\\[\\<\r\n]+?)\\s*\\[\\/media\\]/ies", '', $content);
$content = preg_replace("/\\[hide[=]?(d\\d+)?[,]?(\\d+)?\\]\\s*(.*?)\\s*\\[\\/hide\\]/is", '', $content);
$content = strip_tags(discuzcode($content, 0, 0, 0));
$content = preg_replace('%\\[attach\\].*\\[/attach\\]%im', '', $content);
$content = str_replace(' ', ' ', $content);
$content = urlencode(cutstr($content, 50, ''));
include template('qqgroup:push');
return trim($return);
}
示例4: _getAnnouncementInfo
private function _getAnnouncementInfo($res, $id)
{
global $_G;
require_once libfile('function/discuzcode');
$announce = DzForumAnnouncement::getAnnouncementByUid($id);
if (!count($announce)) {
$res = $this->makeErrorInfo($res, 'announcement_nonexistence');
} else {
$tempAnnounce = array();
$tempAnnounce['author'] = $announce['author'];
$tmp = explode('.', dgmdate($announce['starttime'], 'Y.m'));
$months[$tmp[0] . $tmp[1]] = $tmp;
if (!empty($_GET['m']) && $_GET['m'] != dgmdate($announce['starttime'], 'Ym')) {
continue;
}
$tempAnnounce['starttime'] = dgmdate($announce['starttime'], 'd');
$tempAnnounce['endtime'] = $announce['endtime'] ? dgmdate($announce['endtime'], 'd') : '';
$tempAnnounce['title'] = WebUtils::emptyHtml($announce['subject']);
$uid = DzCommonMember::getUidByUsername($announce['author']);
$tempAnnounce['icon'] = UserUtils::getUserAvatar($uid);
$announceMessage = $announce['type'] == 1 ? "{$announce[message]}" : $announceMessage;
$announceMessage = nl2br(discuzcode($announce['message'], 0, 0, 1, 1, 1, 1, 1));
$announceType = array();
$announceType['infor'] = WebUtils::emptyHtml($announceMessage);
$announce['type'] == 1 ? $announceType['type'] = 'url' : ($announceType['type'] = 'text');
$tempAnnounce['content'] = $announceType;
$res['body']['list'] = $tempAnnounce;
}
return $res;
}
示例5: output
function output()
{
global $_G;
//帖子列表增加图片 -start
require_once libfile('function/discuzcode');
foreach ($GLOBALS['data']['my']['threadlist'] as $k => $thread) {
$post = C::t('forum_post')->fetch_threadpost_by_tid_invisible($GLOBALS['data']['my']['threadlist'][$k]['tid'], 0);
$attachment[$post['pid']] = array();
$GLOBALS['data']['my']['threadlist'][$k]['pid'] = $post['pid'];
//TODO:下面的代码直接调用discuzcode时,会报错
//./source/plugin/mobile/template/discuzcode.htm 文件不存在
//cp ./source/plugin/mobile/template/mobile/discuzcode.htm ./source/plugin/mobile/template/
//拷贝一份就可以了,原因未查明
$GLOBALS['data']['my']['threadlist'][$k]['message'] = discuzcode($post['message']);
//附件,0无附件 1普通附件 2有图片附件
if (!empty($post['attachment']) && intval($post['attachment']) == 2) {
$GLOBALS['data']['my']['threadlist'][$k]['attachments'] = array();
$GLOBALS['data']['my']['threadlist'][$k]['imagelist'] = array();
require_once libfile('function/attachment');
$_G['tid'] = $post['tid'];
parseattach(array_keys($attachment), array(), $attachment);
$GLOBALS['data']['my']['threadlist'][$k]['attachments'] = $attachment[$post['pid']]['attachments'];
$GLOBALS['data']['my']['threadlist'][$k]['imagelist'] = $attachment[$post['pid']]['imagelist'];
unset($_G['tid']);
}
}
//帖子列表增加图片 -end
$data['forumnames'] = $GLOBALS['data']['my']['forumnames'];
$data['threadcount'] = $GLOBALS['data']['my']['threadcount'];
$data['threadlist'] = array_values($GLOBALS['data']['my']['threadlist']);
$variable = array('data' => $data, 'perpage' => $GLOBALS['perpage']);
mobile_core::result(mobile_core::variable($variable));
}
示例6: fetch_thread_replies
public function fetch_thread_replies($count, $tid)
{
require_once libfile('function/discuzcode');
require_once './source/plugin/singcere_waterfall/singcere_waterfall.func.php';
$list = array();
$query = DB::query("SELECT * FROM %t WHERE first != 1 AND tid = %d AND invisible >= 0 ORDER BY dateline DESC LIMIT 0, %d", array('forum_post', $tid, $count));
while (($result = DB::fetch($query)) != false) {
preg_match_all("/\\[attach\\](\\d+)\\[\\/attach\\]/i", $result['message'], $matchaids);
$attachs = parseattach($result['tid'], $result['pid'], $matchaids, $result['message'], $skipaids);
$k = $result['message'] = preg_replace("/\\[attach\\](\\d+)\\[\\/attach\\]/ ", "\$attachs[\\1]", $result['message']);
eval("\$k=\"{$k}\";");
$k = discuzcode($k, FALSE, FALSE);
$result['message'] = $k;
$result['message'] = html2txt($result['message']);
$list[] = $result;
}
return $list;
}
示例7: _check_post_length
private function _check_post_length($message, $length)
{
if ($this->param['special'] || $this->thread['special'] || getstatus($this->thread['status'], 3) || !$length) {
return 0;
}
require_once libfile('function/discuzcode');
$langthread = lang('forum/thread');
$content = discuzcode($message);
$content = strip_tags($content);
$content = str_replace(array(',', '.', '?', '!', $langthread['t_question'], $langthread['t_exclamatory'], $langthread['t_period'], $langthread['t_comma'], '~', $langthread['t_suspension']), '', $content);
$content = preg_replace('/\\s+/', '', $content);
$realLength = dstrlen($content);
$checkQuote = preg_match("/\\s?\\[quote\\][\n\r]*(.+?)[\n\r]*\\[\\/quote\\]\\s?/is", $message) > 0 || preg_match("/\\[img=(\\d{1,4})[x|\\,](\\d{1,4})\\]\\s*([^\\[\\<\r\n]+?)\\s*\\[\\/img\\]/i", $message) > 0 || preg_match("/\\[img\\]\\s*([^\\[\\<\r\n]+?)\\s*\\[\\/img\\]/i", $message) > 0 || preg_match("/\\[attach\\](\\d+)\\[\\/attach\\]/i", $message) > 0;
if ($checkQuote || $realLength >= $length) {
return $realLength <= 0 ? 1 : $realLength;
} else {
return 0;
}
}
示例8: get_menu_foot
function get_menu_foot($brandresult)
{
global $_G;
$bid = $brandresult['bid'];
$tid = $brandresult['tid'];
$perpage = 5;
$page = intval($_G[sr_page]);
$page = max(1, intval($page));
$start = ($page - 1) * $perpage;
$start = max(0, $start);
require_once libfile('function/discuzcode');
$count = C::t('#sanree_brand#forum_post')->count_by_tid_post(0, $tid);
if ($count > 0) {
$postthread = C::t('#sanree_brand#forum_post')->fetch_all_by_tid(0, $tid, true, ' desc', ($page - 1) * $perpage, $perpage, 0, 0);
foreach ($postthread as $key => $val) {
$postthread[$key]['message'] = discuzcode($val['message'], 0, 0, 0, 1);
$postthread[$key]['satisfaction'] = C::t('#sanree_brand#sanree_brand_voterlog')->getstar_by_tid_uid($val['authorid'], $tid) * 20;
$postthread[$key]['dateline'] = dgmdate($val['dateline']);
$postthread[$key]['img'] = avatar($val['authorid'], 'middle', 1);
}
$murl = $_G['item_detail'] == 'item' ? $is_rewrite ? getburl($brandresult) . '?t' . $extra : getburl($brandresult) . $extra : ($is_rewrite ? getdetailurl($brandresult) . '?t' . $extra : getdetailurl($brandresult) . $extra);
$multi = multi($count, $perpage, $page, $murl);
}
$satisfaction = C::t('#sanree_brand#sanree_brand_voterlog')->getstar_by_tid_uid($_G['uid'], $tid) * 20;
$seditor = array('fastpost', array('bold', 'color', 'link', 'quote', 'smilies'));
$selfimg = avatar($_G['uid'], 'middle', 1);
$wx_prefix = $_G['setting']['attachurl'] . 'category/';
$appVer = $_G['setting']['version'];
$dzv = array('X3.2', 'X3.1');
if (in_array($appVer, $dzv)) {
list($seccodecheck) = seccheck('publish');
$dzvflag = true;
$sectpl = '<div class="rfm"><table><tr><th><sec>: </th><td><span id="sec<hash>" onclick="showMenu({\'ctrlid\':\'sec<hash>\',\'pos\':\'*\'})"><sec></span><br /><div id="sec<hash>_menu" class="p_pop p_opt" style="display:none"><sec></div></td></tr></table></div>';
} else {
$seccodecheck = $_G['setting']['seccodestatus'] & 4 && (!$_G['setting']['seccodedata']['minposts'] || getuserprofile('posts') < $_G['setting']['seccodedata']['minposts']);
$secqaacheck = $_G['setting']['secqaa']['status'] & 2 && (!$_G['setting']['secqaa']['minposts'] || getuserprofile('posts') < $_G['setting']['secqaa']['minposts']);
$dzvflag = false;
}
include templateEx($this->_identifier . ':' . $this->_template . '/srfoot');
$GLOBALS['srfoot'] = $srfoot;
}
示例9: viewthread_procpost
//.........这里部分代码省略.........
$post['warned'] = ($post['status'] & 2) >> 1;
} else {
if (!$post['authorid']) {
$post['useip'] = substr($post['useip'], 0, strrpos($post['useip'], '.')) . '.x';
}
}
$post['attachments'] = array();
$post['imagelist'] = $post['attachlist'] = '';
if ($post['attachment']) {
if (!empty($_G['setting']['guestviewthumb']['flag']) && !$_G['uid'] || $_G['group']['allowgetattach'] || $_G['group']['allowgetimage']) {
$_G['forum_attachpids'][] = $post['pid'];
$post['attachment'] = 0;
if (preg_match_all("/\\[attach\\](\\d+)\\[\\/attach\\]/i", $post['message'], $matchaids)) {
$_G['forum_attachtags'][$post['pid']] = $matchaids[1];
}
} else {
$post['message'] = preg_replace("/\\[attach\\](\\d+)\\[\\/attach\\]/i", '', $post['message']);
}
}
if ($_G['setting']['ratelogrecord'] && $post['ratetimes']) {
$_G['forum_cachepid'][$post['pid']] = $post['pid'];
}
if ($_G['setting']['commentnumber'] && ($post['first'] && $_G['setting']['commentfirstpost'] || !$post['first']) && $post['comment']) {
$_G['forum_cachepid'][$post['pid']] = $post['pid'];
}
$post['allowcomment'] = $_G['setting']['commentnumber'] && in_array(1, $_G['setting']['allowpostcomment']) && ($_G['setting']['commentpostself'] || $post['authorid'] != $_G['uid']) && ($post['first'] && $_G['setting']['commentfirstpost'] && in_array($_G['group']['allowcommentpost'], array(1, 3)) || !$post['first'] && in_array($_G['group']['allowcommentpost'], array(2, 3)));
$forum_allowbbcode = $_G['forum']['allowbbcode'] ? -$post['groupid'] : 0;
$post['signature'] = $post['usesig'] ? $_G['setting']['sigviewcond'] ? strlen($post['message']) > $_G['setting']['sigviewcond'] ? $post['signature'] : '' : $post['signature'] : '';
$imgcontent = $post['first'] ? getstatus($_G['forum_thread']['status'], 15) : 0;
if (!defined('IN_ARCHIVER')) {
if ($post['first']) {
if (!defined('IN_MOBILE')) {
$messageindex = false;
if (strpos($post['message'], '[/index]') !== FALSE) {
$post['message'] = preg_replace("/\\s?\\[index\\](.+?)\\[\\/index\\]\\s?/ies", "parseindex('\\1', '{$post['pid']}')", $post['message']);
$messageindex = true;
unset($_GET['threadindex']);
}
if (strpos($post['message'], '[page]') !== FALSE) {
if ($_GET['cp'] != 'all') {
$postbg = '';
if (strpos($post['message'], '[/postbg]') !== FALSE) {
preg_match("/\\s?\\[postbg\\]\\s*([^\\[\\<\r\n;'\"\\?\\(\\)]+?)\\s*\\[\\/postbg\\]\\s?/is", $post['message'], $r);
$postbg = $r[0];
}
$messagearray = explode('[page]', $post['message']);
$cp = max(intval($_GET['cp']), 1);
$post['message'] = $messagearray[$cp - 1];
if ($postbg && strpos($post['message'], '[/postbg]') === FALSE) {
$post['message'] = $postbg . $post['message'];
}
unset($postbg);
} else {
$cp = 0;
$post['message'] = preg_replace("/\\s?\\[page\\]\\s?/is", '', $post['message']);
}
if ($_GET['cp'] != 'all' && strpos($post['message'], '[/index]') === FALSE && empty($_GET['threadindex']) && !$messageindex) {
$_G['forum_posthtml']['footer'][$post['pid']] .= '<div id="threadpage"></div><script type="text/javascript" reload="1">show_threadpage(' . $post['pid'] . ', ' . $cp . ', ' . count($messagearray) . ', ' . ($_GET['from'] == 'preview' ? '1' : '0') . ');</script>';
}
}
}
}
if (!empty($_GET['threadindex'])) {
$_G['forum_posthtml']['header'][$post['pid']] .= '<div id="threadindex"></div><script type="text/javascript" reload="1">show_threadindex(0, ' . ($_GET['from'] == 'preview' ? '1' : '0') . ');</script>';
}
if (!$imgcontent) {
$post['message'] = discuzcode($post['message'], $post['smileyoff'], $post['bbcodeoff'], $post['htmlon'] & 1, $_G['forum']['allowsmilies'], $forum_allowbbcode, $_G['forum']['allowimgcode'] && $_G['setting']['showimages'] ? 1 : 0, $_G['forum']['allowhtml'], $_G['forum']['jammer'] && $post['authorid'] != $_G['uid'] ? 1 : 0, 0, $post['authorid'], $_G['cache']['usergroups'][$post['groupid']]['allowmediacode'] && $_G['forum']['allowmediacode'], $post['pid'], $_G['setting']['lazyload'], $post['dbdateline'], $post['first']);
if ($post['first']) {
$_G['relatedlinks'] = '';
$relatedtype = !$_G['forum_thread']['isgroup'] ? 'forum' : 'group';
if (!$_G['setting']['relatedlinkstatus']) {
$_G['relatedlinks'] = get_related_link($relatedtype);
} else {
$post['message'] = parse_related_link($post['message'], $relatedtype);
}
if (strpos($post['message'], '[/begin]') !== FALSE) {
$post['message'] = preg_replace("/\\[begin(=\\s*([^\\[\\<\r\n]*?)\\s*,(\\d*),(\\d*),(\\d*),(\\d*))?\\]\\s*([^\\[\\<\r\n]+?)\\s*\\[\\/begin\\]/ies", $_G['cache']['usergroups'][$post['groupid']]['allowbegincode'] ? "parsebegin('\\2', '\\7', '\\3', '\\4', '\\5', '\\6');" : '', $post['message']);
}
}
}
}
if (defined('IN_ARCHIVER') || defined('IN_MOBILE') || !$post['first']) {
if (strpos($post['message'], '[page]') !== FALSE) {
$post['message'] = preg_replace("/\\s?\\[page\\]\\s?/is", '', $post['message']);
}
if (strpos($post['message'], '[/index]') !== FALSE) {
$post['message'] = preg_replace("/\\s?\\[index\\](.+?)\\[\\/index\\]\\s?/is", '', $post['message']);
}
if (strpos($post['message'], '[/begin]') !== FALSE) {
$post['message'] = preg_replace("/\\[begin(=\\s*([^\\[\\<\r\n]*?)\\s*,(\\d*),(\\d*),(\\d*),(\\d*))?\\]\\s*([^\\[\\<\r\n]+?)\\s*\\[\\/begin\\]/ies", '', $post['message']);
}
}
if ($imgcontent) {
$post['message'] = '<img id="threadimgcontent" src="./' . stringtopic('', $post['tid']) . '">';
}
$_G['forum_firstpid'] = intval($_G['forum_firstpid']);
$post['numbercard'] = viewthread_numbercard($post);
$post['mobiletype'] = getstatus($post['status'], 4) ? base_convert(getstatus($post['status'], 10) . getstatus($post['status'], 9) . getstatus($post['status'], 8), 2, 10) : 0;
return $post;
}
示例10: random
$groupicon = '<input type="checkbox" class="checkbox" name="deleteicon" value="yes" /> ' . $lang['delete'] . '<br /><img src="' . $groupicon . '?' . random(6) . '" width="48" height="48" />';
}
if ($groupbanner) {
$groupbanner = '<input type="checkbox" class="checkbox" name="deletebanner" value="yes" /> ' . $lang['delete'] . '<br /><img src="' . $groupbanner . '?' . random(6) . '" />';
}
showsetting('groups_editgroup_icon', 'iconnew', '', 'file', '', 0, $groupicon);
showsetting('groups_editgroup_banner', 'bannernew', '', 'file', '', 0, $groupbanner);
showsubmit('editsubmit');
showtablefooter();
showformfooter();
} else {
$_GET['jointypenew'] = intval($_GET['jointypenew']);
$_GET['fupnew'] = intval($_GET['fupnew']);
$_GET['gviewpermnew'] = intval($_GET['gviewpermnew']);
require_once libfile('function/discuzcode');
$_GET['descriptionnew'] = discuzcode(dhtmlspecialchars(censor(trim($_GET['descriptionnew']))), 0, 0, 0, 0, 1, 1, 0, 0, 1);
$_GET['namenew'] = dhtmlspecialchars(censor(trim($_GET['namenew'])));
$icondata = array();
$iconnew = upload_icon_banner($group, $_FILES['iconnew'], 'icon');
$bannernew = upload_icon_banner($group, $_FILES['bannernew'], 'banner');
if ($iconnew) {
$icondata['icon'] = $iconnew;
}
if ($bannernew) {
$icondata['banner'] = $bannernew;
}
if ($_GET['deleteicon']) {
@unlink($_G['setting']['attachurl'] . 'group/' . $group['icon']);
$icondata['icon'] = '';
}
if ($_GET['deletebanner']) {
示例11: portalcp_get_postmessage
function portalcp_get_postmessage($post, $getauthorall = '')
{
global $_G;
$forum = C::t('forum_forum')->fetch($post['fid']);
require_once libfile('function/discuzcode');
$language = lang('forum/misc');
if ($forum['type'] == 'sub' && $forum['status'] == 3) {
loadcache('grouplevels');
$grouplevel = $_G['grouplevels'][$forum['level']];
$group_postpolicy = $grouplevel['postpolicy'];
if (is_array($group_postpolicy)) {
$forum = array_merge($forum, $group_postpolicy);
}
}
$post['message'] = preg_replace($language['post_edit_regexp'], '', $post['message']);
$_message = '';
if ($getauthorall) {
foreach (C::t('forum_post')->fetch_all_by_tid('tid:' . $post['tid'], $post['tid'], true, '', 0, 0, null, null, $post['authorid']) as $value) {
if (!$value['first']) {
$value['message'] = preg_replace("/\\s?\\[quote\\][\n\r]*(.+?)[\n\r]*\\[\\/quote\\]\\s?/is", '', $value['message']);
$value['message'] = discuzcode($value['message'], $value['smileyoff'], $value['bbcodeoff'], $value['htmlon'] & 1, $forum['allowsmilies'], $forum['allowbbcode'], $forum['allowimgcode'] && $_G['setting']['showimages'] ? 1 : 0, $forum['allowhtml'], 0, 0, $value['authorid'], $forum['allowmediacode'], $value['pid']);
portalcp_parse_postattch($value);
$_message .= '<br /><br />' . $value['message'];
}
}
}
$msglower = strtolower($post['message']);
if (strpos($msglower, '[/media]') !== FALSE) {
$post['message'] = preg_replace("/\\[media=([\\w,]+)\\]\\s*([^\\[\\<\r\n]+?)\\s*\\[\\/media\\]/ies", "parsearticlemedia('\\1', '\\2')", $post['message']);
}
if (strpos($msglower, '[/audio]') !== FALSE) {
$post['message'] = preg_replace("/\\[audio(=1)*\\]\\s*([^\\[\\<\r\n]+?)\\s*\\[\\/audio\\]/ies", "parsearticlemedia('mid,0,0', '\\2')", $post['message']);
}
if (strpos($msglower, '[/flash]') !== FALSE) {
$post['message'] = preg_replace("/\\[flash(=(\\d+),(\\d+))?\\]\\s*([^\\[\\<\r\n]+?)\\s*\\[\\/flash\\]/ies", "parsearticlemedia('swf,0,0', '\\4');", $post['message']);
}
$post['message'] = discuzcode($post['message'], $post['smileyoff'], $post['bbcodeoff'], $post['htmlon'] & 1, $forum['allowsmilies'], $forum['allowbbcode'], $forum['allowimgcode'] && $_G['setting']['showimages'] ? 1 : 0, $forum['allowhtml'], 0, 0, $post['authorid'], $forum['allowmediacode'], $post['pid']);
portalcp_parse_postattch($post);
if (strpos($post['message'], '[/flash1]') !== FALSE) {
$post['message'] = str_replace('[/flash1]', '[/flash]', $post['message']);
}
return $post['message'] . $_message;
}
示例12: elseif
$prepage = $pager - 1;
}
if ($pager * $pagenum < $counts) {
$nextpage = $pager + 1;
}
} elseif ($mobile_action == "mobile_view") {
$info_id = intval($_G['gp_info_id']);
if ($info_id) {
$info = DB::fetch_first("SELECT * FROM " . DB::table('forum_alliance_ar') . " where id={$info_id}");
if ($info) {
$xianzai = gmdate('Y-m-d', $_G['timestamp'] + $_G['setting']['timeoffset'] * 3600);
$info['dateline'] = gmdate('Y-m-d', $info['dateline'] + $_G['setting']['timeoffset'] * 3600);
if ($info['dateline'] == $xianzai) {
$info['dateline'] = $php_lang['jintian'];
}
$info['summary'] = discuzcode($info['summary'], 1, 0, 0, 0, 1, 1, 0, 0, 1);
//discuzcode($mythread['summary']);
$navtitle = $info['title'];
if ($puseo == 1) {
$metakeywords = $info['keywords'];
$metadescription = $info['description'];
} elseif ($info['click'] == 1) {
$metakeywords = $info['keywords'];
$metadescription = $info['description'];
}
$info['fl'] = $listclass[$info['cid']];
if (round($info[total] / $info[voter], 1) != 0) {
$info[tvs] = "<em>" . round($info[total] / $info[voter] + $info[bonus], 1) . "</em> " . $php_lang['homefen'];
} else {
$info[tvs] = $php_lang['zanwupfen'];
}
示例13: notifymembers
//.........这里部分代码省略.........
foreach ($query as $row) {
$uparray[] = $row['uid'];
}
if ($uparray) {
C::t('common_member_magic')->increase($uparray, $magicid, array('num' => $magicnum[$magicid]));
}
$insarray = array_diff($uids, $uparray);
if ($insarray) {
$sqls = array();
foreach ($insarray as $uid) {
C::t('common_member_magic')->insert(array('uid' => $uid, 'magicid' => $magicid, 'num' => $magicnum[$magicid]));
}
}
foreach ($uids as $uid) {
updatemagiclog($magicid, '3', $magicnum[$magicid], '', $uid);
}
}
if (count($uids) < $limit) {
break;
}
}
}
}
C::t('common_setting')->update($variable, array('subject' => $subject, 'message' => $message));
}
$pertask = intval($_GET['pertask']);
$current = $_GET['current'] ? intval($_GET['current']) : 0;
$continue = FALSE;
if (!function_exists('sendmail')) {
include libfile('function/mail');
}
if ($_GET['notifymember'] && in_array($_GET['notifymembers'], array('pm', 'notice', 'email', 'mobile'))) {
$uids = searchmembers($search_condition, $pertask, $current);
require_once libfile('function/discuzcode');
$message = in_array($_GET['notifymembers'], array('email', 'notice')) && $_GET['posttype'] ? discuzcode($message, 1, 0, 1, '', '', '', 1) : discuzcode($message, 1, 0);
$pmuids = array();
if ($_GET['notifymembers'] == 'pm') {
$membernum = countmembers($search_condition, $urladd);
$gpmid = $_GET['gpmid'];
if (!$gpmid) {
$pmdata = array('authorid' => $_G['uid'], 'author' => !$_GET['system'] ? $_G['member']['username'] : '', 'dateline' => TIMESTAMP, 'message' => ($subject ? '<b>' . $subject . '</b><br /> ' : '') . $message . $addmsg, 'numbers' => $membernum);
$gpmid = C::t('common_grouppm')->insert($pmdata, true);
}
$urladd .= '&gpmid=' . $gpmid;
}
$members = C::t('common_member')->fetch_all($uids);
if ($_GET['notifymembers'] == 'mobile') {
$toUids = array_keys($members);
if ($_G['setting']['cloud_status'] && !empty($toUids)) {
try {
$noticeService = Cloud::loadClass('Service_Client_Notification');
$fromType = $_GET['system'] ? 1 : 2;
$noticeService->addSiteMasterUserNotify($toUids, $subject, $message, $_G['uid'], $_G['username'], $fromType, TIMESTAMP);
} catch (Cloud_Service_Client_RestfulException $e) {
cpmsg('[' . $e->getCode() . ']' . $e->getMessage(), '', 'error');
}
}
} else {
foreach ($members as $member) {
if ($_GET['notifymembers'] == 'pm') {
C::t('common_member_grouppm')->insert(array('uid' => $member['uid'], 'gpmid' => $gpmid, 'status' => 0), false, true);
$newpm = setstatus(2, 1, $member['newpm']);
C::t('common_member')->update($member['uid'], array('newpm' => $newpm));
} elseif ($_GET['notifymembers'] == 'notice') {
notification_add($member['uid'], 'system', 'system_notice', array('subject' => $subject, 'message' => $message . $addmsg, 'from_id' => 0, 'from_idtype' => 'sendnotice'), 1);
} elseif ($_GET['notifymembers'] == 'email') {
示例14: array
if ($_G['setting']['bannedmessages']) {
$uids = array();
foreach ($postlist as $post) {
$uids[] = $post['authorid'];
}
$users = C::t('common_member')->fetch_all($uids);
}
foreach ($postlist as $k => $post) {
$post['dateline'] = dgmdate($post['dateline'], 'u');
if ($_G['setting']['bannedmessages'] && ($post['authorid'] && (!$post['groupid'] || $post['groupid'] == 4 || $post['groupid'] == 5))) {
$post['message'] = $language['post_banned'];
} elseif ($post['status'] & 1) {
$post['message'] = $language['post_single_banned'];
} else {
$post['message'] = preg_replace("/\\[hide=?\\d*\\](.*?)\\[\\/hide\\]/is", "[b]{$language['post_hidden']}[/b]", $post['message']);
$post['message'] = discuzcode($post['message'], $post['smileyoff'], $post['bbcodeoff'], $post['htmlon'] & 1, $_G['forum']['allowsmilies'], $_G['forum']['allowbbcode'], $_G['forum']['allowimgcode'], $_G['forum']['allowhtml'], $_G['forum']['jammer']);
}
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'));
示例15: max
$page = max(1, intval($_GET['page']));
$start_limit = ($page - 1) * $_G['tpp'];
$index = C::t('common_searchindex')->fetch_by_searchid_srchmod($searchid, $srchmod);
if (!$index) {
showmessage('search_id_invalid');
}
$keyword = dhtmlspecialchars($index['keywords']);
$keyword = $keyword != '' ? str_replace('+', ' ', $keyword) : '';
$index['keywords'] = rawurlencode($index['keywords']);
require_once libfile('function/discuzcode');
$collectionlist = array();
$maxcollection = $nowcollection = 0;
$query = C::t('forum_collection')->fetch_all(explode(',', $index['ids']), $orderby, $ascdesc, $start_limit, $_G['tpp']);
foreach ($query as $value) {
$value['lastupdate'] = dgmdate($value['lastupdate']);
$value['shortdesc'] = cutstr(strip_tags(discuzcode($value['desc'])), 50);
$value['name'] = bat_highlight($value['name'], $keyword);
$collectionlist[$value['ctid']] = $value;
}
$multipage = multi($index['num'], $_G['tpp'], $page, "search.php?mod=collection&searchid={$searchid}&orderby={$orderby}&ascdesc={$ascdesc}&searchsubmit=yes");
$url_forward = 'search.php?mod=collection&' . $_SERVER['QUERY_STRING'];
include template('search/collection');
} else {
$searchstring = 'collection|title|' . addslashes($srchtxt);
$searchindex = array('id' => 0, 'dateline' => '0');
foreach (C::t('common_searchindex')->fetch_all_search($_G['setting']['search']['collection']['searchctrl'], $_G['clientip'], $_G['uid'], $_G['timestamp'], $searchstring, $srchmod) as $index) {
if ($index['indexvalid'] && $index['dateline'] > $searchindex['dateline']) {
$searchindex = array('id' => $index['searchid'], 'dateline' => $index['dateline']);
break;
} elseif ($_G['adminid'] != '1' && $index['flood']) {
showmessage('search_ctrl', 'search.php?mod=collection', array('searchctrl' => $_G['setting']['search']['collection']['searchctrl']));