} } // check for message flooding if ($vbulletin->options['pmfloodtime'] > 0 and !$vbulletin->GPC['preview']) { if (!($permissions['adminpermissions'] & $vbulletin->bf_ugp_adminpermissions['cancontrolpanel']) and !can_moderate()) { $floodcheck = $db->query_first("\n\t\t\t\tSELECT pmtextid, title, dateline\n\t\t\t\tFROM " . TABLE_PREFIX . "pmtext AS pmtext\n\t\t\t\tWHERE fromuserid = " . $vbulletin->userinfo['userid'] . "\n\t\t\t\tORDER BY dateline DESC\n\t\t\t"); if (($timepassed = TIMENOW - $floodcheck['dateline']) < $vbulletin->options['pmfloodtime']) { $errors[] = fetch_error('pmfloodcheck', $vbulletin->options['pmfloodtime'], $vbulletin->options['pmfloodtime'] - $timepassed); } } } // process errors if there are any $errors = array_merge($errors, $pmdm->errors); if (!empty($errors)) { define('PMPREVIEW', 1); $preview = construct_errors($errors); // this will take the preview's place $_REQUEST['do'] = 'newpm'; } else { if ($vbulletin->GPC['preview'] != '') { define('PMPREVIEW', 1); $foruminfo = array('forumid' => 'privatemessage', 'allowicons' => $vbulletin->options['privallowicons']); $preview = process_post_preview($pm); $_REQUEST['do'] = 'newpm'; } else { // everything's good! $pmdm->save(); // force pm counters to be rebuilt $vbulletin->userinfo['pmunread'] = -1; build_pm_counters(); ($hook = vBulletinHook::fetch_hook('private_insertpm_complete')) ? eval($hook) : false;
{ 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(); $xml->print_xml(); } else { define('MESSAGEPREVIEW', true); require_once(DIR . '/includes/functions_newpost.php'); $preview = construct_errors($dataman->errors); $_GET['do'] = 'message'; } } else if ($vbulletin->GPC['preview'] OR $vbulletin->GPC['advanced']) { define('MESSAGEPREVIEW', true); if ($vbulletin->GPC['preview']) { $preview = process_visitor_message_preview($message); } $_GET['do'] = 'message'; } else
// if changing an album to a profile album, be sure we actually have perm to change it if ($vbulletin->GPC['albumtype'] == 'profile' and $albuminfo['state'] != 'profile') { $creator = fetch_userinfo($albumdata->fetch_field('userid')); cache_permissions($creator); $can_profile_album = ($vbulletin->options['socnet'] & $vbulletin->bf_misc_socnet['enable_profile_styling'] and $creator['permissions']['usercsspermissions'] & $vbulletin->bf_ugp_usercsspermissions['caneditbgimage']); if (!$can_profile_album) { $vbulletin->GPC['albumtype'] = 'public'; } } $albumdata->set('state', $vbulletin->GPC['albumtype']); $albumdata->pre_save(); ($hook = vBulletinHook::fetch_hook('album_album_update')) ? eval($hook) : false; if ($albumdata->errors) { $formdata = array_merge($albumdata->existing, $albumdata->album); require_once DIR . '/includes/functions_newpost.php'; $errortable = construct_errors($albumdata->errors); $_REQUEST['do'] = 'addalbum'; define('PREVIEW_ERRORS', true); } else { $albumdata->save(); if (!empty($albuminfo['albumid']) and $albuminfo['userid'] != $vbulletin->userinfo['userid'] and can_moderate(0, 'caneditalbumpicture')) { require_once DIR . '/includes/functions_log_error.php'; log_moderator_action($albuminfo, 'album_x_by_y_edited', array($albuminfo['title'], $userinfo['username'])); } $vbulletin->url = 'album.php?' . $vbulletin->session->vars['sessionurl'] . 'albumid=' . $albumdata->fetch_field('albumid'); eval(print_standard_redirect('album_added_edited')); } } // ####################################################################### if ($_REQUEST['do'] == 'addalbum' or $_REQUEST['do'] == 'editalbum') { // $formdata will fall through on preview
$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) { $trimmed_postmessage = substr($vbulletin->GPC['message'], 0, $vbulletin->options['postmaxchars']); } else { $trimmed_postmessage =& $vbulletin->GPC['message']; } $infdata->set_info('message', $trimmed_postmessage); ($hook = vBulletinHook::fetch_hook('infraction_update_process')) ? eval($hook) : false; $infdata->save(); // Ban
if (!($forumperms & $vbulletin->bf_ugp_forumpermissions['canviewthreads'])) { $newpost['emailupdate'] = 0; } if (!$vbulletin->GPC['subscribe']) { $newpost['emailupdate'] = 9999; } build_new_post('thread', $foruminfo, array(), array(), $newpost, $errors); if (sizeof($errors) > 0) { // ### POST HAS ERRORS ### $postpreview = construct_errors($errors); // this will take the preview's place construct_checkboxes($newpost); $_REQUEST['do'] = 'newthread'; $newpost['message'] = htmlspecialchars_uni($newpost['message']); $podcasturl = htmlspecialchars_uni($newpost['podcasturl']); $podcastsize = ($newpost['podcastsize']) ? $newpost['podcastsize'] : ''; $podcastkeywords = htmlspecialchars_uni($newpost['podcastkeywords']); $podcastsubtitle = htmlspecialchars_uni($newpost['podcastsubtitle']); $podcastauthor = htmlspecialchars_uni($newpost['podcastauthor']); $explicitchecked = $newpost['podcastexplicit'] ? 'checked="checked"' : ''; } else if ($newpost['preview']) { if ($forumperms & $vbulletin->bf_ugp_forumpermissions['canpostattachment'] AND $vbulletin->userinfo['userid'] AND !empty($vbulletin->userinfo['attachmentextensions'])) { require_once(DIR . '/packages/vbattach/attach.php');
$pm['message'] =& $vbulletin->GPC['message']; $pm['title'] =& $vbulletin->GPC['title']; $pm['recipients'] =& $vbulletin->GPC['recipients']; // create the DM to do error checking and insert the new PM $pmdm =& datamanager_init('PM', $vbulletin, ERRTYPE_ARRAY); $pmdm->set('fromuserid', $vbulletin->userinfo['userid']); $pmdm->set('fromusername', $vbulletin->userinfo['username']); $pmdm->setr('title', $pm['title']); $pmdm->setr('message', $pm['message']); $pmdm->set_recipients($pm['recipients'], $permissions); $pmdm->set('dateline', TIMENOW); $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'];
/** * Prepares the preview of note text or the error box. * * @param array Input data (GPC) * @param object Issue note data manager * @param array (Output) Array of info about this note, in the same form that would come from the DB * @param array (In/Out) Info about this issue, as it would come from the DB * * @return string Preview/error HTML */ function prepare_pt_note_preview($input, &$notedata, &$issuenote, &$issue) { global $vbulletin, $db, $show, $stylevar, $vbphrase, $template_hook; if ($notedata->errors) { require_once DIR . '/includes/functions_newpost.php'; $preview = construct_errors($notedata->errors); } else { require_once DIR . '/includes/class_bbcode.php'; $bbcode =& new vB_BbCodeParser($vbulletin, fetch_tag_list()); $preview_text = $bbcode->parse($input['message'], 'pt'); eval('$preview = "' . fetch_template('pt_preview') . '";'); } $input_map = array('pagetext' => $input['message'], 'private' => $input['private'], 'petitionstatusid' => $input['petitionstatusid'], 'reason' => $input['reason']); $issuenote = $notedata->pt_issuenote + $notedata->existing + $input_map; $issue['subscribetype'] = $input['subscribetype']; return $preview; }
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 ($blogman->errors AS $error) { $xml->add_tag('error', $error); } $xml->close_group(); $xml->print_xml(); } else { define('COMMENTPREVIEW', true); $preview = construct_errors($blogman->errors); // this will take the preview's place $previewpost = true; $_REQUEST['do'] = 'comment'; } } else if ($vbulletin->GPC['preview']) { define('COMMENTPREVIEW', true); $preview = process_blog_preview($blog, 'comment'); $previewpost = true; $_REQUEST['do'] = 'comment'; } else if ($vbulletin->GPC['advanced']) { $_REQUEST['do'] = 'editcomment'; }
if ($vbulletin->GPC['fromquickcomment'] and $vbulletin->GPC['preview']) { $blogman->errors = array(); } if (!empty($blogman->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 ($blogman->errors as $error) { $xml->add_tag('error', $error); } $xml->close_group(); $xml->print_xml(); } else { define('COMMENTPREVIEW', true); $preview = construct_errors($blogman->errors); // this will take the preview's place $previewpost = true; $_REQUEST['do'] = 'comment'; } } else { if ($vbulletin->GPC['preview']) { define('COMMENTPREVIEW', true); $preview = process_blog_preview($blog, 'comment'); $previewpost = true; $_REQUEST['do'] = 'comment'; } else { if ($vbulletin->GPC['advanced']) { $_REQUEST['do'] = 'editcomment'; } else { $blogcommentid = $blogman->save();