本文整理汇总了PHP中fetch_censored_text函数的典型用法代码示例。如果您正苦于以下问题:PHP fetch_censored_text函数的具体用法?PHP fetch_censored_text怎么用?PHP fetch_censored_text使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了fetch_censored_text函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: fetchTemplate
public function fetchTemplate($templatename, $activity, $skipgroup = false, $fetchphrase = false)
{
$commentinfo =& $this->content['album_picturecomment'][$activity['contentid']];
$albuminfo =& $this->content['album'][$commentinfo['albumid']];
$activity['postdate'] = vbdate(vB::$vbulletin->options['dateformat'], $activity['dateline'], true);
$activity['posttime'] = vbdate(vB::$vbulletin->options['timeformat'], $activity['dateline']);
$preview = strip_quotes($commentinfo['pagetext']);
$commentinfo['preview'] = htmlspecialchars_uni(fetch_censored_text(fetch_trimmed_title(strip_bbcode($preview, false, true, true, true), vb::$vbulletin->options['as_snippet'])));
$userinfo = $this->fetchUser($activity['userid'], $commentinfo['postusername']);
$userinfo2 = $this->fetchUser($albuminfo['userid']);
if ($fetchphrase) {
if ($userinfo['userid']) {
$phrase = construct_phrase($this->vbphrase['x_commented_on_a_photo_in_album_y'], fetch_seo_url('member', $userinfo), $userinfo['username'], fetch_seo_url('member', $userinfo2), $userinfo2['username'], vB::$vbulletin->session->vars['sessionurl'], $albuminfo['albumid'], $albuminfo['title']);
} else {
$phrase = construct_phrase($this->vbphrase['guest_x_commented_on_a_photo_in_album_y'], $userinfo['username'], fetch_seo_url('member', $userinfo2), $userinfo2['username'], vB::$vbulletin->session->vars['sessionurl'], $albuminfo['albumid'], $albuminfo['title']);
}
return array('phrase' => $phrase, 'userinfo' => $userinfo, 'activity' => $activity);
} else {
$templater = vB_Template::create($templatename);
$templater->register('userinfo', $userinfo);
$templater->register('userinfo2', $userinfo2);
$templater->register('activity', $activity);
$templater->register('commentinfo', $commentinfo);
$templater->register('albuminfo', $albuminfo);
return $templater->render();
}
}
开发者ID:0hyeah,项目名称:yurivn,代码行数:27,代码来源:comment.php
示例2: create_array
public static function create_array($ids)
{
global $vbulletin;
$set = $vbulletin->db->query_read_slave("
SELECT announcementid, startdate, title, announcement.views, forumid,
user.username, user.userid, user.usertitle, user.customtitle, user.usergroupid,
IF(displaygroupid=0, user.usergroupid, displaygroupid) AS displaygroupid, infractiongroupid
FROM " . TABLE_PREFIX . "announcement AS announcement
LEFT JOIN " . TABLE_PREFIX . "user AS user USING (userid)
WHERE announcementid IN (" . implode(',', array_map('intval', $ids)) . ")
");
$items = array();
while ($record = $vbulletin->db->fetch_array($set))
{
fetch_musername($record);
$record['title'] = fetch_censored_text($record['title']);
$record['postdate'] = vbdate($vbulletin->options['dateformat'], $record['startdate']);
$record['statusicon'] = 'new';
$record['views'] = vb_number_format($record['views']);
$record['forumtitle'] = $vbulletin->forumcache["$record[forumid]"]['title'];
$show['forumtitle'] = ($record['forumid'] == -1) ? false : true;
$announcement = new vBForum_Search_Result_Announcement();
$announcement->record = $record;
$items[$record['announcementid']] = $announcement;
}
return $items;
}
开发者ID:hungnv0789,项目名称:vhtm,代码行数:30,代码来源:announcement.php
示例3: verify_title
/**
* Verifies the title is valid and sets up the title for saving (wordwrap, censor, etc).
*
* @param string Title text
*
* @param bool Whether the title is valid
*/
function verify_title(&$title)
{
// replace html-encoded spaces with actual spaces
$title = preg_replace('/&#(0*32|x0*20);/', ' ', $title);
$title = trim($title);
if ($this->registry->options['titlemaxchars'] and $title != $this->existing['title']) {
if (!empty($this->info['show_title_error'])) {
if (($titlelen = vbstrlen($title)) > $this->registry->options['titlemaxchars']) {
// title too long
$this->error('title_toolong', $titlelen, $this->registry->options['titlemaxchars']);
return false;
}
} else {
if (empty($this->info['is_automated'])) {
// not showing the title length error, just chop it
$title = vbchop($title, $this->registry->options['titlemaxchars']);
}
}
}
require_once DIR . '/includes/functions_newpost.php';
// censor, remove all caps subjects, and htmlspecialchars title
$title = fetch_no_shouting_text(fetch_censored_text($title));
// do word wrapping
$title = fetch_word_wrapped_string($title);
return true;
}
开发者ID:holandacz,项目名称:nb4,代码行数:33,代码来源:class_dm_visitormessage.php
示例4: fetchTemplate
public function fetchTemplate($templatename, $activity, $skipgroup = false, $fetchphrase = false)
{
$messageinfo =& $this->content['visitormessage'][$activity['contentid']];
$activity['postdate'] = vbdate(vB::$vbulletin->options['dateformat'], $activity['dateline'], true);
$activity['posttime'] = vbdate(vB::$vbulletin->options['timeformat'], $activity['dateline']);
$userinfo2 =& $this->content['user'][$messageinfo['userid']];
$messageinfo['preview'] = strip_quotes($messageinfo['pagetext']);
$messageinfo['preview'] = htmlspecialchars_uni(fetch_censored_text(fetch_trimmed_title(strip_bbcode($messageinfo['preview'], false, true, true, true), vb::$vbulletin->options['as_snippet'])));
$userinfo = $this->fetchUser($activity['userid'], $messageinfo['postusername']);
if ($fetchphrase) {
if ($userinfo['userid']) {
$phrase = construct_phrase($this->vbphrase['x_created_a_visitormessage_y_in_z'], fetch_seo_url('member', $userinfo), $userinfo['username'], fetch_seo_url('member', $userinfo2, $linkinfo), $messageinfo['vmid'], fetch_seo_url('member', $userinfo2), $userinfo2['username']);
} else {
$phrase = construct_phrase($this->vbphrase['guest_x_created_a_visitormessage_y_in_z'], $userinfo['username'], fetch_seo_url('member', $userinfo2, $linkinfo), $messageinfo['vmid'], fetch_seo_url('member', $userinfo2), $userinfo2['username']);
}
return array('phrase' => $phrase, 'userinfo' => $userinfo, 'activity' => $activity);
} else {
$templater = vB_Template::create($templatename);
$templater->register('userinfo', $userinfo);
$templater->register('userinfo2', $userinfo2);
$templater->register('linkinfo', array('vmid' => $messageinfo['vmid']));
$templater->register('linkinfo2', array('tab' => 'visitor_messaging'));
$templater->register('activity', $activity);
$templater->register('messageinfo', $messageinfo);
return $templater->render();
}
}
开发者ID:0hyeah,项目名称:yurivn,代码行数:27,代码来源:visitormessage.php
示例5: prepare_pictureinfo_thumb
/**
* Prepares a picture array for thumbnail display.
*
* @param array Array of picture info
*
* @return array Array of picture info modified
*/
function prepare_pictureinfo_thumb($pictureinfo)
{
global $vbulletin;
$pictureinfo['caption_preview'] = fetch_censored_text(fetch_trimmed_title($pictureinfo['caption'], $vbulletin->options['album_captionpreviewlen']));
$pictureinfo['dimensions'] = $pictureinfo['thumbnail_width'] ? "width=\"{$pictureinfo['thumbnail_width']}\" height=\"{$pictureinfo['thumbnail_height']}\"" : '';
$pictureinfo['date'] = vbdate($vbulletin->options['dateformat'], $pictureinfo['dateline'], true);
$pictureinfo['time'] = vbdate($vbulletin->options['timeformat'], $pictureinfo['dateline']);
return $pictureinfo;
}
开发者ID:cedwards-reisys,项目名称:nexus-web,代码行数:16,代码来源:functions_album.php
示例6: mobiquo_chop
function mobiquo_chop($string)
{
global $stylevar, $vbulletin;
$string = preg_replace('/<br \\/\\>/', '', $string);
$string = preg_replace('/(^\\s+)|(\\s+$)/', '', $string);
$string = preg_replace('/\\n/', '', $string);
$string = preg_replace('/\\r/', '', $string);
$string = strip_quotes($string);
$string = htmlspecialchars_uni(fetch_censored_text(fetch_trimmed_title(strip_bbcode($string, false, true), 200)));
return $string;
}
开发者ID:patrickrolanddg,项目名称:dragonfly-tapatalk,代码行数:11,代码来源:common.php
示例7: prepare_pictureinfo_thumb
/**
* Prepares a picture array for thumbnail display.
*
* @param array Array of picture info
* @param array Container info (either for a group or album); changes thumbnail URL
*
* @return array Array of picture info modified
*/
function prepare_pictureinfo_thumb($pictureinfo, $displaytypeinfo)
{
global $vbulletin;
$pictureinfo['caption_preview'] = fetch_censored_text(fetch_trimmed_title($pictureinfo['caption'], $vbulletin->options['album_captionpreviewlen']));
$pictureinfo['thumburl'] = $pictureinfo['thumbnail_filesize'] ? fetch_picture_url($pictureinfo, $displaytypeinfo, true) : '';
$pictureinfo['dimensions'] = $pictureinfo['thumbnail_width'] ? "width=\"{$pictureinfo['thumbnail_width']}\" height=\"{$pictureinfo['thumbnail_height']}\"" : '';
$pictureinfo['date'] = vbdate($vbulletin->options['dateformat'], $pictureinfo['dateline'], true);
$pictureinfo['time'] = vbdate($vbulletin->options['dateformat'], $pictureinfo['dateline']);
($hook = vBulletinHook::fetch_hook('album_prepare_thumb')) ? eval($hook) : false;
return $pictureinfo;
}
开发者ID:holandacz,项目名称:nb4,代码行数:19,代码来源:functions_album.php
示例8: fetchTemplate
public function fetchTemplate($templatename, $activity, $skipgroup = false, $fetchphrase = false)
{
$userinfo =& $this->content['user'][$activity['userid']];
$bloginfo =& $this->content['blog'][$activity['contentid']];
$activity['postdate'] = vbdate(vB::$vbulletin->options['dateformat'], $activity['dateline'], true);
$activity['posttime'] = vbdate(vB::$vbulletin->options['timeformat'], $activity['dateline']);
$preview = strip_quotes($bloginfo['pagetext']);
$bloginfo['preview'] = htmlspecialchars_uni(fetch_censored_text(fetch_trimmed_title(strip_bbcode($preview, false, true, true, true), vb::$vbulletin->options['as_snippet'])));
if ($fetchphrase) {
return array('phrase' => construct_phrase($this->vbphrase['x_created_a_blog_entry_y_in_z'], fetch_seo_url('member', $userinfo), $userinfo['username'], fetch_seo_url('entry', $bloginfo), $bloginfo['title'], fetch_seo_url('blog', $bloginfo), $bloginfo['blog_title']), 'userinfo' => $userinfo, 'activity' => $activity);
} else {
$templater = vB_Template::create($templatename);
$templater->register('userinfo', $userinfo);
$templater->register('activity', $activity);
$templater->register('bloginfo', $bloginfo);
return $templater->render();
}
}
开发者ID:0hyeah,项目名称:yurivn,代码行数:18,代码来源:entry.php
示例9: verify_title
/**
* Verifies that the title is valid
*
* @param String Title
*
* @return boolean Returns true if title is valid
*/
function verify_title(&$title)
{
$title = fetch_censored_text($title);
// replace html-encoded spaces with actual spaces
$title = preg_replace('/&#(0*32|x0*20);/', ' ', $title);
// do word wrapping
if ($this->registry->options['wordwrap'] != 0) {
$title = fetch_word_wrapped_string($title);
}
// remove all caps subjects
require_once DIR . '/includes/functions_newpost.php';
$title = fetch_no_shouting_text($title);
$title = trim($title);
if (empty($title)) {
$this->error('invalid_title_specified');
return false;
}
return true;
}
开发者ID:holandacz,项目名称:nb4,代码行数:26,代码来源:class_dm_event.php
示例10: fetchTemplate
public function fetchTemplate($templatename, $activity, $skipgroup = false, $fetchphrase = false)
{
global $show;
$postinfo =& $this->content['post'][$activity['contentid']];
$threadinfo =& $this->content['thread'][$postinfo['threadid']];
$foruminfo =& vB::$vbulletin->forumcache[$threadinfo['forumid']];
$threadinfo['prefix_plain_html'] = htmlspecialchars_uni($this->vbphrase["prefix_{$threadinfo['prefixid']}_title_plain"]);
$threadinfo['prefix_rich'] = $this->vbphrase["prefix_{$threadinfo['prefixid']}_title_rich"];
$activity['postdate'] = vbdate(vB::$vbulletin->options['dateformat'], $activity['dateline'], true);
$activity['posttime'] = vbdate(vB::$vbulletin->options['timeformat'], $activity['dateline']);
$preview = strip_quotes($postinfo['pagetext']);
$postinfo['preview'] = htmlspecialchars_uni(fetch_censored_text(fetch_trimmed_title(strip_bbcode($preview, false, true, true, true), vb::$vbulletin->options['as_snippet'])));
$forumperms = fetch_permissions($threadinfo['forumid']);
$show['threadcontent'] = $forumperms & vB::$vbulletin->bf_ugp_forumpermissions['canviewthreads'] ? true : false;
$userinfo = $this->fetchUser($activity['userid'], $postinfo['username']);
if ($fetchphrase) {
if ($threadinfo['pollid']) {
if ($userinfo['userid']) {
$phrase = construct_phrase($this->vbphrase['x_replied_to_a_poll_y_in_z'], fetch_seo_url('member', $userinfo), $userinfo['username'], fetch_seo_url('thread', $threadinfo), $threadinfo['prefix_rich'], $threadinfo['title'], fetch_seo_url('forum', $foruminfo), $foruminfo['title']);
} else {
$phrase = construct_phrase($this->vbphrase['guest_x_replied_to_a_poll_y_in_z'], $userinfo['username'], fetch_seo_url('thread', $threadinfo), $threadinfo['prefix_rich'], $threadinfo['title'], fetch_seo_url('forum', $foruminfo), $foruminfo['title']);
}
} else {
if ($userinfo['userid']) {
$phrase = construct_phrase($this->vbphrase['x_replied_to_a_thread_y_in_z'], fetch_seo_url('member', $userinfo), $userinfo['username'], fetch_seo_url('thread', $threadinfo), $threadinfo['prefix_rich'], $threadinfo['title'], fetch_seo_url('forum', $foruminfo), $foruminfo['title']);
} else {
$phrase = construct_phrase($this->vbphrase['guest_x_replied_to_a_thread_y_in_z'], $userinfo['username'], fetch_seo_url('thread', $threadinfo), $threadinfo['prefix_rich'], $threadinfo['title'], fetch_seo_url('forum', $foruminfo), $foruminfo['title']);
}
}
return array('phrase' => $phrase, 'userinfo' => $userinfo, 'activity' => $activity);
} else {
$templater = vB_Template::create($templatename);
$templater->register('userinfo', $userinfo);
$templater->register('activity', $activity);
$templater->register('threadinfo', $threadinfo);
$templater->register('postinfo', $postinfo);
$templater->register('pageinfo', array('p' => $postinfo['postid']));
$templater->register('foruminfo', $foruminfo);
return $templater->render();
}
}
开发者ID:0hyeah,项目名称:yurivn,代码行数:41,代码来源:post.php
示例11: print_form_header
if (!$pages) {
$pages = 1;
}
print_form_header('attachment', 'search', 0, 1);
construct_hidden_code('prevsearch', $vbulletin->GPC['prevsearch']);
construct_hidden_code('prunedate', $vbulletin->GPC['prunedate']);
construct_hidden_code('pagenum', $vbulletin->GPC['pagenum']);
print_table_header(construct_phrase($vbphrase['showing_attachments_x_to_y_of_z'], ($vbulletin->GPC['pagenum'] - 1) * $vbulletin->GPC['search']['results'] + 1, iif($vbulletin->GPC['search']['results'] * $vbulletin->GPC['pagenum'] > $attachments['count'], $attachments['count'], $vbulletin->GPC['search']['results'] * $vbulletin->GPC['pagenum']), $attachments['count']), 7);
print_cells_row(array('<input type="checkbox" name="allbox" title="' . $vbphrase['check_all'] . '" onclick="js_check_all(this.form);" />', $vbphrase['filename'], $vbphrase['username'], $vbphrase['date'], $vbphrase['filesize'], $vbphrase['downloads'], $vbphrase['controls']), 1);
$currentrow = 1;
$attachmultiple = new vB_Attachment_Display_Multiple($vbulletin);
$attachments = $attachmultiple->fetch_results(implode(" AND ", $query), false, ($vbulletin->GPC['pagenum'] - 1) * $vbulletin->GPC['search']['results'], $vbulletin->GPC['search']['results'], $vbulletin->GPC['search']['orderby'], $vbulletin->GPC['search']['ordering']);
foreach ($attachments as $attachment) {
$cell = array();
$cell[] = "<input type=\"checkbox\" name=\"a_delete[]\" value=\"{$attachment['attachmentid']}\" tabindex=\"1\" />";
$cell[] = "<p align=\"" . vB_Template_Runtime::fetchStyleVar('left') . "\"><a href=\"../attachment.php?" . $vbulletin->session->vars['sessionurl'] . "attachmentid={$attachment['attachmentid']}&d={$attachment['dateline']}\">" . fetch_censored_text(htmlspecialchars_uni($attachment['filename'], false)) . '</a></p>';
$cell[] = iif($attachment['userid'], "<a href=\"user.php?" . $vbulletin->session->vars['sessionurl'] . "do=edit&u={$attachment['userid']}\">{$attachment['username']}</a>", $attachment['username']);
$cell[] = vbdate($vbulletin->options['dateformat'], $attachment['dateline']) . construct_link_code($vbphrase['view_content'], $attachmultiple->fetch_content_url($attachment, '../'), true);
$cell[] = vb_number_format($attachment['filesize'], 1, true);
$cell[] = $attachment['counter'];
$cell[] = '<span class="smallfont">' . construct_link_code($vbphrase['edit'], "attachment.php?" . $vbulletin->session->vars['sessionurl'] . "do=edit&attachmentid={$attachment['attachmentid']}") . construct_link_code($vbphrase['delete'], "attachment.php?" . $vbulletin->session->vars['sessionurl'] . "do=delete&attachmentid={$attachment['attachmentid']}") . '</span>';
print_cells_row($cell);
$currentrow++;
if ($currentrow > $vbulletin->GPC['search']['results']) {
break;
}
}
print_description_row('<input type="submit" class="button" name="massdelete" value="' . $vbphrase['delete_selected_attachments'] . '" tabindex="1" />', 0, 7, '', 'center');
$db->free_result($results);
if ($pages > 1 and $vbulletin->GPC['pagenum'] < $pages) {
print_table_footer(7, iif($vbulletin->GPC['pagenum'] > 1, "<input type=\"submit\" name=\"prev_page\" class=\"button\" tabindex=\"1\" value=\"{$vbphrase['prev_page']}\" accesskey=\"s\" />") . "\n<input type=\"submit\" name=\"next_page\" class=\"button\" tabindex=\"1\" value=\"{$vbphrase['next_page']}\" accesskey=\"s\" />");
开发者ID:0hyeah,项目名称:yurivn,代码行数:31,代码来源:attachment.php
示例12: process_thread_array
// get highlight words
$post['highlight'] =& $highlightwords;
// get info from post
$post = process_thread_array($post, $lastread["{$post['forumid']}"], $post['allowicons']);
$show['disabled'] = ($managethread["{$post['postid']}"] or $managepost["{$post['postid']}"] or $approvepost["{$post['postid']}"] or $approveattachment["{$post['postid']}"]) ? false : true;
$show['moderated'] = (!$post['visible'] or !$post['thread_visible'] and $post['postid'] == $post['firstpostid']) ? true : false;
if ($post['pdel_userid']) {
$post['del_username'] =& $post['pdel_username'];
$post['del_userid'] =& $post['pdel_userid'];
$post['del_reason'] = fetch_censored_text($post['pdel_reason']);
$show['deleted'] = true;
} else {
if ($post['tdel_userid']) {
$post['del_username'] =& $post['tdel_username'];
$post['del_userid'] =& $post['tdel_userid'];
$post['del_reason'] = fetch_censored_text($post['tdel_reason']);
$show['deleted'] = true;
} else {
$show['deleted'] = false;
}
}
if ($post['prefixid']) {
$post['prefix_plain_html'] = htmlspecialchars_uni($vbphrase["prefix_{$post['prefixid']}_title_plain"]);
$post['prefix_rich'] = $vbphrase["prefix_{$post['prefixid']}_title_rich"];
} else {
$post['prefix_plain_html'] = '';
$post['prefix_rich'] = '';
}
$itemcount++;
exec_switch_bg();
($hook = vBulletinHook::fetch_hook('search_results_postbit')) ? eval($hook) : false;
开发者ID:holandacz,项目名称:nb4,代码行数:31,代码来源:search.php
示例13: prepare_socialgroup
/**
* Takes information regardign a group, and prepares the information within it
* for display
*
* @param array Group Array
* @param bool Whether to fetch group members and avatars
*
* @return array Group Array with prepared information
*
*/
function prepare_socialgroup($group, $fetchmembers = false)
{
global $vbulletin;
if (!is_array($group)) {
return array();
}
if ($fetchmembers) {
$membersinfo = cache_group_members();
$group['membersinfo'] = $membersinfo[$group['groupid']];
}
$group['joindate'] = !empty($group['joindate']) ? vbdate($vbulletin->options['dateformat'], $group['joindate'], true) : '';
$group['createtime'] = !empty($group['createdate']) ? vbdate($vbulletin->options['timeformat'], $group['createdate'], true) : '';
$group['createdate'] = !empty($group['createdate']) ? vbdate($vbulletin->options['dateformat'], $group['createdate'], true) : '';
$group['lastupdatetime'] = !empty($group['lastupdate']) ? vbdate($vbulletin->options['timeformat'], $group['lastupdate'], true) : '';
$group['lastupdatedate'] = !empty($group['lastupdate']) ? vbdate($vbulletin->options['dateformat'], $group['lastupdate'], true) : '';
$group['visible'] = vb_number_format($group['visible']);
$group['moderation'] = vb_number_format($group['moderation']);
$group['members'] = vb_number_format($group['members']);
$group['moderatedmembers'] = vb_number_format($group['moderatedmembers']);
$group['categoryname'] = htmlspecialchars_uni($group['categoryname']);
$group['discussions'] = vb_number_format($group['discussions']);
$group['lastdiscussion'] = fetch_word_wrapped_string(fetch_censored_text($group['lastdiscussion']));
$group['trimdiscussion'] = fetch_trimmed_title($group['lastdiscussion']);
if (!($group['options'] & $vbulletin->bf_misc_socialgroupoptions['enable_group_albums'])) {
// albums disabled in this group - force 0 pictures
$group['picturecount'] = 0;
}
$group['rawpicturecount'] = $group['picturecount'];
$group['picturecount'] = vb_number_format($group['picturecount']);
$group['rawname'] = $group['name'];
$group['rawdescription'] = $group['description'];
$group['name'] = fetch_word_wrapped_string(fetch_censored_text($group['name']));
if ($group['description']) {
$group['shortdescription'] = fetch_word_wrapped_string(fetch_censored_text(fetch_trimmed_title($group['description'], 185)));
} else {
$group['shortdescription'] = $group['name'];
}
$group['mediumdescription'] = fetch_word_wrapped_string(fetch_censored_text(fetch_trimmed_title($group['description'], 1000)));
$group['description'] = nl2br(fetch_word_wrapped_string(fetch_censored_text($group['description'])));
$group['is_owner'] = $group['creatoruserid'] == $vbulletin->userinfo['userid'];
$group['is_automoderated'] = ($group['options'] & $vbulletin->bf_misc_socialgroupoptions['owner_mod_queue'] and $vbulletin->options['sg_allow_owner_mod_queue'] and !$vbulletin->options['social_moderation']);
$group['canviewcontent'] = (!($group['options'] & $vbulletin->bf_misc_socialgroupoptions['join_to_view']) or !$vbulletin->options['sg_allow_join_to_view'] or $group['membertype'] == 'member' or can_moderate(0, 'canmoderategroupmessages') or can_moderate(0, 'canremovegroupmessages') or can_moderate(0, 'candeletegroupmessages') or fetch_socialgroup_perm('canalwayspostmessage') or fetch_socialgroup_perm('canalwascreatediscussion'));
$group['lastpostdate'] = vbdate($vbulletin->options['dateformat'], $group['lastpost'], true);
$group['lastposttime'] = vbdate($vbulletin->options['timeformat'], $group['lastpost']);
$group['lastposterid'] = $group['canviewcontent'] ? $group['lastposterid'] : 0;
$group['lastposter'] = $group['canviewcontent'] ? $group['lastposter'] : '';
// check read marking
//remove notice and make readtime determination a bit more clear
if (!empty($group['readtime'])) {
$readtime = $group['readtime'];
} else {
$readtime = fetch_bbarray_cookie('group_marking', $group['groupid']);
if (!$readtime) {
$readtime = $vbulletin->userinfo['lastvisit'];
}
}
// get thumb url
$group['iconurl'] = fetch_socialgroupicon_url($group, true);
// check if social group is moderated to join
$group['membermoderated'] = 'moderated' == $group['type'];
// posts older than markinglimit days won't be highlighted as new
$oldtime = TIMENOW - $vbulletin->options['markinglimit'] * 24 * 60 * 60;
$readtime = max((int) $readtime, $oldtime);
$group['readtime'] = $readtime;
$group['is_read'] = $readtime >= $group['lastpost'];
// Legacy Hook 'group_prepareinfo' Removed //
return $group;
}
开发者ID:cedwards-reisys,项目名称:nexus-web,代码行数:78,代码来源:functions_socialgroup.php
示例14: vB_FloodCheck
require_once(DIR . '/includes/class_floodcheck.php');
$floodcheck = new vB_FloodCheck($vbulletin, 'user', 'emailstamp');
$floodcheck->commit_key($vbulletin->userinfo['userid'], TIMENOW, TIMENOW - $vbulletin->options['emailfloodtime']);
if ($floodcheck->is_flooding())
{
eval(standard_error(fetch_error('emailfloodcheck', $vbulletin->options['emailfloodtime'], $floodcheck->flood_wait())));
}
}
($hook = vBulletinHook::fetch_hook('sendmessage_domailmember')) ? eval($hook) : false;
$message = fetch_censored_text($vbulletin->GPC['message']);
eval(fetch_email_phrases('usermessage', $userinfo['languageid']));
vbmail($userinfo['email'], fetch_censored_text($vbulletin->GPC['emailsubject']), $message , false, $vbulletin->userinfo['email'], '', $vbulletin->userinfo['username']);
// parse this next line with eval:
$sendtoname = $userinfo['username'];
eval(print_standard_redirect('redirect_sentemail'));
}
}
/*======================================================================*\
|| ####################################################################
|| #
|| # CVS: $RCSfile$ - $Revision: 35508 $
|| ####################################################################
\*======================================================================*/
?>
开发者ID:hungnv0789,项目名称:vhtm,代码行数:31,代码来源:sendmessage.php
示例15: verify_pagetext
/**
* Basic options to perform on all pagetext type fields
*
* @param string Page text
*
* @param bool Whether the text is valid
* @param bool Whether to run the case stripper
*/
function verify_pagetext(&$pagetext, $noshouting = true)
{
require_once DIR . '/includes/functions_newpost.php';
$pagetext = preg_replace('/&#(0*32|x0*20);/', ' ', $pagetext);
$pagetext = trim($pagetext);
// remove empty bbcodes
//$pagetext = $this->strip_empty_bbcode($pagetext);
// add # to color tags using hex if it's not there
$pagetext = preg_replace('#\\[color=("|"|\'|)([a-f0-9]{6})\\1]#i', '[color=\\1#\\2\\1]', $pagetext);
// strip alignment codes that are closed and then immediately reopened
$pagetext = preg_replace('#\\[/(left|center|right)\\]([\\r\\n]*)\\[\\1\\]#i', '\\2', $pagetext);
// remove [/list=x remnants
if (stristr($pagetext, '[/list=') != false) {
$pagetext = preg_replace('#\\[/list=[a-z0-9]+\\]#siU', '[/list]', $pagetext);
}
// remove extra whitespace between [list] and first element
// -- unnecessary now, bbcode parser handles leading spaces after a list tag
//$pagetext = preg_replace('#(\[list(=("|"|\'|)([^\]]*)\\3)?\])\s+#i', "\\1\n", $pagetext);
// censor main message text
$pagetext = fetch_censored_text($pagetext);
// parse URLs in message text
if ($this->info['parseurl']) {
$pagetext = convert_url_to_bbcode($pagetext);
}
// remove sessionhash from urls:
require_once DIR . '/includes/functions_login.php';
$pagetext = fetch_removed_sessionhash($pagetext);
if ($noshouting) {
$pagetext = fetch_no_shouting_text($pagetext);
}
require_once DIR . '/includes/functions_video.php';
$pagetext = parse_video_bbcode($pagetext);
return true;
}
开发者ID:cedwards-reisys,项目名称:nexus-web,代码行数:42,代码来源:datamanager.php
示例16: fetch_valid_tags
/**
* Fetch the valid tags from a list. Filters are length, censorship, perms (if desired).
*
* @param array Array of existing thread info (including the existing tags)
* @param string|array List of tags to add (comma delimited, or an array as is). If array, ensure there are no commas.
* @param array (output) List of errors that happens
* @param boolean Whether to check the browsing user's create tag perms
* @param boolean Whether to expand the error phrase
*
* @return array List of valid tags
*/
function fetch_valid_tags($threadinfo, $taglist, &$errors, $check_browser_perms = true, $evalerrors = true)
{
global $vbulletin;
static $tagbadwords, $taggoodwords;
$errors = array();
if (!is_array($taglist)) {
$taglist = split_tag_list($taglist);
}
if (!trim($threadinfo['taglist'])) {
$existing_tags = array();
} else {
// this will always be delimited by a comma
$existing_tags = explode(',', trim($threadinfo['taglist']));
}
if ($vbulletin->options['tagmaxthread'] and count($existing_tags) >= $vbulletin->options['tagmaxthread']) {
$errors['threadmax'] = $evalerrors ? fetch_error('thread_has_max_allowed_tags') : 'thread_has_max_allowed_tags';
return array();
}
if ($vbulletin->options['tagmaxlen'] <= 0 or $vbulletin->options['tagmaxlen'] >= 100) {
$vbulletin->options['tagmaxlen'] = 100;
}
$valid_raw = array();
// stop words: too common
require DIR . '/includes/searchwords.php';
// get the stop word list; allow multiple requires
// filter the stop words by adding custom stop words (tagbadwords) and allowing through exceptions (taggoodwords)
if (!is_array($tagbadwords)) {
$tagbadwords = preg_split('/\\s+/s', vbstrtolower($vbulletin->options['tagbadwords']), -1, PREG_SPLIT_NO_EMPTY);
}
if (!is_array($taggoodwords)) {
$taggoodwords = preg_split('/\\s+/s', vbstrtolower($vbulletin->options['taggoodwords']), -1, PREG_SPLIT_NO_EMPTY);
}
// merge hard-coded badwords and tag-specific badwords
$badwords = array_merge($badwords, $tagbadwords);
foreach ($taglist as $tagtext) {
$tagtext = trim(preg_replace('#[ \\r\\n\\t]+#', ' ', $tagtext));
if ($tagtext === '') {
continue;
}
if (!in_array(vbstrtolower($tagtext), $taggoodwords)) {
$char_strlen = vbstrlen($tagtext, true);
if ($vbulletin->options['tagminlen'] and $char_strlen < $vbulletin->options['tagminlen']) {
$errors['min_length'] = $evalerrors ? fetch_error('tag_too_short_min_x', $vbulletin->options['tagminlen']) : array('tag_too_short_min_x', $vbulletin->options['tagminlen']);
continue;
}
if ($char_strlen > $vbulletin->options['tagmaxlen']) {
$errors['max_length'] = $evalerrors ? fetch_error('tag_too_long_max_x', $vbulletin->options['tagmaxlen']) : array('tag_too_long_max_x', $vbulletin->options['tagmaxlen']);
continue;
}
if (strlen($tagtext) > 100) {
// only have 100 bytes to store a tag
$errors['max_length'] = $evalerrors ? fetch_error('tag_too_long_max_x', $vbulletin->options['tagmaxlen']) : array('tag_too_long_max_x', $vbulletin->options['tagmaxlen']);
continue;
}
$censored = fetch_censored_text($tagtext);
if ($censored != $tagtext) {
// can't have tags with censored text
$errors['censor'] = $evalerrors ? fetch_error('tag_no_censored') : 'tag_no_censored';
continue;
}
if (count(split_tag_list($tagtext)) > 1) {
// contains a delimiter character
$errors['comma'] = $evalerrors ? fetch_error('tag_no_comma') : 'tag_no_comma';
continue;
}
if (in_array(strtolower($tagtext), $badwords)) {
$errors['common'] = $evalerrors ? fetch_error('tag_x_not_be_common_words', $tagtext) : array('tag_x_not_be_common_words', $tagtext);
continue;
}
}
$valid_raw[] = $vbulletin->options['tagforcelower'] ? vbstrtolower($tagtext) : $tagtext;
}
// we need to essentially do a case-insensitive array_unique here
$valid_unique = array_unique(array_map('vbstrtolower', $valid_raw));
$valid = array();
foreach (array_keys($valid_unique) as $key) {
$valid[] = $valid_raw["{$key}"];
}
$valid_unique = array_values($valid_unique);
// make the keys jive with $valid
if ($valid) {
$existing_sql = $vbulletin->db->query_read("\n\t\t\tSELECT tag.tagtext, IF(tagthread.tagid IS NULL, 0, 1) AS taginthread\n\t\t\tFROM " . TABLE_PREFIX . "tag AS tag\n\t\t\tLEFT JOIN " . TABLE_PREFIX . "tagthread AS tagthread ON\n\t\t\t\t(tag.tagid = tagthread.tagid AND tagthread.threadid = " . intval($threadinfo['threadid']) . ")\n\t\t\tWHERE tag.tagtext IN ('" . implode("','", array_map(array(&$vbulletin->db, 'escape_string'), $valid)) . "')\n\t\t");
if ($check_browser_perms and !($vbulletin->userinfo['permissions']['genericpermissions'] & $vbulletin->bf_ugp_genericpermissions['cancreatetag'])) {
// can't create tags, need to throw errors about bad ones
$new_tags = array_flip($valid_unique);
while ($tag = $vbulletin->db->fetch_array($existing_sql)) {
unset($new_tags[vbstrtolower($tag['tagtext'])]);
}
if ($new_tags) {
//.........这里部分代码省略.........
开发者ID:holandacz,项目名称:nb4,代码行数:101,代码来源:functions_newpost.php
示例17: print_no_permission
if (!($forumperms & $vbulletin->bf_ugp_forumpermissions['canview']) or !($forumperms & $vbulletin->bf_ugp_forumpermissions['canviewthreads'])) {
print_no_permission();
}
if (!($forumperms & $vbulletin->bf_ugp_forumpermissions['canviewothers']) and ($threadinfo['postuserid'] != $vbulletin->userinfo['userid'] or !$vbulletin->userinfo['userid'])) {
print_no_permission();
}
$attachs = $db->query_read_slave("\n\t\tSELECT attachment.*\n\t\tFROM " . TABLE_PREFIX . "post AS post\n\t\tINNER JOIN " . TABLE_PREFIX . "attachment AS attachment ON (attachment.postid=post.postid AND attachment.visible=1)\n\t\tWHERE threadid = {$threadinfo['threadid']}\n\t\t\tAND post.visible = 1\n\t\tORDER BY filename DESC\n\t");
if ($db->num_rows($attachs)) {
require_once DIR . '/includes/functions_bigthree.php';
while ($attachment = $db->fetch_array($attachs)) {
// hide users in Coventry
$ast = '';
if (in_coventry($attachment['userid']) and !can_moderate($threadinfo['forumid'])) {
continue;
}
$attachment['filename'] = fetch_censored_text(htmlspecialchars_uni($attachment['filename']));
$attachment['attachmentextension'] = strtolower(file_extension($attachment['filename']));
$attachment['filesize'] = vb_number_format($attachment['filesize'], 1, true);
exec_switch_bg();
eval('$attachments .= "' . fetch_template('attachmentbit') . '";');
}
($hook = vBulletinHook::fetch_hook('misc_showattachments_complete')) ? eval($hook) : false;
eval('print_output("' . fetch_template('ATTACHMENTS') . '");');
} else {
eval(standard_error(fetch_error('noattachments')));
}
}
// ############################### start show avatars ###############################
if ($_REQUEST['do'] == 'showavatars') {
$vbulletin->input->clean_array_gpc('r', array('pagenumber' => TYPE_UINT));
($hook = vBulletinHook::fetch_hook('misc_avatars_start')) ? eval($hook) : false;
开发者ID:holandacz,项目名称:nb4,代码行数:31,代码来源:misc.php
示例18: strip_quotes
} else {
if (isset($simthread['preview']) and $vbulletin->options['threadpreview'] > 0) {
$simthread['preview'] = strip_quotes($simthread['preview']);
$simthread['preview'] = htmlspecialchars_uni(fetch_trimmed_title(strip_bbcode($simthread['preview'], false, true), $vbulletin->options['threadpreview']));
}
}
$simthread['lastreplydate'] = vbdate($vbulletin->options['dateformat'], $simthread['lastpost'], true);
$simthread['lastreplytime'] = vbdate($vbulletin->options['timeformat'], $simthread['lastpost']);
if ($simthread['prefixid']) {
$simthread['prefix_plain_html'] = htmlspecialchars_uni($vbphrase["prefix_{$simthread['prefixid']}_title_plain"]);
$simthread['prefix_rich'] = $vbphrase["prefix_{$simthread['prefixid']}_title_rich"];
} else {
$simthread['prefix_plain_html'] = '';
$simthread['prefix_rich'] = '';
}
$simthread['title'] = fetch_censored_text($simthread['title']);
($hook = vBulletinHook::fetch_hook('showthread_similarthreadbit')) ? eval($hook) : false;
$templater = vB_Template::create('showthread_similarthreadbit');
$templater->register('simthread', $simthread);
$similarthreadbits .= $templater->render();
}
}
if ($similarthreadbits) {
$templater = vB_Template::create('showthread_similarthreads');
$templater->register('similarthreadbits', $similarthreadbits);
$similarthreads = $templater->render();
} else {
$similarthreads = '';
}
unset($similarthreadbits);
} else {
开发者ID:0hyeah,项目名称:yurivn,代码行数:31,代码来源:showthread.php
示例19: array
if (empty($vbulletin->GPC['message']) and $vbulletin->options['uimessage'] and !$noc
|
请发表评论