本文整理汇总了PHP中messagecutstr函数的典型用法代码示例。如果您正苦于以下问题:PHP messagecutstr函数的具体用法?PHP messagecutstr怎么用?PHP messagecutstr使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了messagecutstr函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: build_cache_heats
function build_cache_heats()
{
global $_G;
$data = array();
if ($_G['setting']['indexhot']['status']) {
require_once libfile('function/post');
$_G['setting']['indexhot'] = array('status' => 1, 'limit' => intval($_G['setting']['indexhot']['limit'] ? $_G['setting']['indexhot']['limit'] : 10), 'days' => intval($_G['setting']['indexhot']['days'] ? $_G['setting']['indexhot']['days'] : 7), 'expiration' => intval($_G['setting']['indexhot']['expiration'] ? $_G['setting']['indexhot']['expiration'] : 900), 'messagecut' => intval($_G['setting']['indexhot']['messagecut'] ? $_G['setting']['indexhot']['messagecut'] : 200));
$heatdateline = TIMESTAMP - 86400 * $_G['setting']['indexhot']['days'];
$query = DB::query("SELECT t.tid,t.posttableid,t.views,t.dateline,t.replies,t.author,t.authorid,t.subject,t.price\r\n\t\t\tFROM " . DB::table('forum_thread') . " t\r\n\t\t\tWHERE t.dateline>'{$heatdateline}' AND t.heats>'0' AND t.displayorder>='0' ORDER BY t.heats DESC LIMIT " . $_G['setting']['indexhot']['limit'] * 2);
$messageitems = 2;
$limit = $_G['setting']['indexhot']['limit'];
while ($heat = DB::fetch($query)) {
$posttable = $heat['posttableid'] ? "forum_post_{$heat['posttableid']}" : 'forum_post';
$post = DB::fetch_first("SELECT p.pid, p.message FROM " . DB::table($posttable) . " p WHERE p.tid='{$heat['tid']}' AND p.first='1'");
$heat = array_merge($heat, (array) $post);
if ($limit == 0) {
break;
}
if ($messageitems > 0) {
$heat['message'] = !$heat['price'] ? messagecutstr($heat['message'], $_G['setting']['indexhot']['messagecut']) : '';
$data['message'][$heat['tid']] = $heat;
} else {
unset($heat['message']);
$data['subject'][$heat['tid']] = $heat;
}
$messageitems--;
$limit--;
}
$data['expiration'] = TIMESTAMP + $_G['setting']['indexhot']['expiration'];
}
save_syscache('heats', $data);
}
开发者ID:v998,项目名称:discuzx-en,代码行数:32,代码来源:cache_heats.php
示例2: updatersscache
function updatersscache($num)
{
global $_G;
$processname = 'portal_rss_cache';
if (discuz_process::islocked($processname, 600)) {
return false;
}
C::t('portal_rsscache')->truncate();
require_once libfile('function/post');
foreach ($_G['cache']['portalcategory'] as $catid => $catarray) {
$query = C::t('portal_article_title')->fetch_all_for_cat($catid, 0, 1, 0, $num);
$catarray['catname'] = addslashes($catarray['catname']);
foreach ($query as $article) {
$article['author'] = $article['author'] != '' ? addslashes($article['author']) : ($article['username'] ? addslashes($article['username']) : 'Anonymous');
$article['title'] = addslashes($article['title']);
$articleattach = C::t('portal_attachment')->fetch_by_aid_image($article['aid']);
$attachdata = '';
if (!empty($articleattach)) {
$attachdata = "\t" . $articleattach['remote'] . "\t" . $articleattach['attachment'] . "\t" . $articleattach['filesize'];
}
$article['description'] = addslashes(messagecutstr($article['summary'], 250 - strlen($attachdata)) . $attachdata);
C::t('portal_rsscache')->insert(array('lastupdate' => $_G['timestamp'], 'catid' => $catid, 'aid' => $article['aid'], 'dateline' => $article['dateline'], 'catname' => $catarray['catname'], 'author' => $article['author'], 'subject' => $article['title'], 'description' => $article['description']));
}
}
discuz_process::unlock($processname);
return true;
}
开发者ID:MCHacker,项目名称:discuz-docker,代码行数:27,代码来源:portal_rss.php
示例3: build_cache_heats
function build_cache_heats()
{
global $_G;
$addsql = '';
$data = array();
if (discuz_process::islocked('update_heats_list')) {
return false;
}
if ($_G['setting']['indexhot']['status']) {
require_once libfile('function/post');
$_G['setting']['indexhot'] = array('status' => 1, 'limit' => intval($_G['setting']['indexhot']['limit'] ? $_G['setting']['indexhot']['limit'] : 10), 'days' => intval($_G['setting']['indexhot']['days'] ? $_G['setting']['indexhot']['days'] : 7), 'expiration' => intval($_G['setting']['indexhot']['expiration'] ? $_G['setting']['indexhot']['expiration'] : 900), 'messagecut' => intval($_G['setting']['indexhot']['messagecut'] ? $_G['setting']['indexhot']['messagecut'] : 200));
$messageitems = 2;
$limit = $_G['setting']['indexhot']['limit'];
foreach (C::t('forum_thread')->fetch_all_heats() as $heat) {
$post = C::t('forum_post')->fetch_threadpost_by_tid_invisible($heat['tid']);
$heat = array_merge($heat, (array) $post);
if ($limit == 0) {
break;
}
if ($messageitems > 0) {
$heat['message'] = !$heat['price'] ? messagecutstr($heat['message'], $_G['setting']['indexhot']['messagecut']) : '';
$data['message'][$heat['tid']] = $heat;
} else {
unset($heat['message']);
$data['subject'][$heat['tid']] = $heat;
}
$messageitems--;
$limit--;
}
$data['expiration'] = TIMESTAMP + $_G['setting']['indexhot']['expiration'];
}
savecache('heats', $data);
discuz_process::unlock('update_heats_list');
}
开发者ID:softhui,项目名称:discuz,代码行数:34,代码来源:cache_heats.php
示例4: updatersscache
function updatersscache($num)
{
global $_G;
$processname = 'portal_rss_cache';
if (discuz_process::islocked($processname, 600)) {
return false;
}
DB::query("DELETE FROM " . DB::table('portal_rsscache') . "");
require_once libfile('function/post');
foreach ($_G['cache']['portalcategory'] as $catid => $catarray) {
$query = DB::query("SELECT aid, username, author, dateline, title, summary\r\n\t\t\tFROM " . DB::table('portal_article_title') . "\r\n\t\t\tWHERE catid='{$catid}' AND status=0\r\n\t\t\tORDER BY aid DESC LIMIT {$num}");
$catarray['catname'] = addslashes($catarray['catname']);
while ($article = DB::fetch($query)) {
$article['author'] = $article['author'] != '' ? addslashes($article['author']) : ($article['username'] ? addslashes($article['username']) : 'Anonymous');
$article['title'] = addslashes($article['title']);
$articleattach = DB::fetch_first("SELECT * FROM " . DB::table('portal_attachment') . " WHERE aid='" . $article['aid'] . "' AND isimage=1");
$attachdata = '';
if (!empty($articleattach)) {
$attachdata = "\t" . $articleattach['remote'] . "\t" . $articleattach['attachment'] . "\t" . $articleattach['filesize'];
}
$article['description'] = addslashes(messagecutstr($article['summary'], 250 - strlen($attachdata)) . $attachdata);
DB::query("REPLACE INTO " . DB::table('portal_rsscache') . " (lastupdate, catid, aid, dateline, catname, author, subject, description)\r\n\t\t\t\tVALUES ('{$_G['timestamp']}', '{$catid}', '{$article['aid']}', '{$article['dateline']}', '{$catarray['catname']}', '{$article['author']}', '{$article['title']}', '{$article['description']}')");
}
}
discuz_process::unlock($processname);
return true;
}
开发者ID:dalinhuang,项目名称:hlwbbsvincent,代码行数:27,代码来源:portal_rss.php
示例5: before_feed
public function before_feed()
{
$message = !$this->param['price'] && !$this->param['readperm'] ? $this->param['message'] : '';
$this->feed['icon'] = 'debate';
$this->feed['title_template'] = 'feed_thread_debate_title';
$this->feed['body_template'] = 'feed_thread_debate_message';
$this->feed['body_data'] = array('subject' => "<a href=\"forum.php?mod=viewthread&tid={$this->tid}\">{$this->param['subject']}</a>", 'message' => messagecutstr($message, 150), 'affirmpoint' => messagecutstr($this->affirmpoint, 150), 'negapoint' => messagecutstr($this->negapoint, 150));
}
开发者ID:MCHacker,项目名称:discuz-docker,代码行数:8,代码来源:extend_thread_debate.php
示例6: before_newreply
public function before_newreply($parameters)
{
global $nauthorid;
list(, $this->param['modnewreplies']) = threadmodstatus($this->param['subject'] . "\t" . $this->param['message'] . $this->param['extramessage']);
if ($this->thread['displayorder'] == -4) {
$this->param['modnewreplies'] = 0;
}
$pinvisible = $parameters['modnewreplies'] ? -2 : ($this->thread['displayorder'] == -4 ? -3 : 0);
$this->postcomment = in_array(2, $this->setting['allowpostcomment']) && $this->group['allowcommentreply'] && !$pinvisible && !empty($_GET['reppid']) && ($nauthorid != $this->member['uid'] || $this->setting['commentpostself']) ? messagecutstr($parameters['message'], 200, ' ') : '';
}
开发者ID:tianyunchong,项目名称:php,代码行数:10,代码来源:extend_thread_comment.php
示例7: misc_mobile_message
function misc_mobile_message($message)
{
global $_G, $thread;
if (!in_array($message, array('recommend_succed', 'recommend_daycount_succed'))) {
return;
}
$thaquote = C::t('forum_post')->fetch_threadpost_by_tid_invisible($thread['tid']);
$quote = $thaquote['message'];
$quote = messagecutstr($quote, 100);
$quote = implode("\n", array_slice(explode("\n", $quote), 0, 3));
}
开发者ID:sayhanabi,项目名称:sayhanabi_forum,代码行数:11,代码来源:recommend.php
示例8: before_feed
public function before_feed()
{
$message = !$this->param['price'] && !$this->param['readperm'] ? $this->param['message'] : '';
$this->feed['icon'] = 'activity';
$this->feed['title_template'] = 'feed_thread_activity_title';
$this->feed['body_template'] = 'feed_thread_activity_message';
$this->feed['body_data'] = array('subject' => "<a href=\"forum.php?mod=viewthread&tid={$this->tid}\">{$this->param['subject']}</a>", 'starttimefrom' => $_GET['starttimefrom'][$this->activitytime], 'activityplace' => $this->activity['place'], 'message' => messagecutstr($message, 150));
if ($_GET['activityaid']) {
$this->feed['images'] = array(getforumimg($_GET['activityaid']));
$this->feed['image_links'] = array("forum.php?mod=viewthread&do=tradeinfo&tid={$this->tid}&pid={$this->pid}");
}
}
开发者ID:MCHacker,项目名称:discuz-docker,代码行数:12,代码来源:extend_thread_activity.php
示例9: before_feed
public function before_feed()
{
$pvs = explode("\t", messagecutstr($this->polloptionpreview, 150));
$s = '';
$i = 1;
foreach ($pvs as $pv) {
$s .= $i . '. ' . $pv . '<br />';
}
$s .= ' ...';
$this->feed['icon'] = 'poll';
$this->feed['title_template'] = 'feed_thread_poll_title';
$this->feed['body_template'] = 'feed_thread_poll_message';
$this->feed['body_data'] = array('subject' => "<a href=\"forum.php?mod=viewthread&tid={$this->tid}\">" . $this->param['subject'] . "</a>", 'message' => $s);
}
开发者ID:tang86,项目名称:discuz-utf8,代码行数:14,代码来源:extend_thread_poll.php
示例10: foreach
foreach ($posts as $pid => $post) {
$delrow = false;
if ($post['anonymous'] && $post['authorid'] != $_G['uid']) {
$delrow = true;
} elseif ($viewuserthread && $post['authorid'] != $_G['uid']) {
if ($_G['adminid'] != 1 && !empty($viewfids) && !in_array($post['fid'], $viewfids)) {
$delrow = true;
}
}
if ($delrow) {
unset($posts[$pid]);
$hiddennum++;
continue;
} else {
$tids[$post['tid']][] = $pid;
$post['message'] = !getstatus($post['status'], 2) || $post['authorid'] == $_G['uid'] ? messagecutstr($post['message'], 100) : '';
$posts[$pid] = $post;
}
}
if (!empty($tids)) {
$threads = C::t('forum_thread')->fetch_all_by_tid_displayorder(array_keys($tids), $displayorder, $dglue, array(), $closed);
foreach ($threads as $tid => $thread) {
$delrow = false;
if ($_G['adminid'] != 1 && $thread['displayorder'] < 0) {
$delrow = true;
} elseif ($_G['adminid'] != 1 && $_G['uid'] != $thread['authorid'] && getstatus($thread['status'], 2)) {
$delrow = true;
} elseif (!isset($_G['cache']['forums'][$thread['fid']])) {
if (!$_G['setting']['groupstatus']) {
$delrow = true;
} else {
开发者ID:tang86,项目名称:discuz-utf8,代码行数:31,代码来源:space_thread.php
示例11: messagecutstr
</a></div>
<div class="yjgl_li_tit_other">
<span class="yjglico">
<span class="view"><?php
echo $item['views'];
?>
</span><span class="view_fx"><?php
echo $item['replies'];
?>
</span>
</span>
</div>
</div>
<div class="clear"></div>
<div class="yjgl_li_des"><?php
echo messagecutstr($item['message'], 130);
?>
</div>
</div>
</li>
<?php
}
?>
</ul>
</div>
<div class="clear"></div>
</div>
</div>
<?php
$this->load->view('foot_v1');
?>
开发者ID:chentaoz,项目名称:TourismWeb,代码行数:31,代码来源:travel_favorite.php
示例12: getranklist_blog
function getranklist_blog($num = 20, $view = 'hot', $orderby = 'all')
{
$dateline = $timestamp = '';
if ($orderby == 'today') {
$timestamp = TIMESTAMP - 86400;
$dateline = "AND b.dateline>='{$timestamp}'";
} elseif ($orderby == 'thisweek') {
$timestamp = TIMESTAMP - 604800;
$dateline = "AND b.dateline>='{$timestamp}'";
} elseif ($orderby == 'thismonth') {
$timestamp = TIMESTAMP - 2592000;
$dateline = "AND b.dateline>='{$timestamp}'";
}
$data = array();
$query = DB::query("SELECT b.blogid, b.uid, b.username, b.subject, b.dateline, b.viewnum, b.replynum, b.hot, b.sharetimes, b.favtimes,\n\t\tb.click1, b.click2, b.click3, b.click4, b.click5, b.click6, b.click7, b.click8, bf.message\n\t\tFROM " . DB::table('home_blog') . " b\n\t\tLEFT JOIN " . DB::table('home_blogfield') . " bf ON bf.blogid=b.blogid\n\t\tWHERE b.friend='0' AND status = '0' {$dateline}\n\t\tORDER BY b.{$view} DESC\n\t\tLIMIT 0, {$num}");
require_once libfile('function/forum');
require_once libfile('function/post');
$rank = 0;
while ($blog = DB::fetch($query)) {
++$rank;
$blog['rank'] = $rank;
$blog['dateline'] = dgmdate($blog['dateline']);
$blog['avatar'] = avatar($blog['uid'], 'small');
$blog['message'] = preg_replace('/<([^>]*?)>/', '', $blog['message']);
$blog['message'] = messagecutstr($blog['message'], 140);
$data[] = $blog;
}
return $data;
}
开发者ID:pan289091315,项目名称:Discuz,代码行数:29,代码来源:misc_ranklist.php
示例13: array
if (!($thapost && ($thapost['invisible'] == 0 || $thapost['authorid'] == $_G['uid'] && $thapost['invisible'] == -2))) {
$thapost = array();
}
if ($thapost['tid'] != $_G['tid']) {
showmessage('targetpost_donotbelongto_thisthread', NULL);
}
$thapost['useip'] = substr($thapost['useip'], 0, strrpos($thapost['useip'], '.')) . '.x';
if ($thapost['author'] && $thapost['anonymous']) {
$thapost['author'] = '[color=Olive]' . lang('forum/misc', 'anonymoususer') . '[/color]';
} elseif (!$thapost['author']) {
$thapost['author'] = '[color=Olive]' . lang('forum/misc', 'guestuser') . '[/color] ' . $thapost['useip'];
} else {
$thapost['author'] = '[color=Olive]' . $thapost['author'] . '[/color]';
}
$quotemessage = discuzcode($message, 0, 0);
$noticeauthormsg = dhtmlspecialchars(messagecutstr($thapost['message'], 100));
$noticeauthor = dhtmlspecialchars(authcode('r|' . $thapost['authorid'], 'ENCODE'));
$noticetrimstr = dhtmlspecialchars($message);
$message = '';
$reppid = $_GET['reppost'];
}
if (isset($_GET['addtrade']) && $thread['special'] == 2 && $_G['group']['allowposttrade'] && $thread['authorid'] == $_G['uid']) {
$expiration_7days = date('Y-m-d', TIMESTAMP + 86400 * 7);
$expiration_14days = date('Y-m-d', TIMESTAMP + 86400 * 14);
$trade['expiration'] = $expiration_month = date('Y-m-d', mktime(0, 0, 0, date('m') + 1, date('d'), date('Y')));
$expiration_3months = date('Y-m-d', mktime(0, 0, 0, date('m') + 3, date('d'), date('Y')));
$expiration_halfyear = date('Y-m-d', mktime(0, 0, 0, date('m') + 6, date('d'), date('Y')));
$expiration_year = date('Y-m-d', mktime(0, 0, 0, date('m'), date('d'), date('Y') + 1));
}
if ($thread['replies'] <= $_G['ppp']) {
$postlist = array();
开发者ID:lemonstory,项目名称:bbs,代码行数:31,代码来源:post_newreply.php
示例14: updatepostcredits
if (getstatus($post['status'], 3) == 0) {
updatepostcredits('+', $post['authorid'], 'reply', $post['fid']);
$attachcount = C::t('forum_attachment_n')->count_by_id('tid:' . $post['tid'], 'pid', $post['pid']);
updatecreditbyaction('postattach', $post['authorid'], array(), '', $attachcount, 1, $post['fid']);
}
$threads[$post['tid']]['posts']++;
if ($post['dateline'] > $post['lastpost'] && $post['dateline'] > $lastpost[$post['tid']]) {
$threads[$post['tid']]['lastpost'] = $post['dateline'];
$threads[$post['tid']]['lastposter'] = $post['anonymous'] && $post['dateline'] != $post['lastpost'] ? '' : addslashes($post[author]);
}
if ($threads[$post['tid']]['attachadd'] || $post['attachment']) {
$threads[$post['tid']]['attachment'] = 1;
}
$pm = 'pm_' . $post['pid'];
if ($post['authorid'] && $post['authorid'] != $_G['uid']) {
$pmlist[] = array('act' => 'modreplies_validate', 'notevar' => array('reason' => dhtmlspecialchars($_GET['reason']), 'pid' => $post['pid'], 'tid' => $post['tid'], 'post' => messagecutstr($post['message'], 30), 'from_id' => 0, 'from_idtype' => 'modreplies'), 'authorid' => $post['authorid']);
}
}
unset($postlist, $tids, $threadlist);
foreach ($threads as $tid => $thread) {
$updatedata = array('replies' => $thread['posts']);
if (isset($thread['lastpost'])) {
$updatedata['lastpost'] = array($thread['lastpost']);
$updatedata['lastposter'] = array($thread['lastposter']);
}
if (isset($thread['attachment'])) {
$updatedata['attachment'] = $thread['attachment'];
}
C::t('forum_thread')->increase($tid, $updatedata);
}
if ($_G['fid']) {
开发者ID:tang86,项目名称:discuz-utf8,代码行数:31,代码来源:modcp_moderate.php
示例15: trim
$focus['title'] = trim($focus_title);
$focus['title'] = empty($focus['title']) ? lang('misc_focus') : $focus['title'];
$db->query("REPLACE INTO {$tablepre}settings (variable, value) VALUES ('focus', '" . addslashes(serialize($focus)) . "')");
updatecache('focus');
cpmsg('focus_conf_succeed', $BASESCRIPT . '?action=misc&operation=focus&do=config', 'succeed');
}
} elseif ($do == 'fetchthread' && $id) {
$thread = $db->fetch_first("SELECT pid, subject, message, attachment FROM {$tablepre}posts WHERE tid='{$id}' AND first='1'");
ajaxshowheader();
if (!$thread) {
echo '<script type="text/JavaScript">alert(\'' . lang('misc_focus_nothread') . '\');</script>';
ajaxshowfooter();
exit;
}
showsetting('misc_focus_topic_subject', 'focus_subject', $thread['subject'], 'text');
showsetting('misc_focus_topic_msg', 'focus_summary', messagecutstr($thread['message'], 150), 'textarea');
if ($thread['attachment']) {
$attachlist = $attachkeys = array();
$attachlist[] = array('', lang('select'));
$attachlist[] = array(0, lang('misc_focus_noimage'));
$query = $db->query("SELECT aid, filename FROM {$tablepre}attachments WHERE pid='{$thread['pid']}' AND isimage IN ('1', '-1')");
while ($attach = $db->fetch_array($query)) {
$attachlist[] = array($attach['aid'], $attach['filename']);
$attachkeys[$attach['aid']] = rawurlencode(authcode("{$attach['aid']}\t58\t58", 'ENCODE', $_DCACHE['settings']['authkey']));
}
if ($attachkeys) {
showsetting('misc_focus_image', array('focus_aid', $attachlist), '', 'select');
showsetting('', 'focus_img', '', '<div id="focus_img_preview"></div><input type="hidden" name="focus_filename" value="" />');
}
}
echo '<script type="text/JavaScript">var attachkeys = [];';
开发者ID:BGCX262,项目名称:zyyhong-svn-to-git,代码行数:31,代码来源:misc.inc.php
示例16: array
$feed['body_template'] = 'feed_thread_reward_message';
$feed['body_data'] = array('subject' => "<a href=\"forum.php?mod=viewthread&tid={$tid}\">{$subject}</a>", 'rewardprice' => $rewardprice, 'extcredits' => $_G['setting']['extcredits'][$_G['setting']['creditstransextra'][2]]['title']);
} elseif ($special == 4) {
$feed['icon'] = 'activity';
$feed['title_template'] = 'feed_thread_activity_title';
$feed['body_template'] = 'feed_thread_activity_message';
$feed['body_data'] = array('subject' => "<a href=\"forum.php?mod=viewthread&tid={$tid}\">{$subject}</a>", 'starttimefrom' => $_G['gp_starttimefrom'][$activitytime], 'activityplace' => $activity['place'], 'message' => messagecutstr($message, 150));
if ($_G['gp_activityaid']) {
$feed['images'] = array(getforumimg($_G['gp_activityaid']));
$feed['image_links'] = array("forum.php?mod=viewthread&do=tradeinfo&tid={$tid}&pid={$pid}");
}
} elseif ($special == 5) {
$feed['icon'] = 'debate';
$feed['title_template'] = 'feed_thread_debate_title';
$feed['body_template'] = 'feed_thread_debate_message';
$feed['body_data'] = array('subject' => "<a href=\"forum.php?mod=viewthread&tid={$tid}\">{$subject}</a>", 'message' => messagecutstr($message, 150), 'affirmpoint' => messagecutstr($affirmpoint, 150), 'negapoint' => messagecutstr($negapoint, 150));
}
}
$feed['title_data']['hash_data'] = "tid{$tid}";
$feed['id'] = $tid;
$feed['idtype'] = 'tid';
if ($feed['icon']) {
postfeed($feed);
}
}
if ($displayorder != -4) {
if ($digest) {
updatepostcredits('+', $_G['uid'], 'digest', $_G['fid']);
}
updatepostcredits('+', $_G['uid'], 'post', $_G['fid']);
if ($isgroup) {
开发者ID:v998,项目名称:discuzx-en,代码行数:31,代码来源:post_newthread.php
示例17: array_keys
if (!IS_ROBOT) {
$activityuser = array_keys($groupcache['activityuser']['data']);
if ($activityuser) {
$query = C::t('home_feed')->fetch_all_by_uid_dateline($activityuser);
foreach ($query as $feed) {
if ($feed['friend'] == 0) {
$groupfeedlist[] = mkfeed($feed);
}
}
}
}
if ($_G['forum']['livetid']) {
include_once libfile('function/post');
$livethread = C::t('forum_thread')->fetch($_G['forum']['livetid']);
$livepost = C::t('forum_post')->fetch_threadpost_by_tid_invisible($_G['forum']['livetid']);
$livemessage = messagecutstr($livepost['message'], 200);
$liveallowpostreply = $groupuser['uid'] && $groupuser['level'] ? true : false;
list($seccodecheck, $secqaacheck) = seccheck('post', 'newthread');
}
} else {
$newuserlist = $activityuserlist = array();
$newuserlist = array_slice($groupcache['newuserlist']['data'], 0, 4);
foreach ($newuserlist as $user) {
$newuserlist[$user['uid']] = $user;
$newuserlist[$user['uid']]['online'] = !empty($onlinemember['list']) && is_array($onlinemember['list']) && !empty($onlinemember['list'][$user['uid']]) ? 1 : 0;
}
}
write_groupviewed($_G['fid']);
include template('diy:group/group:' . $_G['fid']);
} elseif ($action == 'memberlist') {
$oparray = array('card', 'address', 'alluser');
开发者ID:MCHacker,项目名称:discuz-docker,代码行数:31,代码来源:forum_group.php
示例18: elseif
exit;
} elseif ($_GET['action'] == 'livelastpost') {
$fid = dintval($_GET['fid']);
$forum = C::t('forum_forumfield')->fetch($fid);
$livetid = $forum['livetid'];
$postlist = array();
if ($livetid) {
$thread = C::t('forum_thread')->fetch($livetid);
$postlist['count'] = $thread['replies'];
$postarr = C::t('forum_post')->fetch_all_by_tid('tid:' . $livetid, $livetid, true, 'DESC', 20);
ksort($postarr);
foreach ($postarr as $post) {
if ($post['first'] == 1 || getstatus($post['status'], 1)) {
continue;
}
$contentarr = array('authorid' => !$post['anonymous'] ? $post['authorid'] : '', 'author' => !$post['anonymous'] ? $post['author'] : lang('forum/misc', 'anonymous'), 'message' => str_replace("\r\n", '<br>', messagecutstr($post['message'])), 'dateline' => dgmdate($post['dateline'], 'u'), 'avatar' => !$post['anonymous'] ? avatar($post['authorid'], 'small') : '');
$postlist['list'][$post['pid']] = $contentarr;
}
}
showmessage('', '', $postlist);
exit;
} else {
if (empty($_G['forum']['allowview'])) {
if (!$_G['forum']['viewperm'] && !$_G['group']['readaccess']) {
showmessage('group_nopermission', NULL, array('grouptitle' => $_G['group']['grouptitle']), array('login' => 1));
} elseif ($_G['forum']['viewperm'] && !forumperm($_G['forum']['viewperm'])) {
showmessage('forum_nopermission', NULL, array($_G['group']['grouptitle']), array('login' => 1));
}
}
$thread = C::t('forum_thread')->fetch($_G['tid']);
if (!($thread['displayorder'] >= 0 || $thread['displayorder'] == -4 && $thread['authorid'] == $_G['uid'])) {
开发者ID:443952248,项目名称:jiazhichao,代码行数:31,代码来源:forum_misc.php
示例19: lang
}
$invitename = lang('forum/misc', 'at_invite');
} else {
$invitename = lang('forum/misc', 'join_activity');
}
if (!submitcheck('invitesubmit')) {
$inviteduids = !empty($inviteduids) ? implode(',', $inviteduids) : '';
} else {
$uids = $_GET['uids'];
if ($uids) {
if (count($uids) > $maxselect) {
showmessage('group_choose_friends_max');
}
$post = C::t('forum_post')->fetch_threadpost_by_tid_invisible($id);
require_once libfile('function/post');
$post['message'] = messagecutstr($post['message'], 150);
foreach (C::t('common_member')->fetch_all($uids, false, 0) as $uid => $user) {
if ($at) {
notification_add($uid, 'at', 'at_message', array('from_id' => $id, 'from_idtype' => 'at', 'buyerid' => $_G['uid'], 'buyer' => $_G['username'], 'tid' => $id, 'subject' => $thread['subject'], 'pid' => $post['pid'], 'message' => $post['message']));
} else {
notification_add($uid, 'thread', 'thread_invite', array('subject' => $thread['subject'], 'invitename' => $invitename, 'tid' => $id, 'from_id' => $id, 'from_idtype' => 'invite_thread'));
}
}
showmessage($at ? 'at_succeed' : 'group_invite_succeed', "forum.php?mod=viewthread&tid={$id}");
} else {
showmessage($at ? 'at_choose_member' : 'group_invite_choose_member', "forum.php?mod=viewthread&tid={$id}");
}
}
} elseif ($_GET['action'] == 'blog') {
$id = intval($_GET['id']);
$blog = C::t('home_blog')->fetch($id);
开发者ID:tang86,项目名称:discuz-utf8,代码行数:31,代码来源:misc_invite.php
示例20: updatersscache
function updatersscache($num)
{
global $_G;
$processname = 'forum_rss_cache';
if (discuz_process::islocked($processname, 600)) {
return false;
}
C::t('forum_rsscache')->truncate();
require_once libfile('function/post');
foreach ($_G['cache']['forums'] as $fid => $forum) {
if ($forum['type'] != 'group') {
$forum['name'] = addslashes($forum['name']);
foreach (C::t('forum_thread')->fetch_all_by_fid_displayorder($fid, 0, null, null, 0, $num, 'tid') as $thread) {
$thread['author'] = $thread['author'] != '' ? addslashes($thread['author']) : 'Anonymous';
$thread['subject'] = addslashes($thread['subject']);
$post = C::t('forum_post')->fetch_threadpost_by_tid_invisible($thread['tid']);
$attachdata = '';
if ($post['attachment'] == 2) {
$attach = C::t('forum_attachment_n')->fetch_max_image('tid:' . $thread['tid'], 'pid', $post['pid']);
$attachdata = "\t" . $attach['remote'] . "\t" . $attach['attachment'] . "\t" . $attach['filesize'];
}
$thread['message'] = $post['message'];
$thread['status'] = $post['status'];
$thread['description'] = $thread['readperm'] > 0 || $thread['price'] > 0 || $thread['status'] & 1 ? '' : addslashes(messagecutstr($thread['message'], 250 - strlen($attachdata)) . $attachdata);
C::t('forum_rsscache')->insert(array('lastupdate' => $_G['timestamp'], 'fid' => $fid, 'tid' => $thread['tid'], 'dateline' => $thread['dateline'], 'forum' => $forum['name'], 'author' => $thread['author'], 'subject' => $thread['subject'], 'description' => $thread['description']), false, true);
}
}
}
discuz_process::unlock($processname);
return true;
}
开发者ID:dalinhuang,项目名称:healthshop,代码行数:31,代码来源:forum_rss.php
注:本文中的messagecutstr函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论