} if ($vbulletin->GPC['multiquoteempty']) { // setting cookies -- need to force a redirect on IIS because of // some issues with location-based redirects and set-cookie headers $forceredirect = (strpos($_SERVER['SERVER_SOFTWARE'], 'Microsoft-IIS') !== false); if ($vbulletin->GPC['multiquoteempty'] == 'only') { // remove all posts from this thread from the cookie, but leave all the others $vbulletin->input->clean_array_gpc('c', array( 'vbulletin_multiquote' => TYPE_STR )); $quote_postids = explode(',', $vbulletin->GPC['vbulletin_multiquote']); fetch_quotable_posts($quote_postids, $threadinfo['threadid'], $unquoted_post_count, $quoted_post_ids, 'only'); $remaining = array_diff($quote_postids, $quoted_post_ids); setcookie('vbulletin_multiquote', implode(',', $remaining), 0, '/'); } else if ($vbulletin->GPC['multiquoteempty'] == 'all') { // empty the cookie completely setcookie('vbulletin_multiquote', '', 0, '/'); } } else { $forceredirect = false; }
// add quote from the post we are replying to $quote_postids[] = $vbulletin->GPC['p']; if ($quote_postids) { require_once(DIR . '/includes/functions_newpost.php'); require_once(DIR . '/includes/functions_editor.php'); if (is_wysiwyg_compatible(-1, 'qr') == 2) { $unhtmlspecialchars = false; } else { $unhtmlspecialchars = true; } $quotes = fetch_quotable_posts($quote_postids, $threadinfo['threadid'], $unquoted_post_count, $quoted_post_ids, 'only', $unhtmlspecialchars); } $xml = new vB_AJAX_XML_Builder($vbulletin, 'text/xml'); $xml->add_tag('quotes', $quotes); $xml->print_xml(); } if ($_POST['do'] == 'overlay') { $_POST['do'] = 'fetchhtml'; $_POST['template'] = 'overlay'; } if ($_POST['do'] == 'fetchhtml') {
function PostReply($who, $threadid, $pagetext, $quotepostid = 0) { global $db, $vbulletin, $server, $structtypes, $lastpostarray; $result = RegisterService($who); if ($result['Code'] != 0) { $retval['Result'] = $result; return $retval; } $threadinfo = fetch_threadinfo($threadid); $foruminfo = fetch_foruminfo($threadinfo['forumid'], false); $postdm = new vB_DataManager_Post($vbulletin, ERRTYPE_STANDARD); $postdm->set_info('skip_maximagescheck', true); $postdm->set_info('forum', $foruminfo); $postdm->set_info('thread', $threadinfo); $postdm->set('threadid', $threadid); $postdm->set('userid', $vbulletin->userinfo['userid']); $postdm->set('allowsmilie', 1); $postdm->set('visible', 1); $postdm->set('dateline', TIMENOW); if ($quotepostid > 0) { $quote_postids[] = $quotepostid; $quotetxt = fetch_quotable_posts($quote_postids, $threadinfo['threadid'], $unquoted_post_count, $quoted_post_ids, 'only'); $pagetext = "{$quotetxt}{$pagetext}"; } $postdm->set('pagetext', "{$pagetext}"); $postdm->pre_save(); $postid = 0; if (count($postdm->errors) > 0) { // pre_save failed return ErrorResult('pre_save_failed_thread_reply'); } else { $postid = $postdm->save(); require_once './includes/functions_databuild.php'; build_thread_counters($threadinfo['threadid']); build_forum_counters($foruminfo['forumid']); correct_forum_counters($threadinfo['threadid'], $foruminfo['forumid']); mark_thread_read($threadinfo, $foruminfo, $vbulletin->userinfo['userid'], TIMENOW); } $retval['PostID'] = $postid; $result['Code'] = 1; $result['Text'] = "QuotePostID: {$quotepostid}"; $result['RemoteUser'] = ConsumeArray($vbulletin->userinfo, $structtypes['RemoteUser']); $retval['Result'] = $result; return $retval; }