本文整理汇总了PHP中fetch_email_phrases函数的典型用法代码示例。如果您正苦于以下问题:PHP fetch_email_phrases函数的具体用法?PHP fetch_email_phrases怎么用?PHP fetch_email_phrases使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了fetch_email_phrases函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: exec_strike_user
function exec_strike_user($username = '')
{
global $vbulletin, $strikes;
if (!$vbulletin->options['usestrikesystem']) {
return 0;
}
if (!empty($username)) {
$strikes_user = $vbulletin->db->query_first("\n\t\t\tSELECT COUNT(*) AS strikes\n\t\t\tFROM " . TABLE_PREFIX . "strikes\n\t\t\tWHERE strikeip = '" . $vbulletin->db->escape_string(IPADDRESS) . "'\n\t\t\t\tAND username = '" . $vbulletin->db->escape_string(htmlspecialchars_uni($username)) . "'\n\t\t");
if ($strikes_user['strikes'] == 4) {
if ($user = $vbulletin->db->query_first("SELECT userid, username, email, languageid FROM " . TABLE_PREFIX . "user WHERE username = '" . $vbulletin->db->escape_string($username) . "' AND usergroupid <> 3")) {
$ip = IPADDRESS;
eval(fetch_email_phrases('accountlocked', $user['languageid']));
vbmail($user['email'], $subject, $message, true);
}
}
}
/*insert query*/
$vbulletin->db->query_write("\n\t\tINSERT INTO " . TABLE_PREFIX . "strikes\n\t\t(striketime, strikeip, username)\n\t\tVALUES\n\t\t(" . TIMENOW . ", '" . $vbulletin->db->escape_string(IPADDRESS) . "', '" . $vbulletin->db->escape_string(htmlspecialchars_uni($username)) . "')\n\t");
$strikes++;
($hook = vBulletinHook::fetch_hook('login_strikes')) ? eval($hook) : false;
}
示例2: send_issue_assignment_notification
/**
* Sends assignment notification when a user is assigned
*
* @param integer Issueid to send notification for
* @param integer User who is being assigned this issue
* @param integer User who assigned this issue
*/
function send_issue_assignment_notification($issueid, $assignee, $assigner)
{
global $vbulletin, $vbphrase;
$issue = fetch_issue_info($issueid);
// invalid issue
if (!$issue) {
return;
}
// no need for notification to yourself
if ($assignee == $assigner) {
return;
}
$project = fetch_project_info($issue['projectid']);
$assignee_userinfo = fetch_userinfo($assignee);
if (verify_issue_perms($issue, $assignee_userinfo) === false) {
return;
}
$assigner_userinfo = fetch_userinfo($assigner);
$issue['title'] = unhtmlspecialchars($issue['title']);
$project['title'] = unhtmlspecialchars($project['title']);
$assignee_userinfo['username'] = unhtmlspecialchars($assignee_userinfo['username']);
$assigner_userinfo['username'] = unhtmlspecialchars($assigner_userinfo['username']);
eval(fetch_email_phrases('pt_issueassignment', $assignee_userinfo['languageid']));
vbmail($assignee_userinfo['email'], $subject, $message, true);
}
示例3: email_moderators
function email_moderators($fields)
{
if ($this->info['skip_moderator_email'] or !$this->info['forum'] or in_coventry($this->fetch_field('userid', 'post'), true)) {
return;
}
$mod_emails = fetch_moderator_newpost_emails($fields, $this->info['forum']['parentlist'], $newpost_lang);
if (!empty($mod_emails)) {
$foruminfo = $this->info['forum'];
$foruminfo['title_clean'] = unhtmlspecialchars($foruminfo['title_clean']);
$threadinfo = fetch_threadinfo($this->fetch_field('threadid'));
require_once DIR . '/includes/class_bbcode_alt.php';
$plaintext_parser =& new vB_BbCodeParser_PlainText($this->registry, fetch_tag_list());
$email = $this->info['user']['email'] ? $this->info['user']['email'] : $this->registry->userinfo['email'];
$browsing_user = $this->registry->userinfo['username'];
// ugly hack -- should be fixed in the future
$this->registry->userinfo['username'] = unhtmlspecialchars($this->info['user']['username'] ? $this->info['user']['username'] : $this->registry->userinfo['username']);
$post = array_merge($this->existing, $this->post);
if (!$post['postid']) {
$post['postid'] = $this->thread['firstpostid'];
}
require_once DIR . '/includes/functions_misc.php';
foreach ($mod_emails as $toemail) {
if ($toemail != $email) {
$plaintext_parser->set_parsing_language(isset($newpost_lang["{$toemail}"]) ? $newpost_lang["{$toemail}"] : 0);
$post['message'] = $plaintext_parser->parse($this->post['pagetext'], $foruminfo['forumid']);
if ($threadinfo['prefixid']) {
// need prefix in correct language
$threadinfo['prefix_plain'] = fetch_phrase("prefix_{$threadinfo['prefixid']}_title_plain", 'global', '', false, true, isset($newpost_lang["{$toemail}"]) ? $newpost_lang["{$toemail}"] : 0, false) . ' ';
} else {
$threadinfo['prefix_plain'] = '';
}
eval(fetch_email_phrases('moderator', iif(isset($newpost_lang["{$toemail}"]), $newpost_lang["{$toemail}"], 0)));
vbmail($toemail, $subject, $message);
}
}
// back to normal
$this->registry->userinfo['username'] = htmlspecialchars_uni($browsing_user);
}
}
示例4: createUser
/**
* For registration without existing account, create a new vb user
* If a user is successfully created, her userid is written to $userid
*/
private function createUser($data, &$userid)
{
global $vbulletin;
$moderated = $vbulletin->options['moderatenewmembers'];
$languageid = $vbulletin->userinfo['languageid'];
$require_activation = $vbulletin->options['verifyemail'] && $data['default_email'] != $data['coded_email'];
// Create a vB user with default permissions -- code from register.php
if (!$vbulletin->options['allowregistration']) {
eval(standard_error(fetch_error('noregister')));
}
// Init user datamanager class
$userdata =& datamanager_init('User', $vbulletin, ERRTYPE_SILENT);
$userdata->set_info('coppauser', false);
$userdata->set_info('coppapassword', '');
$userdata->set_bitfield('options', 'coppauser', '');
$userdata->set('username', $data['username']);
$userdata->set('password', md5($this->genPasswd()));
$userdata->set('email', $data['email']);
$userdata->set('languageid', $languageid);
$userdata->set('ipaddress', IPADDRESS);
// UserGroupId: Registered Users (2) or Users Awaiting Email Confirmation (3)
$userdata->set('usergroupid', $require_activation ? 3 : 2);
$userdata->set_usertitle('', false, $vbulletin->usergroupcache["{$newusergroupid}"], false, false);
$userdata->presave_called = true;
// If any error happened, we abort and return the error message(s)
if ($userdata->has_errors(false)) {
// $die := false
return join('</li><li>', $userdata->errors);
}
// Save the data
$userid = $userdata->save();
// Did we get a valid vb userid?
if (!$userid) {
return 'vbnexus_registration_failed';
}
// If the user changed the email given by the external service, we follow
// the regular steps for email activation
if ($require_activation) {
// Email phrase 'activateaccount' expects vars called $userid, $username
// and $activateid to be defined and meaningfull
$username = $data['username'];
$activateid = build_user_activation_id($userid, $moderated ? 4 : 2, 0);
eval(fetch_email_phrases('activateaccount', $languageid));
// After eval'ing activateaccount we have vars $subject and $message set
vbmail($data['email'], $subject, $message, true);
}
// Force a new session to prevent potential issues with guests from the same IP, see bug #2459
$vbulletin->session->created = false;
return true;
}
示例5: vB_BbCodeParser_PlainText
// Email User
require_once DIR . '/includes/class_bbcode_alt.php';
$plaintext_parser =& new vB_BbCodeParser_PlainText($vbulletin, fetch_tag_list());
$plaintext_parser->set_parsing_language($touserinfo['languageid']);
$infraction = array('username' => unhtmlspecialchars($userinfo['username']), 'reason' => $infractionlevel['infractionlevelid'] ? fetch_phrase('infractionlevel' . $infractionlevel['infractionlevelid'] . '_title', 'infractionlevel', '', true, true, $userinfo['languageid']) : $vbulletin->GPC['customreason'], 'message' => &$vbulletin->GPC['message'], 'points' => $infdata->fetch_field('points'));
$emailsubphrase = $infraction['points'] > 0 ? 'infraction_received' : 'warning_received';
// if we have a specific post we can link to, link to it
if (!empty($postinfo)) {
$infraction['post'] = $vbulletin->options['bburl'] . "/showthread.php?p={$postinfo['postid']}#post{$postinfo['postid']}";
$infraction['pagetext'] =& $postinfo['pagetext'];
$emailphrase = $emailsubphrase . '_post';
} else {
$infraction['post'] = '';
$emailphrase = $emailsubphrase . '_profile';
}
eval(fetch_email_phrases($emailphrase, $userinfo['languageid'], $emailsubphrase));
$message = $plaintext_parser->parse($message, 'privatemessage');
vbmail($userinfo['email'], $subject, $message);
}
} else {
if (!empty($errors)) {
// include useful functions
require_once DIR . '/includes/functions_newpost.php';
$postpreview = construct_errors(array_map('fetch_error', $errors));
define('PMPREVIEW', 1);
}
}
}
if (!defined('PMPREVIEW')) {
// trim the message so it's not too long
if ($vbulletin->options['postmaxchars'] > 0) {
示例6: send_moderator_email
/**
* Sends emails to a moderator regarding the report
*
* @param array Information regarding the moderator to send the email to
* @param array Informaiton regarding the item being reported
* @param array Information regarding the report
*
*/
function send_moderator_email($moderator, $rpthreadinfo, $reportinfo)
{
global $vbphrase;
$email_langid = $moderator['languageid'] > 0 ? $moderator['languageid'] : $this->registry->options['languageid'];
($hook = vBulletinHook::fetch_hook('report_send_email')) ? eval($hook) : false;
$reportinfo['discuss'] = $rpthreadinfo ? construct_phrase($vbphrase['discussion_thread_created_x_y'], $this->registry->options['bburl'], $rpthreadinfo['threadid']) : '';
eval(fetch_email_phrases('report' . $this->phrasekey, $email_langid));
vbmail($moderator['email'], $subject, $message, true);
}
示例7: check_attachment_overage
function check_attachment_overage()
{
if ($this->registry->options['attachtotalspace']) {
$attachdata = $this->registry->db->query_first_slave("SELECT SUM(filesize) AS sum FROM " . TABLE_PREFIX . "attachment");
if ($attachdata['sum'] + $this->upload['filesize'] > $this->registry->options['attachtotalspace']) {
$overage = vb_number_format($attachdata['sum'] + $this->upload['filesize'] - $this->registry->options['attachtotalspace'], 1, true);
$admincpdir = $this->registry->config['Misc']['admincpdir'];
eval(fetch_email_phrases('attachfull', 0));
vbmail($this->registry->options['webmasteremail'], $subject, $message);
$this->set_error('upload_attachfull_total', $overage);
return false;
}
}
if ($this->userinfo['permissions']['attachlimit']) {
// Get forums that allow canview access
if (!isset($this->userinfo['forumpermissions'])) {
cache_permissions($this->userinfo, true);
}
$forumids = '';
foreach ($this->userinfo['forumpermissions'] as $forumid => $fperm) {
if ($fperm & $this->registry->bf_ugp_forumpermissions['canview'] and $fperm & $this->registry->bf_ugp_forumpermissions['canviewthreads'] and $fperm & $this->registry->bf_ugp_forumpermissions['cangetattachment']) {
$forumids .= ",{$forumid}";
}
}
$attachdata = $this->registry->db->query_first_slave("\n\t\t\t\tSELECT SUM(attachment.filesize) AS sum\n\t\t\t\tFROM " . TABLE_PREFIX . "attachment AS attachment\n\t\t\t\tINNER JOIN " . TABLE_PREFIX . "post AS post ON (post.postid = attachment.postid)\n\t\t\t\tINNER JOIN " . TABLE_PREFIX . "thread AS thread ON (post.threadid = thread.threadid)\n\t\t\t\tWHERE attachment.userid = " . $this->userinfo['userid'] . "\n\t\t\t\t\tAND\t((thread.forumid IN (0{$forumids}) AND post.visible <> 2 AND thread.visible <> 2) OR attachment.postid = 0)\n\t\t\t");
if ($attachdata['sum'] + $this->upload['filesize'] > $this->userinfo['permissions']['attachlimit']) {
$overage = vb_number_format($attachdata['sum'] + $this->upload['filesize'] - $this->userinfo['permissions']['attachlimit'], 1, true);
$this->set_error('upload_attachfull_user', $overage, $this->registry->session->vars['sessionurl']);
return false;
}
}
if ($this->userinfo['userid'] and !$this->registry->options['allowduplicates']) {
// read file
$filehash = empty($this->upload['filestuff']) ? md5_file($this->upload['location']) : md5($this->upload['filestuff']);
if (!isset($this->userinfo['forumpermissions'])) {
cache_permissions($this->userinfo, true);
}
$forumids = '';
foreach ($this->userinfo['forumpermissions'] as $forumid => $perm) {
if ($perm & $this->registry->bf_ugp_forumpermissions['canview'] and $perm & $this->registry->bf_ugp_forumpermissions['canviewthreads'] and $perm & $this->registry->bf_ugp_forumpermissions['cangetattachment']) {
$forumids .= ",{$forumid}";
}
}
if ($threadresult = $this->registry->db->query_first_slave("\n\t\t\t\tSELECT post.postid, post.threadid, thread.title, posthash, attachment.filename\n\t\t\t\tFROM " . TABLE_PREFIX . "attachment AS attachment\n\t\t\t\tINNER JOIN " . TABLE_PREFIX . "post AS post ON (post.postid = attachment.postid)\n\t\t\t\tINNER JOIN " . TABLE_PREFIX . "thread AS thread ON (thread.threadid = post.threadid)\n\t\t\t\tWHERE attachment.userid = " . $this->userinfo['userid'] . "\n\t\t\t\t\tAND attachment.filehash = '" . $this->registry->db->escape_string($filehash) . "'\n\t\t\t\t\tAND ((thread.forumid IN (0{$forumids}) AND post.visible = 1 AND thread.visible = 1) OR attachment.postid = 0)\n\t\t\t\tLIMIT 1\n\t\t\t")) {
// Attachment of an existing post
if ($threadresult['postid']) {
if ($this->postinfo['postid'] != $threadresult['postid'] or $this->upload['filename'] != $threadresult['filename']) {
// doesn't belong to our post or the filename differs so it won't be overwritten
$this->set_error('upload_attachexists', $this->registry->session->vars['sessionurl'], $threadresult['threadid'], $threadresult['title']);
return false;
}
} else {
// Attachment currently being added or abandoned
if ($threadresult['posthash'] != $this->postinfo['posthash']) {
// Doesn't belong to our post
if ($this->userinfo['userid'] == $this->registry->userinfo['userid']) {
$this->set_error('upload_attach_in_progress_delete_here', $this->registry->session->vars['sessionurl']);
} else {
$this->set_error('upload_attach_in_progress', $this->registry->session->vars['sessionurl']);
}
return false;
} else {
if ($this->upload['filename'] != $threadresult['filename']) {
// Belongs to our post but has a different filename //-> won't be overwritten so don't allow
$this->set_error('upload_attach_exists_this_post');
return false;
}
}
}
}
}
return true;
}
示例8: vB_FloodCheck
if ($perform_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 $
|| ####################################################################
示例9: fetch_error
if (!$verify->verify_token($vbulletin->GPC['humanverify'])) {
$errors[] = fetch_error($verify->fetch_error());
}
}
($hook = vBulletinHook::fetch_hook('blog_dosendtofriend_start')) ? eval($hook) : false;
if ($vbulletin->GPC['username'] != '') {
if ($userinfo = $db->query_first_slave("\r\n\t\t\tSELECT user.*, userfield.*\r\n\t\t\tFROM " . TABLE_PREFIX . "user AS user," . TABLE_PREFIX . "userfield AS userfield\r\n\t\t\tWHERE username='" . $db->escape_string(htmlspecialchars_uni($vbulletin->GPC['username'])) . "'\r\n\t\t\t\tAND user.userid = userfield.userid")) {
$errors[] = fetch_error('usernametaken', $vbulletin->GPC['username'], $vbulletin->session->vars['sessionurl']);
} else {
$postusername = htmlspecialchars_uni($vbulletin->GPC['username']);
}
} else {
$postusername = $vbulletin->userinfo['username'];
}
if (empty($errors)) {
eval(fetch_email_phrases('sendtofriend'));
vbmail($vbulletin->GPC['sendtoemail'], $vbulletin->GPC['emailsubject'], $message);
($hook = vBulletinHook::fetch_hook('blog_dosendtofriend_complete')) ? eval($hook) : false;
$sendtoname = htmlspecialchars_uni($sendtoname);
$vbulletin->url = fetch_seo_url('entry', $bloginfo);
eval(print_standard_redirect('redirect_blog_sentemail'));
} else {
$_REQUEST['do'] = 'sendtofriend';
$show['errors'] = true;
foreach ($errors as $errormessage) {
$templater = vB_Template::create('newpost_errormessage');
$templater->register('errormessage', $errormessage);
$errormessages .= $templater->render();
}
}
}
示例10: array
$ignorelist = array();
if (trim($userinfo['ignorelist']))
{
$ignorelist = preg_split('/( )+/', trim($userinfo['ignorelist']), -1, PREG_SPLIT_NO_EMPTY);
}
if (!in_array($vbulletin->userinfo['userid'], $ignorelist))
{
// Send pm/email
$cansendemail = (($userinfo['adminemail'] OR $userinfo['showemail']) AND $vbulletin->options['enableemail'] AND $vbulletin->userinfo['permissions']['genericpermissions'] & $vbulletin->bf_ugp_genericpermissions['canemailmember']);
if ($cansendemail)
{
$touserinfo =& $userinfo;
$fromuserinfo =& $vbulletin->userinfo;
eval(fetch_email_phrases('blog_group_request_email', $touserinfo['languageid']));
require_once(DIR . '/includes/class_bbcode_alt.php');
$plaintext_parser = new vB_BbCodeParser_PlainText($vbulletin, fetch_tag_list());
$plaintext_parser->set_parsing_language($touserinfo['languageid']);
$message = $plaintext_parser->parse($message, 'privatemessage');
vbmail($touserinfo['email'], $subject, $message);
}
$pending = 'pending';
}
else
{
$pending = 'ignored';
}
$db->query_write("
示例11: do_register
//.........这里部分代码省略.........
if ($parts[1]) {
$day = $parts[1];
}
if ($parts[0]) {
$month = $parts[0];
}
if ($parts[2]) {
$year = $parts[2];
}
$userdata->set('showbirthday', 0);
$userdata->set('birthday', array('day' => $day, 'month' => $month, 'year' => $year));
$dst = 2;
$userdata->set_dst($dst);
$userdata->set('timezoneoffset', $vbulletin->GPC['timezoneoffset']);
// register IP address
$userdata->set('ipaddress', IPADDRESS);
$userdata->pre_save();
if (count($userdata->errors)) {
// Just return one error for now.
json_error(strip_tags($userdata->errors[0]));
}
$vbulletin->userinfo['userid'] = $userid = $userdata->save();
if ($userid) {
$userinfo = fetch_userinfo($userid);
$userdata_rank =& datamanager_init('User', $vbulletin, ERRTYPE_SILENT);
$userdata_rank->set_existing($userinfo);
$userdata_rank->set('posts', 0);
$userdata_rank->save();
require_once DIR . '/includes/functions_login.php';
$vbulletin->session->created = false;
process_new_login('', false, '');
// send new user email
if ($vbulletin->options['newuseremail'] != '') {
$username = $vbulletin->GPC['username'];
$email = $vbulletin->GPC['email'];
if ($birthday = $userdata->fetch_field('birthday')) {
$bday = explode('-', $birthday);
$year = vbdate('Y', TIMENOW, false, false);
$month = vbdate('n', TIMENOW, false, false);
$day = vbdate('j', TIMENOW, false, false);
if ($year > $bday[2] and $bday[2] > 1901 and $bday[2] != '0000') {
require_once DIR . '/includes/functions_misc.php';
$vbulletin->options['calformat1'] = mktimefix($vbulletin->options['calformat1'], $bday[2]);
if ($bday[2] >= 1970) {
$yearpass = $bday[2];
} else {
$yearpass = $bday[2] + 28 * ceil((1970 - $bday[2]) / 28);
}
$birthday = vbdate($vbulletin->options['calformat1'], mktime(0, 0, 0, $bday[0], $bday[1], $yearpass), false, true, false);
} else {
$birthday = vbdate($vbulletin->options['calformat2'], mktime(0, 0, 0, $bday[0], $bday[1], 1992), false, true, false);
}
if ($birthday == '') {
if ($bday[2] == '0000') {
$birthday = "{$bday['0']}-{$bday['1']}";
} else {
$birthday = "{$bday['0']}-{$bday['1']}-{$bday['2']}";
}
}
}
if ($userdata->fetch_field('referrerid') and $vbulletin->GPC['referrername']) {
$referrer = unhtmlspecialchars($vbulletin->GPC['referrername']);
} else {
$referrer = $vbphrase['n_a'];
}
$ipaddress = IPADDRESS;
eval(fetch_email_phrases('newuser', 0));
$newemails = explode(' ', $vbulletin->options['newuseremail']);
foreach ($newemails as $toemail) {
if (trim($toemail)) {
vbmail($toemail, $subject, $message);
}
}
}
$username = htmlspecialchars_uni($vbulletin->GPC['username']);
$email = htmlspecialchars_uni($vbulletin->GPC['email']);
// sort out emails and usergroups
if ($vbulletin->options['verifyemail']) {
$activateid = build_user_activation_id($userid, ($vbulletin->options['moderatenewmembers'] or $vbulletin->GPC['coppauser']) ? 4 : 2, 0);
eval(fetch_email_phrases('activateaccount'));
vbmail($email, $subject, $message, true);
} else {
if ($newusergroupid == 2) {
if ($vbulletin->options['welcomemail']) {
eval(fetch_email_phrases('welcomemail'));
vbmail($email, $subject, $message);
}
}
}
($hook = vBulletinHook::fetch_hook('register_addmember_complete')) ? eval($hook) : false;
// Let them log in again.
process_logout();
$out += array('emailverify' => $vbulletin->options['verifyemail'] ? true : false);
}
} else {
$rules = preg_replace('/<a href=\\"(.*?)\\">(.*?)<\\/a>/', "\\2", $vbphrase['fr_register_forum_rules']);
$out += array('rules' => prepare_utf8_string($rules), 'birthday' => $vbulletin->options['reqbirthday'] ? true : false);
}
return $out;
}
示例12: exec_digest
function exec_digest($type = 2)
{
global $vbulletin;
// for fetch_phrase
require_once DIR . '/includes/functions_misc.php';
// 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($vbulletin->options['globalignore']) != '') {
$coventry = preg_split('#\\s+#s', $vbulletin->options['globalignore'], -1, PREG_SPLIT_NO_EMPTY);
} else {
$coventry = array();
}
require_once DIR . '/includes/class_bbcode_alt.php';
$plaintext_parser = new vB_BbCodeParser_PlainText($vbulletin, fetch_tag_list());
vbmail_start();
// get new threads
$threads = $vbulletin->db->query_read_slave("\n\t\tSELECT\n\t\tuser.userid, user.salt, user.username, user.email, user.languageid, user.usergroupid, user.membergroupids,\n\t\t\tuser.timezoneoffset, IF(user.options & " . $vbulletin->bf_misc_useroptions['dstonoff'] . ", 1, 0) AS dstonoff,\n\t\t\tIF(user.options & " . $vbulletin->bf_misc_useroptions['hasaccessmask'] . ", 1, 0) AS hasaccessmask,\n\t\tthread.threadid, thread.title, thread.prefixid, thread.dateline, thread.forumid, thread.lastpost, pollid,\n\t\topen, replycount, postusername, postuserid, lastposter, thread.dateline, views, subscribethreadid,\n\t\t\tlanguage.dateoverride AS lang_dateoverride, language.timeoverride AS lang_timeoverride, language.locale AS lang_locale\n\t\tFROM " . TABLE_PREFIX . "subscribethread AS subscribethread\n\t\tINNER JOIN " . TABLE_PREFIX . "thread AS thread ON (thread.threadid = subscribethread.threadid)\n\t\tINNER JOIN " . TABLE_PREFIX . "user AS user ON (user.userid = subscribethread.userid)\n\t\tLEFT JOIN " . TABLE_PREFIX . "usergroup AS usergroup ON (usergroup.usergroupid = user.usergroupid)\n\t\tLEFT JOIN " . TABLE_PREFIX . "language AS language ON (language.languageid = IF(user.languageid = 0, " . intval($vbulletin->options['languageid']) . ", user.languageid))\n\t\tWHERE subscribethread.emailupdate = " . intval($type) . " AND\n\t\t\tthread.lastpost > " . intval($lastdate) . " AND\n\t\t\tthread.visible = 1 AND\n\t\t\tuser.usergroupid <> 3 AND\n\t\t\t(usergroup.genericoptions & " . $vbulletin->bf_ugp_genericoptions['isnotbannedgroup'] . ")\n\t");
while ($thread = $vbulletin->db->fetch_array($threads)) {
$postbits = '';
if ($thread['postuserid'] != $thread['userid'] and in_array($thread['postuserid'], $coventry)) {
continue;
}
$userperms = fetch_permissions($thread['forumid'], $thread['userid'], $thread);
if (!($userperms & $vbulletin->bf_ugp_forumpermissions['canview']) or !($userperms & $vbulletin->bf_ugp_forumpermissions['canviewthreads']) or $thread['postuserid'] != $thread['userid'] and !($userperms & $vbulletin->bf_ugp_forumpermissions['canviewothers'])) {
continue;
}
$userinfo = array('lang_locale' => $thread['lang_locale'], 'dstonoff' => $thread['dstonoff'], 'timezoneoffset' => $thread['timezoneoffset']);
$thread['lastreplydate'] = vbdate($thread['lang_dateoverride'] ? $thread['lang_dateoverride'] : $vbulletin->options['default_dateformat'], $thread['lastpost'], false, true, true, false, $userinfo);
$thread['lastreplytime'] = vbdate($thread['lang_timeoverride'] ? $thread['lang_timeoverride'] : $vbulletin->options['default_timeformat'], $thread['lastpost'], false, true, true, false, $userinfo);
$thread['title'] = unhtmlspecialchars($thread['title']);
$thread['username'] = unhtmlspecialchars($thread['username']);
$thread['postusername'] = unhtmlspecialchars($thread['postusername']);
$thread['lastposter'] = unhtmlspecialchars($thread['lastposter']);
$thread['newposts'] = 0;
$thread['auth'] = md5($thread['userid'] . $thread['subscribethreadid'] . $thread['salt'] . COOKIE_SALT);
if ($thread['prefixid']) {
// need prefix in correct language
$thread['prefix_plain'] = fetch_phrase("prefix_{$thread['prefixid']}_title_plain", 'global', '', false, true, $thread['languageid'], false) . ' ';
} else {
$thread['prefix_plain'] = '';
}
// get posts
$posts = $vbulletin->db->query_read_slave("SELECT\n\t\t\tpost.*, IFNULL(user.username,post.username) AS postusername,\n\t\t\tuser.*\n\t\t\tFROM " . TABLE_PREFIX . "post AS post\n\t\t\tLEFT JOIN " . TABLE_PREFIX . "user AS user ON (user.userid = post.userid)\n\t\t\tWHERE threadid = " . intval($thread['threadid']) . " AND\n\t\t\t\tpost.visible = 1 AND\n\t\t\t\tuser.usergroupid <> 3 AND\n\t\t\t\tpost.dateline > " . intval($lastdate) . "\n\t\t\tORDER BY post.dateline\n\t\t");
// compile
$haveothers = false;
while ($post = $vbulletin->db->fetch_array($posts)) {
if ($post['userid'] != $thread['userid'] and in_array($post['userid'], $coventry)) {
continue;
}
if ($post['userid'] != $thread['userid']) {
$haveothers = true;
}
$thread['newposts']++;
$post['postdate'] = vbdate($thread['lang_dateoverride'] ? $thread['lang_dateoverride'] : $vbulletin->options['default_dateformat'], $post['dateline'], false, true, true, false, $userinfo);
$post['posttime'] = vbdate($thread['lang_timeoverride'] ? $thread['lang_timeoverride'] : $vbulletin->options['default_timeformat'], $post['dateline'], false, true, true, false, $userinfo);
$post['postusername'] = unhtmlspecialchars($post['postusername']);
$plaintext_parser->set_parsing_language($thread['languageid']);
$post['pagetext'] = $plaintext_parser->parse($post['pagetext'], $thread['forumid']);
$postlink = fetch_seo_url('thread|nosession|bburl', array('threadid' => $thread['threadid'], 'title' => htmlspecialchars_uni($thread['title'])), array('p' => $post['postid'])) . "#post{$post['postid']}";
($hook = vBulletinHook::fetch_hook('digest_thread_post')) ? eval($hook) : false;
eval(fetch_email_phrases('digestpostbit', $thread['languageid']));
$postbits .= $message;
}
($hook = vBulletinHook::fetch_hook('digest_thread_process')) ? eval($hook) : false;
// Don't send an update if the subscriber is the only one who posted in the thread.
if ($haveothers) {
// make email
// magic vars used by the phrase eval
$threadlink = fetch_seo_url('thread|nosession|bburl', array('threadid' => $thread['threadid'], 'title' => htmlspecialchars_uni($thread['title'])));
$unsubscribelink = fetch_seo_url('subscription|nosession|bburl|js', array(), array('do' => 'removesubscription', 'type' => 'thread', 'subscriptionid' => $thread['subscribethreadid'], 'auth' => $thread['auth']));
eval(fetch_email_phrases('digestthread', $thread['languageid']));
vbmail($thread['email'], $subject, $message);
}
}
unset($plaintext_parser);
// get new forums
$forums = $vbulletin->db->query_read_slave("\n\t\tSELECT user.userid, user.salt, user.username, user.email, user.languageid, user.usergroupid, user.membergroupids,\n\t\t\tuser.timezoneoffset, IF(user.options & " . $vbulletin->bf_misc_useroptions['dstonoff'] . ", 1, 0) AS dstonoff,\n\t\t\tIF(user.options & " . $vbulletin->bf_misc_useroptions['hasaccessmask'] . ", 1, 0) AS hasaccessmask,\n\t\t\tforum.forumid, forum.title_clean, forum.title, subscribeforum.subscribeforumid,\n\t\t\tlanguage.dateoverride AS lang_dateoverride, language.timeoverride AS lang_timeoverride, language.locale AS lang_locale\n\t\tFROM " . TABLE_PREFIX . "subscribeforum AS subscribeforum\n\t\tINNER JOIN " . TABLE_PREFIX . "forum AS forum ON (forum.forumid = subscribeforum.forumid)\n\t\tINNER JOIN " . TABLE_PREFIX . "user AS user ON (user.userid = subscribeforum.userid)\n\t\tLEFT JOIN " . TABLE_PREFIX . "usergroup AS usergroup ON (usergroup.usergroupid = user.usergroupid)\n\t\tLEFT JOIN " . TABLE_PREFIX . "language AS language ON (language.languageid = IF(user.languageid = 0, " . intval($vbulletin->options['languageid']) . ", user.languageid))\n\t\tWHERE subscribeforum.emailupdate = " . intval($type) . " AND\n\t\t\tforum.lastpost > " . intval($lastdate) . " AND\n\t\t\tuser.usergroupid <> 3 AND\n\t\t\t(usergroup.genericoptions & " . $vbulletin->bf_ugp_genericoptions['isnotbannedgroup'] . ")\n\t");
while ($forum = $vbulletin->db->fetch_array($forums)) {
$userinfo = array('lang_locale' => $forum['lang_locale'], 'dstonoff' => $forum['dstonoff'], 'timezoneoffset' => $forum['timezoneoffset']);
$newthreadbits = '';
$newthreads = 0;
$updatedthreadbits = '';
$updatedthreads = 0;
$forum['username'] = unhtmlspecialchars($forum['username']);
$forum['title_clean'] = unhtmlspecialchars($forum['title_clean']);
$forum['auth'] = md5($forum['userid'] . $forum['subscribeforumid'] . $forum['salt'] . COOKIE_SALT);
$threads = $vbulletin->db->query_read_slave("\n\t\t\tSELECT forum.title_clean AS forumtitle, thread.threadid, thread.title, thread.prefixid,\n\t\t\t\tthread.dateline, thread.forumid, thread.lastpost, pollid, open, thread.replycount,\n\t\t\t\tpostusername, postuserid, thread.lastposter, thread.dateline, views\n\t\t\tFROM " . TABLE_PREFIX . "forum AS forum\n\t\t\tINNER JOIN " . TABLE_PREFIX . "thread AS thread USING(forumid)\n\t\t\tWHERE FIND_IN_SET('" . intval($forum['forumid']) . "', forum.parentlist) AND\n\t\t\t\tthread.lastpost > " . intval($lastdate) . " AND\n\t\t\t\tthread.visible = 1\n\t\t");
while ($thread = $vbulletin->db->fetch_array($threads)) {
if ($thread['postuserid'] != $forum['userid'] and in_array($thread['postuserid'], $coventry)) {
//.........这里部分代码省略.........
示例13: post_save_each
function post_save_each($doquery = true)
{
global $vbphrase;
if (!$this->condition) {
if ($postinfo =& $this->info['postinfo']) {
$dataman =& datamanager_init('Post', $this->registry, ERRTYPE_SILENT, 'threadpost');
$dataman->set_existing($postinfo);
$dataman->set('infraction', $this->fetch_field('points') == 0 ? 1 : 2);
$dataman->save();
unset($dataman);
$threadinfo =& $this->info['threadinfo'];
}
if ($userinfo =& $this->info['userinfo']) {
$userdata =& datamanager_init('User', $this->registry, ERRTYPE_SILENT);
$userdata->set_existing($userinfo);
if ($points = $this->fetch_field('points')) {
$userdata->set('ipoints', "ipoints + {$points}", false);
$userdata->set('infractions', 'infractions + 1', false);
} else {
$userdata->set('warnings', 'warnings + 1', false);
}
$userdata->save();
unset($userdata);
if ($points) {
$this->update_infraction_groups($this->fetch_field('action'), $points);
}
// Insert thread
if ($this->registry->options['uiforumid'] and $foruminfo = fetch_foruminfo($this->registry->options['uiforumid'])) {
$infractioninfo = array('title' => $this->fetch_field('customreason') ? unhtmlspecialchars($this->fetch_field('customreason')) : fetch_phrase('infractionlevel' . $this->fetch_field('infractionlevelid') . '_title', 'infractionlevel', '', false, true, 0), 'points' => $points, 'note' => unhtmlspecialchars($this->fetch_field('note')), 'message' => $this->info['message'], 'username' => unhtmlspecialchars($userinfo['username']), 'threadtitle' => unhtmlspecialchars($threadinfo['title']));
if ($threadinfo['prefixid']) {
// need prefix in correct language
$infractioninfo['prefix_plain'] = fetch_phrase("prefix_{$threadinfo['prefixid']}_title_plain", 'global', '', false, true, 0, false) . ' ';
} else {
$infractioninfo['prefix_plain'] = '';
}
eval(fetch_email_phrases($postinfo ? 'infraction_thread_post' : 'infraction_thread_profile', 0, $points > 0 ? 'infraction_thread_infraction' : 'infraction_thread_warning'));
$dataman =& datamanager_init('Thread_FirstPost', $this->registry, ERRTYPE_SILENT, 'threadpost');
$dataman->set_info('forum', $foruminfo);
$dataman->set_info('is_automated', true);
$dataman->set_info('mark_thread_read', true);
$dataman->set('allowsmilie', true);
$dataman->setr('userid', $this->fetch_field('whoadded'));
$dataman->set('title', $subject);
$dataman->setr('pagetext', $message);
$dataman->setr('forumid', $foruminfo['forumid']);
$dataman->set('visible', true);
$threadid = $dataman->save();
// Update infraction with threadid
$infdata =& datamanager_init('Infraction', $this->registry, ERRTYPE_SILENT);
$infractioninfo = array('infractionid' => $this->fetch_field('infractionid'));
$infdata->set_existing($infractioninfo);
$infdata->set('threadid', $threadid);
$infdata->save();
unset($infdata);
}
}
} else {
if ($this->setfields['action'] and ($this->fetch_field('action') == 1 or $this->fetch_field('action') == 2)) {
$this->reset_infraction();
$this->update_infraction_groups($this->existing['action'], $this->existing['points']);
if ($this->fetch_field('action') == 2 and $threadid = $this->fetch_field('threadid') and $threadinfo = fetch_threadinfo($threadid) and $foruminfo = $this->registry->forumcache["{$threadinfo['forumid']}"] and $userid = $this->fetch_field('actionuserid')) {
// Reversed
$infractioninfo = array('reason' => unhtmlspecialchars($this->fetch_field('actionreason')));
eval(fetch_email_phrases('infraction_post', 0, $this->existing['points'] > 0 ? 'infraction_post_infraction' : 'infraction_post_warning'));
$dataman =& datamanager_init('Post', $this->registry, ERRTYPE_SILENT, 'threadpost');
$dataman->set_info('thread', $threadinfo);
$dataman->set_info('forum', $foruminfo);
$dataman->set('threadid', $threadinfo['threadid']);
$dataman->set('userid', $userid);
$dataman->set('allowsmilie', true);
$dataman->set('visible', true);
$dataman->set('title', $subject);
$dataman->set('pagetext', $message);
$dataman->save();
unset($dataman);
}
}
}
($hook = vBulletinHook::fetch_hook('infractiondata_postsave')) ? eval($hook) : false;
}
示例14: exec_digest
function exec_digest($type = 2)
{
global $vbulletin;
// for fetch_phrase
require_once DIR . '/includes/functions_misc.php';
// 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;
}
require_once DIR . '/includes/class_bbcode_alt.php';
$plaintext_parser =& new vB_BbCodeParser_PlainText($vbulletin, fetch_tag_list());
vbmail_start();
// get new threads
$threads = $vbulletin->db->query_read_slave("\n\t\tSELECT\n\t\tuser.userid, user.salt, user.username, user.email, user.languageid, user.usergroupid, user.membergroupids,\n\t\t\tuser.timezoneoffset, IF(user.options & " . $vbulletin->bf_misc_useroptions['dstonoff'] . ", 1, 0) AS dstonoff,\n\t\t\tIF(user.options & " . $vbulletin->bf_misc_useroptions['hasaccessmask'] . ", 1, 0) AS hasaccessmask,\n\t\tthread.threadid, thread.title, thread.prefixid, thread.dateline, thread.forumid, thread.lastpost, pollid,\n\t\topen, replycount, postusername, postuserid, lastposter, thread.dateline, views, subscribethreadid,\n\t\t\tlanguage.dateoverride AS lang_dateoverride, language.timeoverride AS lang_timeoverride, language.locale AS lang_locale\n\t\tFROM " . TABLE_PREFIX . "subscribethread AS subscribethread\n\t\tINNER JOIN " . TABLE_PREFIX . "thread AS thread ON (thread.threadid = subscribethread.threadid)\n\t\tINNER JOIN " . TABLE_PREFIX . "user AS user ON (user.userid = subscribethread.userid)\n\t\tLEFT JOIN " . TABLE_PREFIX . "usergroup AS usergroup ON (usergroup.usergroupid = user.usergroupid)\n\t\tLEFT JOIN " . TABLE_PREFIX . "language AS language ON (language.languageid = IF(user.languageid = 0, " . intval($vbulletin->options['languageid']) . ", user.languageid))\n\t\tWHERE subscribethread.emailupdate = " . intval($type) . " AND\n\t\t\tthread.lastpost > " . intval($lastdate) . " AND\n\t\t\tthread.visible = 1 AND\n\t\t\tuser.usergroupid <> 3 AND\n\t\t\t(usergroup.genericoptions & " . $vbulletin->bf_ugp_genericoptions['isnotbannedgroup'] . ")\n\t");
while ($thread = $vbulletin->db->fetch_array($threads)) {
$postbits = '';
$userperms = fetch_permissions($thread['forumid'], $thread['userid'], $thread);
if (!($userperms & $vbulletin->bf_ugp_forumpermissions['canview']) or !($userperms & $vbulletin->bf_ugp_forumpermissions['canviewthreads']) or $thread['postuserid'] != $thread['userid'] and !($userperms & $vbulletin->bf_ugp_forumpermissions['canviewothers'])) {
continue;
}
$userinfo = array('lang_locale' => $thread['lang_locale'], 'dstonoff' => $thread['dstonoff'], 'timezoneoffset' => $thread['timezoneoffset']);
$thread['lastreplydate'] = vbdate($thread['lang_dateoverride'] ? $thread['lang_dateoverride'] : $vbulletin->options['default_dateformat'], $thread['lastpost'], false, true, true, false, $userinfo);
$thread['lastreplytime'] = vbdate($thread['lang_timeoverride'] ? $thread['lang_timeoverride'] : $vbulletin->options['default_timeformat'], $thread['lastpost'], false, true, true, false, $userinfo);
$thread['title'] = unhtmlspecialchars($thread['title']);
$thread['username'] = unhtmlspecialchars($thread['username']);
$thread['postusername'] = unhtmlspecialchars($thread['postusername']);
$thread['lastposter'] = unhtmlspecialchars($thread['lastposter']);
$thread['newposts'] = 0;
$thread['auth'] = md5($thread['userid'] . $thread['subscribethreadid'] . $thread['salt'] . COOKIE_SALT);
if ($thread['prefixid']) {
// need prefix in correct language
$thread['prefix_plain'] = fetch_phrase("prefix_{$thread['prefixid']}_title_plain", 'global', '', false, true, $thread['languageid'], false) . ' ';
} else {
$thread['prefix_plain'] = '';
}
// get posts
$posts = $vbulletin->db->query_read_slave("SELECT\n\t\t\tpost.*,IFNULL(user.username,post.username) AS postusername,\n\t\t\tuser.*,attachment.filename\n\t\t\tFROM " . TABLE_PREFIX . "post AS post\n\t\t\tLEFT JOIN " . TABLE_PREFIX . "user AS user ON (user.userid = post.userid)\n\t\t\tLEFT JOIN " . TABLE_PREFIX . "attachment AS attachment ON (attachment.postid = post.postid)\n\t\t\tWHERE threadid = " . intval($thread['threadid']) . " AND\n\t\t\t\tpost.visible = 1 AND\n\t\t\t\tuser.usergroupid <> 3 AND\n\t\t\t\tpost.dateline > " . intval($lastdate) . "\n\t\t\tORDER BY post.dateline\n\t\t");
// compile
$haveothers = false;
while ($post = $vbulletin->db->fetch_array($posts)) {
if ($post['userid'] != $thread['userid']) {
$haveothers = true;
}
$thread['newposts']++;
$post['postdate'] = vbdate($thread['lang_dateoverride'] ? $thread['lang_dateoverride'] : $vbulletin->options['default_dateformat'], $post['dateline'], false, true, true, false, $userinfo);
$post['posttime'] = vbdate($thread['lang_timeoverride'] ? $thread['lang_timeoverride'] : $vbulletin->options['default_timeformat'], $post['dateline'], false, true, true, false, $userinfo);
$post['postusername'] = unhtmlspecialchars($post['postusername']);
$plaintext_parser->set_parsing_language($thread['languageid']);
$post['pagetext'] = $plaintext_parser->parse($post['pagetext'], $thread['forumid']);
($hook = vBulletinHook::fetch_hook('digest_thread_post')) ? eval($hook) : false;
eval(fetch_email_phrases('digestpostbit', $thread['languageid']));
$postbits .= $message;
}
($hook = vBulletinHook::fetch_hook('digest_thread_process')) ? eval($hook) : false;
// Don't send an update if the subscriber is the only one who posted in the thread.
if ($haveothers) {
// make email
eval(fetch_email_phrases('digestthread', $thread['languageid']));
vbmail($thread['email'], $subject, $message);
}
}
unset($plaintext_parser);
// get new forums
$forums = $vbulletin->db->query_read_slave("\n\t\tSELECT user.userid, user.salt, user.username, user.email, user.languageid, user.usergroupid, user.membergroupids,\n\t\t\tuser.timezoneoffset, IF(user.options & " . $vbulletin->bf_misc_useroptions['dstonoff'] . ", 1, 0) AS dstonoff,\n\t\t\tIF(user.options & " . $vbulletin->bf_misc_useroptions['hasaccessmask'] . ", 1, 0) AS hasaccessmask,\n\t\t\tforum.forumid, forum.title_clean, subscribeforum.subscribeforumid,\n\t\t\tlanguage.dateoverride AS lang_dateoverride, language.timeoverride AS lang_timeoverride, language.locale AS lang_locale\n\t\tFROM " . TABLE_PREFIX . "subscribeforum AS subscribeforum\n\t\tINNER JOIN " . TABLE_PREFIX . "forum AS forum ON (forum.forumid = subscribeforum.forumid)\n\t\tINNER JOIN " . TABLE_PREFIX . "user AS user ON (user.userid = subscribeforum.userid)\n\t\tLEFT JOIN " . TABLE_PREFIX . "usergroup AS usergroup ON (usergroup.usergroupid = user.usergroupid)\n\t\tLEFT JOIN " . TABLE_PREFIX . "language AS language ON (language.languageid = IF(user.languageid = 0, " . intval($vbulletin->options['languageid']) . ", user.languageid))\n\t\tWHERE subscribeforum.emailupdate = " . intval($type) . " AND\n\t\t\tforum.lastpost > " . intval($lastdate) . " AND\n\t\t\tuser.usergroupid <> 3 AND\n\t\t\t(usergroup.genericoptions & " . $vbulletin->bf_ugp_genericoptions['isnotbannedgroup'] . ")\n\t");
while ($forum = $vbulletin->db->fetch_array($forums)) {
$userinfo = array('lang_locale' => $forum['lang_locale'], 'dstonoff' => $forum['dstonoff'], 'timezoneoffset' => $forum['timezoneoffset']);
$newthreadbits = '';
$newthreads = 0;
$updatedthreadbits = '';
$updatedthreads = 0;
$forum['username'] = unhtmlspecialchars($forum['username']);
$forum['title_clean'] = unhtmlspecialchars($forum['title_clean']);
$forum['auth'] = md5($forum['userid'] . $forum['subscribeforumid'] . $forum['salt'] . COOKIE_SALT);
$threads = $vbulletin->db->query_read_slave("\n\t\t\tSELECT forum.title_clean AS forumtitle, thread.threadid, thread.title, thread.prefixid,\n\t\t\t\tthread.dateline, thread.forumid, thread.lastpost, pollid, open, thread.replycount,\n\t\t\t\tpostusername, postuserid, thread.lastposter, thread.dateline, views\n\t\t\tFROM " . TABLE_PREFIX . "forum AS forum\n\t\t\tINNER JOIN " . TABLE_PREFIX . "thread AS thread USING(forumid)\n\t\t\tWHERE FIND_IN_SET('" . intval($forum['forumid']) . "', forum.parentlist) AND\n\t\t\t\tthread.lastpost > " . intval($lastdate) . " AND\n\t\t\t\tthread.visible = 1\n\t\t\t");
while ($thread = $vbulletin->db->fetch_array($threads)) {
$userperms = fetch_permissions($thread['forumid'], $forum['userid'], $forum);
// allow those without canviewthreads to subscribe/receive forum updates as they contain not post content
if (!($userperms & $vbulletin->bf_ugp_forumpermissions['canview']) or $thread['postuserid'] != $forum['userid'] and !($userperms & $vbulletin->bf_ugp_forumpermissions['canviewothers'])) {
continue;
}
$thread['forumtitle'] = unhtmlspecialchars($thread['forumtitle']);
$thread['lastreplydate'] = vbdate($forum['lang_dateoverride'] ? $forum['lang_dateoverride'] : $vbulletin->options['default_dateformat'], $thread['lastpost'], false, true, true, false, $userinfo);
$thread['lastreplytime'] = vbdate($forum['lang_timeoverride'] ? $forum['lang_timeoverride'] : $vbulletin->options['default_timeformat'], $thread['lastpost'], false, true, true, false, $userinfo);
$thread['title'] = unhtmlspecialchars($thread['title']);
$thread['postusername'] = unhtmlspecialchars($thread['postusername']);
$thread['lastposter'] = unhtmlspecialchars($thread['lastposter']);
if ($thread['prefixid']) {
// need prefix in correct language
$thread['prefix_plain'] = fetch_phrase("prefix_{$thread['prefixid']}_title_plain", 'global', '', false, true, $forum['languageid'], false) . ' ';
} else {
$thread['prefix_plain'] = '';
//.........这里部分代码省略.........
示例15: send_moderator_email
/**
* Sends emails to a moderator regarding the report
*
* @param array Information regarding the moderator to send the email to
* @param array Informaiton regarding the item being reported
* @param array Information regarding the report
*
*/
function send_moderator_email($moderator, $rpthreadinfo, $reportinfo)
{
global $vbphrase;
$email_langid = ($moderator['languageid'] > 0 ? $moderator['languageid'] : $this->registry->options['languageid']);
($hook = vBulletinHook::fetch_hook('report_send_email')) ? eval($hook) : false;
$reportinfo['discuss'] = $rpthreadinfo ? construct_phrase($vbphrase['discussion_thread_created_x_y'], $this->registry->options['bburl'], fetch_seo_url('thread|js', $rpthreadinfo)) : '';
$reportinfo['postlink'] = fetch_seo_url('thread|nosession', $reportinfo, array('p' => $reportinfo['postid'])) . "#post$reportinfo[postid]";
$reportinfo['threadlink'] = fetch_seo_url('thread|nosession', $reportinfo);
eval(fetch_email_phrases('report' . $this->phrasekey, $email_langid));
vbmail($moderator['email'], $subject, $message, true);
}