本文整理汇总了PHP中vbmail函数的典型用法代码示例。如果您正苦于以下问题:PHP vbmail函数的具体用法?PHP vbmail怎么用?PHP vbmail使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了vbmail函数的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: halt
/**
* Halts execution of the entire system and displays an error message
*
* @param string Text of the error message. Leave blank to use $this->sql as error text.
*
* @return integer
*/
function halt($errortext = '')
{
global $vbulletin;
if ($this->connection_recent)
{
$this->error = $this->error($this->connection_recent);
$this->errno = $this->errno($this->connection_recent);
}
if ($this->reporterror)
{
if ($errortext == '')
{
$this->sql = "Invalid SQL:\r\n" . chop($this->sql) . ';';
$errortext =& $this->sql;
}
$vboptions =& $vbulletin->options;
$technicalemail =& $vbulletin->config['Database']['technicalemail'];
$bbuserinfo =& $vbulletin->userinfo;
$requestdate = date('l, F jS Y @ h:i:s A', TIMENOW);
$date = date('l, F jS Y @ h:i:s A');
$scriptpath = str_replace('&', '&', $vbulletin->scriptpath);
$referer = REFERRER;
$ipaddress = IPADDRESS;
$classname = get_class($this);
if ($this->connection_recent)
{
$this->hide_errors();
list($mysqlversion) = $this->query_first("SELECT VERSION() AS version", DBARRAY_NUM);
$this->show_errors();
}
$display_db_error = (VB_AREA == 'Upgrade' OR VB_AREA == 'Install' OR $vbulletin->userinfo['usergroupid'] == 6 OR ($vbulletin->userinfo['permissions']['adminpermissions'] & $vbulletin->bf_ugp_adminpermissions));
// Hide the MySQL Version if its going in the source
if (!$display_db_error)
{
$mysqlversion = '';
}
eval('$message = "' . str_replace('"', '\"', file_get_contents(DIR . '/includes/database_error_message.html')) . '";');
// add a backtrace to the message
if ($vbulletin->debug)
{
$trace = debug_backtrace();
$trace_output = "\n";
foreach ($trace AS $index => $trace_item)
{
$param = (in_array($trace_item['function'], array('require', 'require_once', 'include', 'include_once')) ? $trace_item['args'][0] : '');
// remove path
$param = str_replace(DIR, '[path]', $param);
$trace_item['file'] = str_replace(DIR, '[path]', $trace_item['file']);
$trace_output .= "#$index $trace_item[class]$trace_item[type]$trace_item[function]($param) called in $trace_item[file] on line $trace_item[line]\n";
}
$message .= "\n\nStack Trace:\n$trace_output\n";
}
require_once(DIR . '/includes/functions_log_error.php');
if (function_exists('log_vbulletin_error'))
{
log_vbulletin_error($message, 'database');
}
if ($technicalemail != '' AND !$vbulletin->options['disableerroremail'] AND verify_email_vbulletin_error($this->errno, 'database'))
{
// If vBulletinHook is defined then we know that options are loaded, so we can then use vbmail
if (class_exists('vBulletinHook', false))
{
@vbmail($technicalemail, $this->appshortname . ' Database Error!', $message, true, $technicalemail);
}
else
{
@mail($technicalemail, $this->appshortname . ' Database Error!', preg_replace("#(\r\n|\r|\n)#s", (@ini_get('sendmail_path') === '') ? "\r\n" : "\n", $message), "From: $technicalemail");
}
}
// send ajax reponse after sending error email
if ($vbulletin->GPC['ajax'])
{
require_once(DIR . '/includes/class_xml.php');
$xml = new vB_AJAX_XML_Builder($vbulletin, 'text/xml');
$error = 'Database Error';
if ($vbulletin->debug)
{
//.........这里部分代码省略.........
示例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: eval
}
$photoplog_replace_name = $photoplog_file_old;
if ($photoplog_file_edit) {
$photoplog_replace_name = $photoplog_file_name;
}
($hook = vBulletinHook::fetch_hook('photoplog_edit_sqlreplace')) ? eval($hook) : false;
if ($db->query_write("REPLACE INTO " . PHOTOPLOG_PREFIX . "photoplog_fileuploads\r\n\t\t\t(fileid, userid, username, title, description, filename, filesize, dateline, views, catid, moderate, dimensions, setid, \r\n\t\t\tfielddata, num_comments0, num_comments1, num_ratings0, num_ratings1, sum_ratings0, sum_ratings1,\r\n\t\t\tlast_comment_dateline0, last_comment_dateline1, last_comment_id0, last_comment_id1, albumids, exifinfo)\r\n\t\t\tVALUES (\r\n\t\t\t\t" . intval($photoplog_file_id) . ",\r\n\t\t\t\t" . intval($photoplog_file_userid) . ",\r\n\t\t\t\t'" . $db->escape_string($photoplog_file_username) . "',\r\n\t\t\t\t'" . $db->escape_string($photoplog_file_title) . "',\r\n\t\t\t\t'" . $db->escape_string($photoplog_file_description) . "',\r\n\t\t\t\t'" . $db->escape_string($photoplog_replace_name) . "',\r\n\t\t\t\t" . intval($photoplog_file_size) . ",\r\n\t\t\t\t" . intval($photoplog_file_dateline) . ",\r\n\t\t\t\t" . intval($photoplog_file_views) . ",\r\n\t\t\t\t" . intval($photoplog_file_catid) . ",\r\n\t\t\t\t" . intval($photoplog_file_moderate) . ",\r\n\t\t\t\t'" . $db->escape_string($photoplog['dimensions']) . "',\r\n\t\t\t\t" . intval($photoplog_file_setid) . ",\r\n\t\t\t\t'" . $db->escape_string($photoplog_fielddata) . "',\r\n\t\t\t\t" . intval($photoplog_file_nc0) . ",\r\n\t\t\t\t" . intval($photoplog_file_nc1) . ",\r\n\t\t\t\t" . intval($photoplog_file_nr0) . ",\r\n\t\t\t\t" . intval($photoplog_file_nr1) . ",\r\n\t\t\t\t" . intval($photoplog_file_sr0) . ",\r\n\t\t\t\t" . intval($photoplog_file_sr1) . ",\r\n\t\t\t\t" . intval($photoplog_file_lcd0) . ",\r\n\t\t\t\t" . intval($photoplog_file_lcd1) . ",\r\n\t\t\t\t" . intval($photoplog_file_lci0) . ",\r\n\t\t\t\t" . intval($photoplog_file_lci1) . ",\r\n\t\t\t\t'" . $db->escape_string($photoplog_albumids) . "',\r\n\t\t\t\t'" . $db->escape_string($photoplog_exifinfo) . "'\r\n\t\t\t)\r\n\t\t")) {
if ($photoplog_file_catid_default >= 0 && $photoplog_file_catid != $photoplog_file_catid_default) {
$db->query_write("UPDATE " . PHOTOPLOG_PREFIX . "photoplog_ratecomment\r\n\t\t\t\t\t\tSET catid = " . intval($photoplog_file_catid) . "\r\n\t\t\t\t\t\tWHERE fileid = " . intval($photoplog_file_id) . "\r\n\t\t\t");
photoplog_update_counts_table($photoplog_file_catid_default);
}
photoplog_update_counts_table($photoplog_file_catid);
if ($photoplog_file_moderate == 1 && $vbulletin->options['photoplog_admin_email']) {
$photoplog_subject = $photoplog_message = '';
eval(fetch_email_phrases('photoplog_mod_file', -1, '', 'photoplog_'));
vbmail($vbulletin->options['webmasteremail'], $photoplog_subject, $photoplog_message, true);
}
if ($photoplog_file_old && $photoplog_file_edit) {
@unlink($photoplog_directory_name . "/" . $photoplog_file_old);
@unlink($photoplog_directory_name . "/large/" . $photoplog_file_old);
@unlink($photoplog_directory_name . "/medium/" . $photoplog_file_old);
@unlink($photoplog_directory_name . "/small/" . $photoplog_file_old);
}
($hook = vBulletinHook::fetch_hook('photoplog_edit_doedit_complete')) ? eval($hook) : false;
$photoplog_id = intval($photoplog_file_id);
$photoplog_url = $photoplog['location'] . '/index.php?' . $vbulletin->session->vars['sessionurl'] . 'n=' . $photoplog_id;
exec_header_redirect($photoplog_url);
exit;
} else {
photoplog_output_page('photoplog_error_page', $vbphrase['photoplog_error'], $vbphrase['photoplog_bad_luck']);
}
示例5: clear_autosave_text
clear_autosave_text('vBForum_Calendar', 0, 0, $vbulletin->userinfo['userid']);
if ($calendarinfo['neweventemail']) {
$calemails = unserialize($calendarinfo['neweventemail']);
$calendarinfo['title'] = unhtmlspecialchars($calendarinfo['title']);
$title =& $vbulletin->GPC['title'];
$vbulletin->userinfo['username'] = unhtmlspecialchars($vbulletin->userinfo['username']);
//for emails
require_once DIR . '/includes/class_bbcode_alt.php';
$plaintext_parser = new vB_BbCodeParser_PlainText($vbulletin, fetch_tag_list());
$plaintext_parser->set_parsing_language(0);
// email addresses don't have a language ID
$eventmessage = $plaintext_parser->parse($message, 'calendar');
foreach ($calemails as $index => $toemail) {
if (trim($toemail)) {
eval(fetch_email_phrases('newevent', 0));
vbmail($toemail, $subject, $message, true);
}
}
}
($hook = vBulletinHook::fetch_hook('calendar_update_complete')) ? eval($hook) : false;
if ($visible) {
$vbulletin->url = 'calendar.php?' . $vbulletin->session->vars['sessionurl'] . "do=getinfo&e={$eventid}&day=" . $eventdata->info['occurdate'];
print_standard_redirect('redirect_calendaraddevent');
} else {
$vbulletin->url = 'calendar.php?' . $vbulletin->session->vars['sessionurl'] . "c={$calendarinfo['calendarid']}";
print_standard_redirect('redirect_calendarmoderated', true, true);
}
} else {
// Update event
$eventdata->set_existing($eventinfo);
$eventdata->save();
示例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: vbmail_start
}
vbmail_start();
$usernames = '';
$reminderbits = '';
foreach ($eventlist as $userid => $event) {
$usernames .= iif($usernames, ', ');
$usernames .= $userinfo["{$userid}"]['username'];
$reminderbits = '';
foreach ($event as $eventid => $hour) {
$eventinfo =& $eventcache["{$eventid}"];
eval(fetch_email_phrases('reminderbit', $userinfo["{$userid}"]['languageid']));
$reminderbits .= $message;
}
$username = unhtmlspecialchars($userinfo["{$userid}"]['username']);
eval(fetch_email_phrases('reminder', $userinfo["{$userid}"]['languageid']));
vbmail($userinfo["{$userid}"]['email'], $subject, $message, true);
if ($vbulletin->debug and VB_AREA == 'AdminCP') {
"<pre>";
echo $subject;
echo "</pre>";
echo "<pre>";
echo $message;
echo "</pre><br />";
}
}
vbmail_end();
if (!empty($usernames)) {
log_cron_action($usernames, $nextitem, 1);
}
/*======================================================================*\
|| ####################################################################
示例8: post_save_each
//.........这里部分代码省略.........
require_once(DIR . '/includes/class_bbcode_alt.php');
$plaintext_parser = new vB_BbCodeParser_PlainText($this->registry, fetch_tag_list());
$pagetext_cache = array(); // used to cache the results per languageid for speed
$pagetext_orig =& $this->fetch_field('pagetext', 'blog_text');
($hook = vBulletinHook::fetch_hook('blog_user_notification_start')) ? eval($hook) : false;
$useremails = $this->dbobject->query_read_slave("
SELECT
user.*,
blog_subscribeuser.blogsubscribeuserid,
bm.blogmoderatorid,
ignored.relationid AS ignoreid, buddy.relationid AS buddyid,
bu.isblogmoderator, IF(displaygroupid=0, user.usergroupid, displaygroupid) AS displaygroupid
FROM " . TABLE_PREFIX . "blog_subscribeuser AS blog_subscribeuser
INNER JOIN " . TABLE_PREFIX . "user AS user ON (blog_subscribeuser.userid = user.userid)
LEFT JOIN " . TABLE_PREFIX . "blog_moderator AS bm ON (bm.userid = user.userid)
LEFT JOIN " . TABLE_PREFIX . "userlist AS buddy ON (buddy.userid = $userid AND buddy.relationid = user.userid AND buddy.type = 'buddy')
LEFT JOIN " . TABLE_PREFIX . "userlist AS ignored ON (ignored.userid = $userid AND ignored.relationid = user.userid AND ignored.type = 'ignore')
LEFT JOIN " . TABLE_PREFIX . "blog_user AS bu ON (bu.bloguserid = user.userid)
WHERE
blog_subscribeuser.bloguserid = $userid
AND
" . ($userid == $postedby_userid ? "blog_subscribeuser.userid <> $userid AND" : "") . "
blog_subscribeuser.type = 'email'
AND
user.usergroupid <> 3
AND
user.lastactivity >= " . intval($lastposttime['dateline']) . "
");
vbmail_start();
$setoptions = $this->fetch_field('options');
$evalemail = array();
while ($touser = $this->dbobject->fetch_array($useremails))
{
cache_permissions($touser, false);
// only send private entries to contacts and moderators
if ($setoptions["{$this->bitfields['options']['private']}"] AND !$touser['buddyid'] AND !$touser['blogmoderatorid'] AND !is_member_of_blog($touser, $userinfo))
{
continue;
}
if (!($this->registry->usergroupcache["$touser[usergroupid]"]['genericoptions'] & $this->registry->bf_ugp_genericoptions['isnotbannedgroup']))
{
continue;
}
if ($this->fetch_field('state') == 'moderation')
{
if ($touser['userid'] != $userid AND !can_moderate_blog('canmoderateentries', $touser))
{
continue;
}
}
if (!empty($this->info['categories']))
{
prepare_blog_category_permissions($touser);
if (array_intersect($touser['blogcategorypermissions']['cantview'], $this->info['categories']) AND $userinfo['userid'] != $touser['userid'])
{
continue;
示例9: eval
$uheaders .= "To: {$username} <{$email}>" . "\r\n";
$uheaders .= "From: " . $vbulletin->options['bbtitle'] . " Reminder Service <" . $vbulletin->options['webmasteremail'] . ">" . "\r\n";
eval('$subject = "' . addslashes($vbulletin->options['subject']) . '";');
$subject = stripslashes($subject);
if ($vbulletin->options['reminder_emailfooter']) {
$message = $message . "Email Reminder System Provided By Mished.co.uk";
}
/*if(@mail($email, $subject, $message, $headers)){
print("mailing $email (done)<br/>");
} else {
print("mailing $email (failed)<br/>");
}*/
if (is_valid_email($toemail)) {
$sentlist .= "{$username} ";
vbmail($toemail, $subject, $message, $notsubscription = false, $from = $vbulletin->options['bbtitle'], $uheaders = '', $username = '');
} else {
$failedlist .= "{$username} ";
}
}
}
if ($sentlist == "") {
log_cron_action("No Emails to send", $nextitem);
vbmail($vbulletin->options['webmasteremail'], "Inactive User Reminder Email Report", "This email shows that the product is installed and working as it should be.\n\n\nThere were no inactive users at this time.", $notsubscription = false, $from = $vbulletin->options['bbtitle'], $uheaders = "From: " . $vbulletin->options['bbtitle'] . " Reminder Service <" . $vbulletin->options['webmasteremail'] . ">" . "\r\n", $username = '');
} else {
log_cron_action("Emails sent to:{$sentlist}. We tried to email the following users, but their email address was invalid:{$failedlist}", $nextitem);
vbmail($vbulletin->options['webmasteremail'], "Inactive User Reminder Email Report", "This email shows that the product is installed and working as it should be.\n\n\nEmails sent to:" . $sentlist . ". We tried to email the following users, but their email address was invalid:" . $failedlist . "", $notsubscription = false, $from = $vbulletin->options['bbtitle'], $uheaders = "From: " . $vbulletin->options['bbtitle'] . " Reminder Service <" . $vbulletin->options['webmasteremail'] . ">" . "\r\n", $username = '');
}
} else {
print "Product is inactive at this time!";
}
示例10: fetch_error
$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();
}
}
}
// ############################### start send to friend ###############################
示例11: print_stop_message
print_stop_message('you_must_enter_the_password_token_into_the_message');
}
// select affected users
$result = $vbulletin->db->query("\r\n\t\tSELECT userid \r\n\t\tFROM " . TABLE_PREFIX . "user \r\n\t\tWHERE password = MD5(CONCAT(MD5(username),salt)) " . ($period ? 'AND lastvisit < ' . (TIMENOW - $period) : '') . " \r\n\t\tAND userid > {$lastuser} \r\n\t\tLIMIT 0, " . $vbulletin->GPC['quantity'] . "\r\n\t");
if ($total = $vbulletin->db->num_rows($result)) {
while ($user = $vbulletin->db->fetch_array($result)) {
// fetch their info
$user = fetch_userinfo($user['userid']);
// set last user processed
$lastuser = $user['userid'];
// make random password
$newpassword = substr(md5(vbrand(0, 100000000)), 0, 8);
// send mail to user
$message = str_replace('{username}', $user['username'], $vbulletin->GPC['email']);
$message = str_replace('{password}', $newpassword, $message);
if (!vbmail($user['email'], $vbulletin->GPC['email_subject'], $message, true, $vbulletin->GPC['from'])) {
$email_errors = true;
continue;
}
// reset the password
$userdata = datamanager_init('User', $vbulletin, ERRTYPE_SILENT);
$userdata->set_existing($user);
$userdata->set('password', $newpassword);
$userdata->save();
// check reset for errors
if (sizeof($userdata->errors)) {
$reset_errors = true;
continue;
}
}
$vbulletin->db->free_result($result);
示例12: halt
/**
* Halts execution of the entire system and displays an error message
*
* @param string Text of the error message. Leave blank to use $this->sql as error text.
*
* @return integer
*/
function halt($errortext = '')
{
global $vbulletin;
if ($this->connection_recent) {
$this->error = $this->error($this->connection_recent);
$this->errno = $this->errno($this->connection_recent);
}
if ($this->reporterror) {
if ($errortext == '') {
$this->sql = "Invalid SQL:\r\n" . chop($this->sql) . ';';
$errortext =& $this->sql;
}
// Try and stop e-mail flooding.
if (!$vbulletin->options['disableerroremail']) {
if (!$vbulletin->options['safeupload']) {
$tempdir = ini_get('upload_tmp_dir');
} else {
$tempdir = $vbulletin->options['tmppath'] . '/';
}
$unique = md5(COOKIE_SALT);
$tempfile = $tempdir . "zdberr{$unique}.dat";
/* If its less than a minute since the last e-mail
and the error code is the same as last time, disable e-mail */
if ($data = @file_get_contents($tempfile)) {
$errc = intval(substr($data, 10));
$time = intval(substr($data, 0, 10));
if ($time and TIMENOW - $time < 60 and intval($this->errno) == $errc) {
$vbulletin->options['disableerroremail'] = true;
} else {
$data = TIMENOW . intval($this->errno);
@file_put_contents($tempfile, $data);
}
} else {
$data = TIMENOW . intval($this->errno);
@file_put_contents($tempfile, $data);
}
}
$vboptions =& $vbulletin->options;
$technicalemail =& $vbulletin->config['Database']['technicalemail'];
$bbuserinfo =& $vbulletin->userinfo;
$requestdate = date('l, F jS Y @ h:i:s A', TIMENOW);
$date = date('l, F jS Y @ h:i:s A');
$scriptpath = str_replace('&', '&', $vbulletin->scriptpath);
$referer = REFERRER;
$ipaddress = IPADDRESS;
$classname = get_class($this);
if ($this->connection_recent) {
$this->hide_errors();
list($mysqlversion) = $this->query_first("SELECT VERSION() AS version", DBARRAY_NUM);
$this->show_errors();
}
$display_db_error = (VB_AREA == 'Upgrade' or VB_AREA == 'Install' or $vbulletin->userinfo['permissions']['adminpermissions'] & $vbulletin->bf_ugp_adminpermissions['cancontrolpanel']);
// Hide the MySQL Version if its going in the source
if (!$display_db_error) {
$mysqlversion = '';
}
eval('$message = "' . str_replace('"', '\\"', file_get_contents(DIR . '/includes/database_error_message.html')) . '";');
// add a backtrace to the message
if ($vbulletin->debug) {
$trace = debug_backtrace();
$trace_output = "\n";
foreach ($trace as $index => $trace_item) {
$param = in_array($trace_item['function'], array('require', 'require_once', 'include', 'include_once')) ? $trace_item['args'][0] : '';
// remove path
$param = str_replace(DIR, '[path]', $param);
$trace_item['file'] = str_replace(DIR, '[path]', $trace_item['file']);
$trace_output .= "#{$index} {$trace_item['class']}{$trace_item['type']}{$trace_item['function']}({$param}) called in {$trace_item['file']} on line {$trace_item['line']}\n";
}
$message .= "\n\nStack Trace:\n{$trace_output}\n";
}
require_once DIR . '/includes/functions_log_error.php';
if (function_exists('log_vbulletin_error')) {
log_vbulletin_error($message, 'database');
}
if ($technicalemail != '' and !$vbulletin->options['disableerroremail'] and verify_email_vbulletin_error($this->errno, 'database')) {
// If vBulletinHook is defined then we know that options are loaded, so we can then use vbmail
if (class_exists('vBulletinHook', false)) {
@vbmail($technicalemail, $this->appshortname . ' Database Error!', $message, true, $technicalemail);
} else {
@mail($technicalemail, $this->appshortname . ' Database Error!', preg_replace("#(\r\n|\r|\n)#s", @ini_get('sendmail_path') === '' ? "\r\n" : "\n", $message), "From: {$technicalemail}");
}
}
if (defined('STDIN')) {
echo $message;
exit;
}
// send ajax reponse after sending error email
if ($vbulletin->GPC['ajax']) {
require_once DIR . '/includes/class_xml.php';
$xml = new vB_AJAX_XML_Builder($vbulletin, 'text/xml');
$error = '<p>Database Error</p>';
if ($vbulletin->debug or VB_AREA == 'Upgrade') {
$error .= "\r\n\r\n{$errortext}";
//.........这里部分代码省略.........
示例13: construct_errors
$pmdm->pre_save();
// process errors if there are any
$errors = $pmdm->errors;
if (!empty($errors)) {
$error = construct_errors($errors);
// this will take the preview's place
eval(standard_error($error));
} else {
// everything's good!
$pmdm->save();
unset($pmdm);
$award_send += 4;
}
}
if (!empty($vbulletin->options['award_request_formemailaddress'])) {
vbmail($vbulletin->options['award_request_formemailaddress'], $posttitle, $formsend);
$award_send += 8;
}
if ($award_send > 0) {
$errormessage = $vbphrase['award_request_completed'];
} else {
$errormessage = $vbphrase['award_request_incompleted'];
}
eval('print_output("' . fetch_template('STANDARD_ERROR') . '");');
exit;
}
if ($_REQUEST['do'] == 'request') {
$vbulletin->input->clean_array_gpc('r', array('award_id' => TYPE_UINT));
if (empty($vbulletin->GPC['award_id'])) {
$errormessage = $vbphrase['award_request_noawardid'];
eval('print_output("' . fetch_template('STANDARD_ERROR') . '");');
示例14: 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;
}
示例15: 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)) {
//.........这里部分代码省略.........