本文整理汇总了PHP中fetch_tag_list函数的典型用法代码示例。如果您正苦于以下问题:PHP fetch_tag_list函数的具体用法?PHP fetch_tag_list怎么用?PHP fetch_tag_list使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了fetch_tag_list函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: _make_message_body
/**
* Формирует(но не сохраняет) тело сообщения
*
* @param array $post
* @global vB_Registry $vbulletin
* @return string
*/
protected function _make_message_body($post)
{
global $vbulletin, $foruminfo, $threadinfo;
$message = '';
if (!intval($this->_post_id)) {
return $message;
}
if (empty($post['pagetext'])) {
$post['pagetext'] = $post['message'];
}
$post['allowsmilie'] = $post['enablesmilies'];
// get attachments
require_once DIR . '/packages/vbattach/attach.php';
$attach = new vB_Attach_Display_Content($vbulletin, 'vBForum_Post');
$postattach = $attach->fetch_postattach(0, $this->_post_id);
$post['attachments'] = $postattach;
$userinfo = fetch_userinfo($post['userid']);
require_once DIR . '/includes/class_postbit.php';
$postbit_factory = new vB_Postbit_Factory();
$postbit_factory->registry =& $vbulletin;
$postbit_factory->forum =& $foruminfo;
$postbit_factory->thread =& $threadinfo;
$postbit_factory->cache = array();
$postbit_factory->bbcode_parser = new vB_BbCodeParser($vbulletin, fetch_tag_list());
$postbit_factory->bbcode_parser->set_parse_userinfo($userinfo);
$postbit_obj =& $postbit_factory->fetch_postbit('post_nntp');
$this->_body = $postbit_obj->construct_postbit($post);
return $this->_body;
}
开发者ID:rcdesign-cemetery,项目名称:vb-nntp,代码行数:36,代码来源:class_nntpgate_forum_index.php
示例2: parse_pm_bbcode
function parse_pm_bbcode($bbcode, $smilies = true)
{
global $vbulletin;
require_once DIR . '/includes/class_bbcode.php';
$bbcode_parser =& new vB_BbCodeParser($vbulletin, fetch_tag_list());
return $bbcode_parser->parse($bbcode, 'privatemessage', $smilies);
}
开发者ID:holandacz,项目名称:nb4,代码行数:7,代码来源:private.php
示例3: parse_usernote_bbcode
function parse_usernote_bbcode($bbcode, $smilies = true)
{
global $vbulletin;
require_once(DIR . '/includes/class_bbcode.php');
$bbcode_parser = new vB_BbCodeParser($vbulletin, fetch_tag_list());
return $bbcode_parser->parse($bbcode, 'usernote', $smilies);
}
开发者ID:hungnv0789,项目名称:vhtm,代码行数:8,代码来源:usernote.php
示例4: process_group_message_preview
/**
* Parse message content for preview
*
* @param array Message and disablesmilies options
*
* @return string Eval'd html for display as the preview message
*/
function process_group_message_preview($message)
{
global $vbulletin, $vbphrase, $stylevar, $show;
require_once DIR . '/includes/class_bbcode.php';
$bbcode_parser =& new vB_BbCodeParser($vbulletin, fetch_tag_list());
$previewhtml = '';
if ($previewmessage = $bbcode_parser->parse($message['message'], 'socialmessage', $message['disablesmilies'] ? 0 : 1)) {
eval('$previewhtml = "' . fetch_template('visitormessage_preview') . '";');
}
return $previewhtml;
}
开发者ID:holandacz,项目名称:nb4,代码行数:18,代码来源:functions_socialgroup.php
示例5: parse_wysiwyg_html
function parse_wysiwyg_html($html, $ishtml = 0, $forumid = 0, $allowsmilie = 1)
{
global $vbulletin;
if ($ishtml) {
// parse HTML into vbcode
// I DON'T THINK THIS IS EVER USED NOW - KIER
$html = convert_wysiwyg_html_to_bbcode($html);
} else {
$html = unhtmlspecialchars($html, 0);
}
// parse the message back into WYSIWYG-friendly HTML
require_once DIR . '/includes/class_bbcode_alt.php';
$wysiwyg_parser =& new vB_BbCodeParser_Wysiwyg($vbulletin, fetch_tag_list());
$wysiwyg_parser->set_parse_userinfo($vbulletin->userinfo);
return $wysiwyg_parser->parse($html, $forumid, $allowsmilie);
}
开发者ID:benyamin20,项目名称:vbregistration,代码行数:16,代码来源:functions_wysiwyg.php
示例6: verify_image_count
/**
* Verifies the number of images in the post text. Call it from pre_save() after pagetext/allowsmilie has been set
*
* @return bool Whether the post passes the image count check
*/
function verify_image_count($pagetext = 'pagetext', $allowsmilie = 'allowsmilie', $parsetype = 'nonforum', $table = null)
{
global $vbulletin;
$_allowsmilie =& $this->fetch_field($allowsmilie, $table);
$_pagetext =& $this->fetch_field($pagetext, $table);
if ($_allowsmilie !== null and $_pagetext !== null) {
// check max images
require_once DIR . '/includes/functions_misc.php';
require_once DIR . '/includes/class_bbcode_alt.php';
$bbcode_parser = new vB_BbCodeParser_ImgCheck($this->registry, fetch_tag_list());
$bbcode_parser->set_parse_userinfo($vbulletin->userinfo);
if ($this->registry->options['maximages'] and !$this->info['is_automated']) {
$imagecount = fetch_character_count($bbcode_parser->parse($_pagetext, $parsetype, $_allowsmilie, true), '<img');
if ($imagecount > $this->registry->options['maximages']) {
$this->error('toomanyimages', $imagecount, $this->registry->options['maximages']);
return false;
}
}
}
return true;
}
开发者ID:cedwards-reisys,项目名称:nexus-web,代码行数:26,代码来源:datamanager.php
示例7: parse_calendar_bbcode
function parse_calendar_bbcode($bbcode, $smilies = true)
{
global $calendarinfo, $vbulletin;
require_once DIR . '/includes/class_bbcode.php';
$bbcode_parser =& new vB_BbCodeParser($vbulletin, fetch_tag_list());
$bbcode = $bbcode_parser->parse($bbcode, 'calendar', $smilies);
return $bbcode;
}
开发者ID:benyamin20,项目名称:vbregistration,代码行数:8,代码来源:functions_calendar.php
示例8: fetchCmsTags
/**
* Fetches the tags that are available for this CMS BB code parser.
* Includes the default vB tags (if enabled).
*
* @return array
*/
public static function fetchCmsTags()
{
$tag_list = fetch_tag_list();
$tag_list['option']['h'] = array(
'html' => '<h%2$s>%1$s</h%2$s>',
'option_regex' => '#^[1-6]$#',
'strip_space_after' => 2,
'strip_empty' => true
);
$tag_list['no_option']['page'] = array(
'callback' => 'parsePageTag',
'strip_space_after' => 2,
'stop_parse' => true,
'disable_smilies' => true,
'strip_empty' => true
);
$tag_list['no_option']['table'] = array(
'callback' => 'parseTableTag',
'strip_space_after' => 1,
'strip_empty' => true
);
$tag_list['option']['table'] = array(
'callback' => 'parseTableTag',
'strip_space_after' => 1,
'strip_empty' => true
);
$tag_list['no_option']['hr'] = array(
'html' => '<hr />%1$s',
'strip_empty' => false
);
$tag_list['no_option']['prbreak'] = array(
'html' => '%1$s',
'strip_empty' => true
);
$tag_list['no_option']['sub'] = array(
'html' => '<sub>%1$s</sub>',
'strip_empty' => true
);
$tag_list['no_option']['sup'] = array(
'html' => '<sup>%1$s</sup>',
'strip_empty' => true
);
return $tag_list;
}
开发者ID:hungnv0789,项目名称:vhtm,代码行数:59,代码来源:html.php
示例9: prepare_signature
/**
* Prepares the User's Signature
*
*/
function prepare_signature()
{
global $show;
if ($this->userinfo['signature'] and $this->userinfo['permissions']['genericpermissions'] & $this->registry->bf_ugp_genericpermissions['canusesignature']) {
require_once DIR . '/includes/class_bbcode.php';
$bbcode_parser =& new vB_BbCodeParser($this->registry, fetch_tag_list());
$bbcode_parser->set_parse_userinfo($this->userinfo, $this->userinfo['permissions']);
$this->prepared['signature'] = $bbcode_parser->parse($this->userinfo['signature'], 'signature');
}
}
开发者ID:holandacz,项目名称:nb4,代码行数:14,代码来源:class_userprofile.php
示例10: exec_send_sg_notification
/**
* Sends email notifications for discussions.
*
* @param int $discussion - The discussion being updated
* @param int $messageid - Id of the message that triggered the update
* @param string $postusername - Optional username displayed on post
*/
function exec_send_sg_notification($discussionid, $gmid = false, $postusername = false)
{
global $vbulletin;
if (!$vbulletin->options['enableemail']) {
return;
}
$discussion = fetch_socialdiscussioninfo($discussionid);
// if there are no subscribers, no need to send notifications
if (!$discussion['subscribers']) {
return;
}
// if the discussion is moderated or deleted, don't send notification
if ('deleted' == $discussion['state'] or 'moderation' == $discussion['state']) {
return;
}
$group = fetch_socialgroupinfo($discussion['groupid']);
if (!$gmid) {
// get last gmid from discussion
$gmid = $vbulletin->db->query_first("\n\t\t\tSELECT MAX(gmid) AS gmid\n\t\t\tFROM " . TABLE_PREFIX . "groupmessage AS groupmessage\n\t\t\tWHERE discussionid = {$discussion['discussionid']}\n\t\t\t\tAND state = 'visible'\n\t\t");
$gmid = $gmid['gmid'];
}
// get message details
$gmessage = fetch_groupmessageinfo($gmid);
if (!$gmessage) {
return;
}
// get post time of previous message - if a user hasn't been active since then we won't resend a notification
$lastposttime = ($lastposttime = $vbulletin->db->query_first("\n\t\t\tSELECT MAX(dateline) AS dateline\n\t\t\tFROM " . TABLE_PREFIX . "groupmessage AS groupmessage\n\t\t\tWHERE discussionid = {$discussion['discussionid']}\n\t\t\t\tAND dateline < {$gmessage['dateline']}\n\t\t\t\tAND state = 'visible'\n\t")) ? $lastposttime['dateline'] : $gmessage['dateline'];
$discussion['title'] = unhtmlspecialchars($discussion['title']);
$group['name'] = unhtmlspecialchars($group['name']);
// temporarily use postusername in userinfo
if (!$postusername) {
// get current user name if user exists
if ($gmessage['postuserid'] and $userinfo = fetch_userinfo($gmessage['postuserid'])) {
$postusername = $userinfo['username'];
} else {
$postusername = $gmessage['postusername'];
}
}
$postusername = unhtmlspecialchars($postusername);
$userid = $gmessage['postuserid'];
($hook = vBulletinHook::fetch_hook('newpost_sg_notification_start')) ? eval($hook) : false;
$useremails = $vbulletin->db->query_read_slave("\n\t\tSELECT user.*, subscribediscussion.emailupdate, subscribediscussion.subscribediscussionid, IF(socialgroupmember.userid IS NOT NULL,1,0) ismember\n\t\tFROM " . TABLE_PREFIX . "subscribediscussion AS subscribediscussion\n\t\tINNER JOIN " . TABLE_PREFIX . "user AS user ON (subscribediscussion.userid = user.userid)\n\t\tLEFT JOIN " . TABLE_PREFIX . "usergroup AS usergroup ON (usergroup.usergroupid = user.usergroupid)\n\t\tLEFT JOIN " . TABLE_PREFIX . "usertextfield AS usertextfield ON (usertextfield.userid = user.userid)\n\t\tLEFT JOIN " . TABLE_PREFIX . "socialgroupmember AS socialgroupmember ON (socialgroupmember.userid = user.userid AND socialgroupmember.groupid = {$group['groupid']})\n\t\tWHERE subscribediscussion.discussionid = {$discussion['discussionid']}\n\t\t AND subscribediscussion.emailupdate = 1\n\t\t AND " . ($gmessage['postuserid'] ? " CONCAT(' ', IF(usertextfield.ignorelist IS NULL, '', usertextfield.ignorelist), ' ') NOT LIKE ' " . intval($userid) . " '" : '') . "\n\t\t AND user.usergroupid <> 3\n\t\t AND user.userid <> " . intval($userid) . "\n\t\t AND user.lastactivity >= " . intval($lastposttime) . "\n\t\t AND (usergroup.genericoptions & " . $vbulletin->bf_ugp_genericoptions['isnotbannedgroup'] . ")\n\t");
vbmail_start();
// parser for plaintexting the message pagetext
require_once DIR . '/includes/class_bbcode_alt.php';
$plaintext_parser =& new vB_BbCodeParser_PlainText($vbulletin, fetch_tag_list());
$pagetext_cache = array();
// used to cache the results per languageid for speed
$evalemail = array();
while ($touser = $vbulletin->db->fetch_array($useremails)) {
// check user can view discussion
$permissions = cache_permissions($touser, false);
if (!($vbulletin->usergroupcache["{$touser['usergroupid']}"]['genericoptions'] & $vbulletin->bf_ugp_genericoptions['isnotbannedgroup']) or !($permissions['forumpermissions'] & $vbulletin->bf_ugp_forumpermissions['canview']) or !($permissions['socialgrouppermissions'] & $vbulletin->bf_ugp_socialgrouppermissions['canviewgroups']) or $group['options'] & $vbulletin->bf_misc_socialgroupoptions['join_to_view'] and !$touser['ismember'] and !($permissions['socialgrouppermissions'] & $vbulletin->bf_ugp_socialgrouppermissions['canalwayscreatediscussion']) and !($permissions['socialgrouppermissions'] & $vbulletin->bf_ugp_socialgrouppermissions['canalwayspostmessage'])) {
continue;
}
$touser['username'] = unhtmlspecialchars($touser['username']);
$touser['languageid'] = iif($touser['languageid'] == 0, $vbulletin->options['languageid'], $touser['languageid']);
$touser['auth'] = md5($touser['userid'] . $touser['subscribediscussionid'] . $touser['salt'] . COOKIE_SALT);
if (empty($evalemail)) {
$email_texts = $vbulletin->db->query_read_slave("\n\t\t\t\tSELECT text, languageid, fieldname\n\t\t\t\tFROM " . TABLE_PREFIX . "phrase\n\t\t\t\tWHERE fieldname IN ('emailsubject', 'emailbody') AND varname = 'notify_discussion'\n\t\t\t");
while ($email_text = $vbulletin->db->fetch_array($email_texts)) {
$emails["{$email_text['languageid']}"]["{$email_text['fieldname']}"] = $email_text['text'];
}
require_once DIR . '/includes/functions_misc.php';
foreach ($emails as $languageid => $email_text) {
// lets cycle through our array of notify phrases
$text_message = str_replace("\\'", "'", addslashes(iif(empty($email_text['emailbody']), $emails['-1']['emailbody'], $email_text['emailbody'])));
$text_message = replace_template_variables($text_message);
$text_subject = str_replace("\\'", "'", addslashes(iif(empty($email_text['emailsubject']), $emails['-1']['emailsubject'], $email_text['emailsubject'])));
$text_subject = replace_template_variables($text_subject);
$evalemail["{$languageid}"] = '
$message = "' . $text_message . '";
$subject = "' . $text_subject . '";
';
}
}
// parse the page text into plain text, taking selected language into account
if (!isset($pagetext_cache["{$touser['languageid']}"])) {
$plaintext_parser->set_parsing_language($touser['languageid']);
$pagetext_cache["{$touser['languageid']}"] = $plaintext_parser->parse($gmessage['pagetext']);
}
$pagetext = $pagetext_cache["{$touser['languageid']}"];
($hook = vBulletinHook::fetch_hook('new_sg_message_notification_message')) ? eval($hook) : false;
eval(iif(empty($evalemail["{$touser['languageid']}"]), $evalemail["-1"], $evalemail["{$touser['languageid']}"]));
vbmail($touser['email'], $subject, $message);
}
$vbulletin->db->free_result($useremails);
unset($plaintext_parser, $pagetext_cache);
vbmail_end();
}
开发者ID:benyamin20,项目名称:vbregistration,代码行数:98,代码来源:functions_socialgroup.php
示例11: renderResult
//.........这里部分代码省略.........
" . iif( vB::$vbulletin->options['avatarenabled'], "LEFT JOIN " . TABLE_PREFIX . "avatar AS avatar ON(avatar.avatarid = user.avatarid) LEFT JOIN " . TABLE_PREFIX . "customavatar AS customavatar ON(customavatar.userid = user.userid)") . "
" . ((can_moderate($thread['forumid'], 'canmoderateposts') OR can_moderate($thread['forumid'], 'candeleteposts')) ? "LEFT JOIN " . TABLE_PREFIX . "spamlog AS spamlog ON(spamlog.postid = post.postid)" : '') . "
$deljoin
LEFT JOIN " . TABLE_PREFIX . "editlog AS editlog ON(editlog.postid = post.postid)
LEFT JOIN " . TABLE_PREFIX . "postparsed AS postparsed ON(postparsed.postid = post.postid AND postparsed.styleid = " . intval(STYLEID) . " AND postparsed.languageid = " . intval(LANGUAGEID) . ")
LEFT JOIN " . TABLE_PREFIX . "sigparsed AS sigparsed ON(sigparsed.userid = user.userid AND sigparsed.styleid = " . intval(STYLEID) . " AND sigparsed.languageid = " . intval(LANGUAGEID) . ")
LEFT JOIN " . TABLE_PREFIX . "sigpic AS sigpic ON(sigpic.userid = post.userid)
LEFT JOIN " . TABLE_PREFIX . "customprofilepic AS customprofilepic ON (user.userid = customprofilepic.userid)
$hook_query_joins
WHERE $postids
ORDER BY post.dateline
");
if (!($forumperms & vB::$vbulletin->bf_ugp_forumpermissions['canseethumbnails']) AND !($forumperms & vB::$vbulletin->bf_ugp_forumpermissions['cangetattachment']))
{
vB::$vbulletin->options['attachthumbs'] = 0;
}
if (!($forumperms & vB::$vbulletin->bf_ugp_forumpermissions['cangetattachment']))
{
vB::$vbulletin->options['viewattachedimages'] = 0;
}
$postcount = count($postid_array);
$counter = 0;
$postbits = '';
vB::$vbulletin->noheader = true;
$postbit_factory = new vB_Postbit_Factory();
$postbit_factory->registry = vB::$vbulletin;
$postbit_factory->forum = $foruminfo;
$postbit_factory->thread = $thread;
$postbit_factory->cache = array();
$postbit_factory->bbcode_parser = new vB_BbCodeParser( vB::$vbulletin, fetch_tag_list());
//We need to tell the parser to handle quotes differently.
$postbit_factory->bbcode_parser->set_quote_template('vbcms_bbcode_quote');
$postbit_factory->bbcode_parser->set_quote_vars(array('page_url' => $target_url .
(strpos($target_url, '?') == false ? '?' : '&')));
$show['return_node'] = $nodeid;
$show['avatar'] = 1;
while ($post = vB::$vbulletin->db->fetch_array($posts))
{
if (! self::canViewPost($post, $permissions) )
{
continue;
}
if (! intval($post['userid']))
{
$post['avatarid'] = false;
}
else if (!$post['hascustomavatar'])
{
if ($post['profilepic'])
{
$post['hascustomavatar'] = 1;
$post['avatarid'] = true;
$post['avatarpath'] = "./image.php?u=" . $post['userid'] . "&dateline=" . $post['profilepicdateline'] . "&type=profile";
$post['avwidth'] = $post['ppwidth'];
$post['avheight'] = $post['ppheight'];
}
else
{
$post['hascustomavatar'] = 1;
$post['avatarid'] = true;
开发者ID:hungnv0789,项目名称:vhtm,代码行数:67,代码来源:comments.php
示例12: verify_blog_customblock
require_once DIR . '/includes/blog_functions_usercp.php';
$blockinfo = verify_blog_customblock($vbulletin->GPC['cp'], 'page');
if ($blockinfo['type'] == 'block' and !$blockinfo['userinfo']['permissions']['vbblog_customblocks'] or $blockinfo['type'] == 'page' and !$blockinfo['userinfo']['permissions']['vbblog_custompages']) {
if (!can_moderate_blog('caneditcustomblocks')) {
print_no_permission();
}
$show['reportlink'] = false;
} else {
$show['reportlink'] = true;
}
track_blog_visit($blockinfo['userinfo']['userid']);
$show['reportlink'] = ($show['reportlink'] and $vbulletin->userinfo['userid'] and ($vbulletin->options['rpforumid'] or $vbulletin->options['enableemail'] and $vbulletin->options['rpemail']));
$show['edit'] = (can_moderate_blog('caneditcustomblocks') or $vbulletin->userinfo['userid'] == $blockinfo['userid']);
// Parse Content here
require_once DIR . '/includes/class_bbcode_blog.php';
$bbcode = new vB_BbCodeParser_Blog($vbulletin, fetch_tag_list());
$bbcode->set_parse_userinfo($blockinfo['userinfo'], $blockinfo['userinfo']['permissions']);
$blockinfo['page'] = $bbcode->parse($blockinfo['pagetext'], 'blog_user', $blockinfo['allowsmilie'] ? 1 : 0);
$blogheader = parse_blog_description($blockinfo['userinfo'], $blockinfo);
$sidebar =& build_user_sidebar($blockinfo['userinfo']);
$navbits[] = $blockinfo['title'];
$templater = vB_Template::create('blog_custompage');
$templater->register('blogheader', $blogheader);
$templater->register('blockinfo', $blockinfo);
$content = $templater->render();
}
// build navbar
if (empty($navbits)) {
$navbits = array('blog.php' . $vbulletin->session->vars['sessionurl_q'] => $vbphrase['blogs'], '' => '');
} else {
$navbits = array_merge(array('blog.php' . $vbulletin->session->vars['sessionurl_q'] => $vbphrase['blogs']), $navbits);
开发者ID:Kheros,项目名称:MMOver,代码行数:31,代码来源:blog.php
示例13: exec_digest
function exec_digest($type = 2)
{
// type = 2 : daily
// type = 3 : weekly
$lastdate = mktime(0, 0);
// midnight today
if ($type == 2) {
// daily
// yesterday midnight
$lastdate -= 24 * 60 * 60;
} else {
// weekly
// last week midnight
$lastdate -= 7 * 24 * 60 * 60;
}
if (trim(vB::getDatastore()->getOption('globalignore')) != '') {
$coventry = preg_split('#\\s+#s', vB::getDatastore()->getOption('globalignore'), -1, PREG_SPLIT_NO_EMPTY);
} else {
$coventry = array();
}
require_once DIR . '/includes/class_bbcode_alt.php';
$vbulletin =& vB::get_registry();
$plaintext_parser = new vB_BbCodeParser_PlainText($vbulletin, fetch_tag_list());
vB_Mail::vbmailStart();
$bf_misc_useroptions = vB::get_datastore()->get_value('bf_misc_useroptions');
$bf_ugp_genericoptions = vB::get_datastore()->get_value('bf_ugp_genericoptions');
$bf_ugp_forumpermissions = vB::get_datastore()->get_value('bf_ugp_forumpermissions');
// we want to fetch all language records at once and using cache if possible
$defaultLanguage = false;
$languageIds = array();
// get new threads (Topic Subscription)
$threads = vB::getDbAssertor()->getRows('getNewThreads', array('dstonoff' => $bf_misc_useroptions['dstonoff'], 'hasaccessmask' => $bf_misc_useroptions['hasaccessmask'], 'isnotbannedgroup' => $bf_ugp_genericoptions['isnotbannedgroup'], 'lastdate' => intval($lastdate)));
// grab all forums / subforums for given subscription (Channel Subscription)
$forums = vB::getDbAssertor()->assertQuery('getNewForums', array('dstonoff' => $bf_misc_useroptions['dstonoff'], 'hasaccessmask' => $bf_misc_useroptions['hasaccessmask'], 'type' => intval($type), 'lastdate' => intval($lastdate), 'channelcontenttype' => vB_Api::instanceInternal('contenttype')->fetchContentTypeIdFromClass('Channel'), 'isnotbannedgroup' => $bf_ugp_genericoptions['isnotbannedgroup']));
// Let's see which languageids we wanna fetch
foreach ($threads as $thread) {
if ($thread['languageid'] == 0) {
if (!$defaultLanguage) {
$defaultLanguage = intval(vB::getDatastore()->getOption('languageid'));
$languageIds[] = $defaultLanguage;
}
} else {
$languageIds[] = $thread['languageid'];
}
}
foreach ($forums as $forum) {
if ($forum['languageid'] == 0) {
if (!$defaultLanguage) {
$defaultLanguage = intval(vB::getDatastore()->getOption('languageid'));
$languageIds[] = $defaultLanguage;
}
} else {
$languageIds[] = $forum['languageid'];
}
}
// fetch languages
$languages = vB_Library::instance('language')->fetchLanguages($languageIds);
// process threads
foreach ($threads as $thread) {
$postbits = '';
// Make sure user have correct email notification settings.
if ($thread['emailnotification'] != $type) {
continue;
}
if ($thread['lastauthorid'] != $thread['userid'] and in_array($thread['lastauthorid'], $coventry)) {
continue;
}
$usercontext = vB::getUserContext($thread['userid']);
if (!$usercontext->getChannelPermission('forumpermissions', 'canview', $thread['nodeid']) or !$usercontext->getChannelPermission('forumpermissions', 'canviewthreads', $thread['nodeid']) or $thread['lastauthorid'] != $thread['userid'] and !$usercontext->getChannelPermission('forumpermissions', 'canviewothers', $thread['nodeid'])) {
continue;
}
$langInfo =& $languages[$thread['languageid']];
$userinfo = array('lang_locale' => $langInfo['locale'], 'dstonoff' => $thread['dstonoff'], 'timezoneoffset' => $thread['timezoneoffset']);
$thread['lastreplydate'] = vbdate($langInfo['dateoverride'] ? $langInfo['dateoverride'] : vB::getDatastore()->getOption('dateformat'), $thread['lastcontent'], false, true, true, false, $userinfo);
$thread['lastreplytime'] = vbdate($langInfo['timeoverride'] ? $langInfo['timeoverride'] : vB::getDatastore()->getOption('timeformat'), $thread['lastcontent'], false, true, true, false, $userinfo);
$thread['htmltitle'] = unhtmlspecialchars($thread['htmltitle']);
$thread['username'] = unhtmlspecialchars($thread['username']);
$thread['postusername'] = unhtmlspecialchars($thread['authorname']);
$thread['lastposter'] = unhtmlspecialchars($thread['lastcontentauthor']);
$thread['newposts'] = 0;
//not currently used and probably needs rethinking, but don't want to remove until this code gets rewritten
//$thread['auth'] = md5($thread['userid'] . $thread['subscribediscussionid'] . $thread['secret'] . vB_Request_Web::$COOKIE_SALT);
if ($thread['prefixid']) {
// need prefix in correct language
$phraseAux = vB_Api::instanceInternal('phrase')->fetch(array("prefix_{$thread['prefixid']}_title_plain"));
$thread['prefix_plain'] = $phraseAux["prefix_{$thread['prefixid']}_title_plain"] . ' ';
} else {
$thread['prefix_plain'] = '';
}
// Note: closure.depth = 1 on the where clause means getNewPosts only grabs replies, not comments.
// get posts
$posts = vB::getDbAssertor()->getRows('getNewPosts', array('threadid' => intval($thread['nodeid']), 'lastdate' => intval($lastdate)));
// compile
$haveothers = false;
foreach ($posts as $post) {
if ($post['userid'] != $thread['userid'] and in_array($post['userid'], $coventry)) {
continue;
}
if ($post['userid'] != $thread['userid']) {
$haveothers = true;
//.........这里部分代码省略.........
开发者ID:cedwards-reisys,项目名称:nexus-web,代码行数:101,代码来源:functions_digest.php
示例14: prepare_output
//.........这里部分代码省略.........
}
if ($blogids)
{
// Query Attachments
if ($attachcount)
{
require_once(DIR . '/packages/vbattach/attach.php');
$attach = new vB_Attach_Display_Content($this->registry, 'vBBlog_BlogEntry');
$postattach = $attach->fetch_postattach(0, $blogids);
}
$this->block_data['lastblogtitle'] = $this->profile->userinfo['lastblogtitle'];
$this->block_data['lastblogdate'] = vbdate($this->registry->options['dateformat'], $this->profile->userinfo['lastblog']);
$this->block_data['lastblogtime'] = vbdate($this->registry->options['timeformat'], $this->profile->userinfo['lastblog'], true);
$categories = array();
$cats = $this->registry->db->query_read_slave("
SELECT blogid, title, blog_category.blogcategoryid, blog_categoryuser.userid, blog_category.userid AS creatorid
FROM " . TABLE_PREFIX . "blog_categoryuser AS blog_categoryuser
LEFT JOIN " . TABLE_PREFIX . "blog_category AS blog_category ON (blog_category.blogcategoryid = blog_categoryuser.blogcategoryid)
WHERE blogid IN (" . implode(',', $blogids) . ")
ORDER BY blogid, displayorder
");
while ($cat = $this->registry->db->fetch_array($cats))
{
$categories["$cat[blogid]"][] = $cat;
}
require_once(DIR . '/includes/class_bbcode_blog.php');
require_once(DIR . '/includes/class_blog_entry.php');
$bbcode = new vB_BbCodeParser_Blog_Snippet($this->registry, fetch_tag_list());
$factory = new vB_Blog_EntryFactory($this->registry, $bbcode, $categories);
$first = true;
// Last Five Entries
$entries = $this->registry->db->query_read_slave("
SELECT blog.*, blog.options AS blogoptions, blog_text.pagetext, blog_text.allowsmilie, blog_text.ipaddress, blog_text.reportthreadid,
blog_text.ipaddress AS blogipaddress,
user.*, userfield.*, usertextfield.*
" . (($this->registry->options['threadvoted'] AND $this->registry->userinfo['userid']) ? ', blog_rate.vote' : '') . "
" . (!($this->registry->userinfo['permissions']['genericpermissions'] & $this->registry->bf_ugp_genericpermissions['canseehiddencustomfields']) ? $this->registry->profilefield['hidden'] : "") . "
" . (($this->registry->options['threadmarking'] AND $this->registry->userinfo['userid']) ? ", blog_read.readtime AS blogread, blog_userread.readtime AS bloguserread" : "") . "
FROM " . TABLE_PREFIX . "blog AS blog
INNER JOIN " . TABLE_PREFIX . "blog_text AS blog_text ON (blog_text.blogtextid = blog.firstblogtextid)
LEFT JOIN " . TABLE_PREFIX . "user AS user ON (blog.userid = user.userid)
LEFT JOIN " . TABLE_PREFIX . "userfield AS userfield ON(userfield.userid = user.userid)
LEFT JOIN " . TABLE_PREFIX . "usertextfield AS usertextfield ON(usertextfield.userid = user.userid)
" . (($this->registry->options['threadmarking'] AND $this->registry->userinfo['userid']) ? "
LEFT JOIN " . TABLE_PREFIX . "blog_read AS blog_read ON (blog_read.blogid = blog.blogid AND blog_read.userid = " . $this->registry->userinfo['userid'] . ")
LEFT JOIN " . TABLE_PREFIX . "blog_userread AS blog_userread ON (blog_userread.bloguserid = blog.userid AND blog_userread.userid = " . $this->registry->userinfo['userid'] . ")
" : "") . "
" . (($this->registry->options['threadvoted'] AND $this->registry->userinfo['userid']) ? "LEFT JOIN " . TABLE_PREFIX . "blog_rate AS blog_rate ON (blog_rate.blogid = blog.blogid AND blog_rate.userid = " . $this->registry->userinfo['userid'] . ")" : '') . "
WHERE blog.blogid IN (" . implode(',', $blogids) . ")
ORDER BY blog.dateline DESC
LIMIT 5
");
while ($blog = $this->registry->db->fetch_array($entries))
{
if ($first)
{
$show['latestentry'] = true;
$first = false;
}
开发者ID:hungnv0789,项目名称:vhtm,代码行数:67,代码来源:class_profileblock_blog.php
示例15: array
}
if ($edit_discussion) {
$dataman->setr('title', $message['title']);
}
$message['pagetext'] = $message['message'];
$message['postusername'] = $vbulletin->userinfo['username'];
$dataman->set_info('preview', $vbulletin->GPC['preview']);
$dataman->setr('pagetext', $message['pagetext']);
$dataman->set('allowsmilie', !$message['disablesmilies']);
$dataman->pre_save();
if ($vbulletin->GPC['fromquickcomment'] and $vbulletin->GPC['preview']) {
$dataman->errors = array();
}
// Visitor Messages and Group Messages share the same restrictive bbcode set because of this...
require_once DIR . '/includes/class_socialmessageparser.php';
$pmparser = new vB_GroupMessageParser($vbulletin, fetch_tag_list());
$pmparser->parse($message['message']);
if ($error_num = count($pmparser->errors)) {
foreach ($pmparser->errors as $tag => $error_phrase) {
$dataman->errors[] = fetch_error($error_phrase, $tag);
}
}
if (!empty($dataman->errors)) {
if ($vbulletin->GPC['ajax']) {
require_once DIR . '/includes/class_xml.php';
$xml = new vB_AJAX_XML_Builder($vbulletin, 'text/xml');
$xml->add_group('errors');
foreach ($dataman->errors as $error) {
$xml->add_tag('error', $error);
}
$xml->close_group();
开发者ID:benyamin20,项目名称:vbregistration,代码行数:31,代码来源:group.php
示例16: process_visitor_message_preview
/**
* Parse message content for preview
*
* @param array Message and disablesmilies options
*
* @return string Eval'd html for display as the preview message
*/
function process_visitor_message_preview($message)
{
global $vbulletin, $vbphrase, $show;
require_once DIR . '/includes/class_bbcode.php';
$bbcode_parser = new vB_BbCodeParser($vbulletin, fetch_tag_list());
$previewhtml = '';
if ($previewmessage = $bbcode_parser->parse($message['message'], 'socialmessage', $message['disablesmilies'] ? 0 : 1)) {
$templater = vB_Template::create('visitormessage_preview');
$templater->register('errorlist', $errorlist);
$templater->register('message', $message);
$templater->register('newpost', $newpost);
$templater->register('previewmessage', $previewmessage);
$previewhtml = $templater->render();
}
return $previewhtml;
}
开发者ID:cedwards-reisys,项目名称:nexus-web,代码行数:23,代码来源:functions_visitormessage.php
示例17: define
$donetest = 1;
$_REQUEST['do'] = 'modify';
}
// ########################################################################
if ($_REQUEST['do'] == 'previewbbcode') {
define('NO_CP_COPYRIGHT', true);
$vbulletin->input->clean_array_gpc('r', array('bbcodeid' => TYPE_UINT));
if ($bbcode = $vbulletin->db->query_first("SELECT * FROM " . TABLE_PREFIX . "bbcode WHERE bbcodeid = " . $vbulletin->GPC['bbcodeid'])) {
$parser = new vB_BbCodeParser($vbulletin, fetch_tag_list());
$parsed_code = $parser->do_parse($bbcode['bbcodeexample'], false, false, true, false, true);
echo $parsed_code;
}
}
// ####################################### MODIFY #####################################
if ($_REQUEST['do'] == 'modify') {
$parser = new vB_BbCodeParser($vbulletin, fetch_tag_list());
$bbcodes = $db->query_read("SELECT * FROM " . TABLE_PREFIX . "bbcode");
print_form_header('bbcode', 'add');
print_table_header($vbphrase['bb_code_manager'], 6);
print_cells_row(array($vbphrase['title'], $vbphrase['bb_code'], $vbphrase['html'], $vbphrase['replacement'], $vbphrase['button_image'], $vbphrase['controls']), 1, '', -5);
while ($bbcode = $db->fetch_array($bbcodes)) {
$class = fetch_row_bgclass();
$altclass = iif($class == 'alt1', 'alt2', 'alt1');
$parsed_code = $parser->do_parse($bbcode['bbcodeexample'], false, false, true, false, true);
$cell = array("<b>{$bbcode['title']}</b>", "<div class=\"{$altclass}\" style=\"padding:2px; border:solid 1px; width:200px; height:75px; overflow:auto\"><span class=\"smallfont\">" . htmlspecialchars_uni($bbcode['bbcodeexample']) . '</span></div>', "<div class=\"{$altclass}\" style=\"padding:2px; border:solid 1px; width:200px; height:75px; overflow:auto\"><span class=\"smallfont\">" . htmlspecialchars_uni($parsed_code) . '</span></div>', '<iframe src="bbcode.php?do=previewbbcode&bbcodeid=' . $bbcode['bbcodeid'] . '" style="width:200px; height:75px;"></iframe>');
if ($bbcode['buttonimage']) {
$src = $bbcode['buttonimage'];
if (!preg_match('#^[a-z]+://#i', $src) and $src[0] != '/') {
$src = "../{$src}";
}
$cell[] = "<img style=\"background:buttonface; border:solid 1px highlight\" src=\"{$src}\" alt=\"\" />";
开发者ID:benyamin20,项目名称:vbregistration,代码行数:31,代码来源:bbcode.php
示例18: prepare_output
/**
* Prepare any data needed for the output
*
* @param string The id of the block
* @param array Options specific to the block
*/
function prepare_output($id = '', $options = array())
{
global $show, $vbphrase, $vbulletin, $userperms, $permissions;
if ($vbulletin->options['reputationenable'] and ($this->profile->userinfo['showreputation'] or !($userperms['genericpermissions'] & $vbulletin->bf_ugp_genericpermissions['canhiderep']))) {
$reputations = $vbulletin->db->query_read_slave("\n\t\t\t\tSELECT user.username, reputation.whoadded, reputation.postid, thread.title, thread.forumid, post.threadid,\n\t\t\t\treputation.reputation, reputation.reason, reputation.dateline, thread.postuserid, reputation.reputationid\n\t\t\t\tFROM " . TABLE_PREFIX . "reputation AS reputation\n\t\t\t\tLEFT JOIN " . TABLE_PREFIX . "post AS post USING (postid)\n\t\t\t\tLEFT JOIN " . TABLE_PREFIX . "thread AS thread USING (threadid)\n\t\t\t\tLEFT JOIN " . TABLE_PREFIX . "user AS user ON (user.userid = reputation.whoadded)\n\t\t\t\tWHERE reputation.userid = " . $this->profile->userinfo['userid'] . "\n\t\t\t\tAND thread.visible = 1 AND post.visible = 1\n\t\t\t\tORDER BY reputation.dateline DESC\n\t\t\t");
$this->block_data['reputation'] = array();
if ($vbulletin->userinfo['userid'] == $this->profile->userinfo['userid']) {
$options['showraters'] = true;
}
require_once DIR . '/includes/class_bbcode.php';
$bbcode_parser = new vB_BbCodeParser($vbulletin, fetch_tag_list());
while ($reputation = $vbulletin->db->fetch_array($reputations) and $this->count < $options['comments']) {
$forumperms = fetch_permissions($reputation['forumid']);
if ($forumperms & $vbulletin->bf_ugp_forumpermissions['canview'] and $forumperms & $vbulletin->bf_ugp_forumpermissions['canviewthreads'] and ($forumperms & $vbulletin->bf_ugp_forumpermissions['canviewothers'] or $reputation['postuserid'] == $vbulletin->userinfo['userid'])) {
$this->count++;
if ($reputation['reputation'] > 0) {
$reputation['posneg'] = 'pos';
} else {
if ($reputation['reputation'] < 0) {
$reputation['posneg'] = 'neg';
} else {
$reputation['posneg'] = 'balance';
}
}
$reputation['postinfo'] = array('p' => $reputation['postid']);
$reputation['threadinfo'] = array('title' => $reputation['title'], 'threadid' => $reputation['threadid']);
$reputation['timestamp'] = $reputation['dateline'];
$reputation['showraters'] = $options['showraters'];
$reputation['timeline'] = vbdate($vbulletin->options['timeformat'], $reputation['dateline']);
$reputation['dateline'] = vbdate($vbulletin->options['dateformat'], $reputation['dateline']);
$reputation['reason'] = $bbcode_parser->parse($reputation['reason']);
$reputation['username'] = $reputation['username'] ? $reputation['username'] : $vbphrase['n_a'];
if (empty($reputation['reason'])) {
$reputation['reason'] = $vbphrase['no_comment'];
}
($hook = vBulletinHook::fetch_hook('member_profileblock_reputationbit')) ? eval($hook) : false;
$this->block_data['reputation'][] = $reputation;
}
}
}
}
开发者ID:0hyeah,项目名称:yurivn,代码行数:47,代码来源:class_profileblock.php
示例1 |
请发表评论