Example #1
0
                 if (!($vbulletin->userinfo['calendarpermissions']["{$calendarinfo['calendarid']}"] & $vbulletin->bf_ugp_calendarpermissions['caneditevent'])) {
                     print_no_permission();
                 }
             }
         }
     }
 } else {
     if (!($vbulletin->userinfo['calendarpermissions']["{$calendarinfo['calendarid']}"] & $vbulletin->bf_ugp_calendarpermissions['canpostevent'])) {
         print_no_permission();
     }
 }
 // unwysiwygify the incoming data
 if ($vbulletin->GPC['wysiwyg']) {
     require_once DIR . '/includes/class_wysiwygparser.php';
     $html_parser = new vB_WysiwygHtmlParser($vbulletin);
     $message = $html_parser->parse_wysiwyg_html_to_bbcode($vbulletin->GPC['message'], $calendarinfo['allowhtml']);
 } else {
     $message = $vbulletin->GPC['message'];
 }
 // init event datamanager class
 $eventdata =& datamanager_init('Event', $vbulletin, ERRTYPE_STANDARD);
 ($hook = vBulletinHook::fetch_hook('calendar_update_process')) ? eval($hook) : false;
 $eventdata->set_info('parseurl', $vbulletin->GPC['parseurl'] and $calendarinfo['allowbbcode']);
 $eventdata->setr_info('fromtime', $fromtime);
 $eventdata->setr_info('totime', $totime);
 $eventdata->setr_info('fromdate', $fromdate);
 $eventdata->setr_info('todate', $todate);
 $eventdata->setr_info('type', $vbulletin->GPC['type']);
 $eventdata->setr_info('recur', $vbulletin->GPC['recur']);
 $eventdata->set('title', $vbulletin->GPC['title']);
 $eventdata->set('event', $message);
Example #2
0
     print_no_permission();
 } else {
     if (!$vbulletin->userinfo['receivepm']) {
         eval(standard_error(fetch_error('pm_turnedoff')));
     }
 }
 if (fetch_privatemessage_throttle_reached($vbulletin->userinfo['userid'])) {
     eval(standard_error(fetch_error('pm_throttle_reached', $vbulletin->userinfo['permissions']['pmthrottlequantity'], $vbulletin->options['pmthrottleperiod'])));
 }
 // include useful functions
 require_once DIR . '/includes/functions_newpost.php';
 // unwysiwygify the incoming data
 if ($vbulletin->GPC['wysiwyg']) {
     require_once DIR . '/includes/class_wysiwygparser.php';
     $html_parser = new vB_WysiwygHtmlParser($vbulletin);
     $vbulletin->GPC['message'] = $html_parser->parse_wysiwyg_html_to_bbcode($vbulletin->GPC['message'], $vbulletin->options['privallowhtml']);
 }
 // parse URLs in message text
 if ($vbulletin->options['privallowbbcode'] and $vbulletin->GPC['parseurl']) {
     $vbulletin->GPC['message'] = convert_url_to_bbcode($vbulletin->GPC['message']);
 }
 $pm['message'] =& $vbulletin->GPC['message'];
 $pm['title'] =& $vbulletin->GPC['title'];
 $pm['parseurl'] =& $vbulletin->GPC['parseurl'];
 $pm['savecopy'] =& $vbulletin->GPC['savecopy'];
 $pm['signature'] =& $vbulletin->GPC['signature'];
 $pm['disablesmilies'] =& $vbulletin->GPC['disablesmilies'];
 $pm['sendanyway'] =& $vbulletin->GPC['sendanyway'];
 $pm['receipt'] =& $vbulletin->GPC['receipt'];
 $pm['recipients'] =& $vbulletin->GPC['recipients'];
 $pm['bccrecipients'] =& $vbulletin->GPC['bccrecipients'];
Example #3
0
 if (defined('IN_CONTROL_PANEL')) {
     echo "<ol>";
 }
 $html_parser = new vB_WysiwygHtmlParser($vbulletin);
 // process the remaining list of items to be inserted
 foreach ($items as $uniquehash => $item) {
     $feed =& $feeds["{$item['rssfeedid']}"];
     $feed['rssoptions'] = intval($feed['rssoptions']);
     if ($feed['rssoptions'] & $vbulletin->bf_misc_feedoptions['html2bbcode']) {
         $body_template = nl2br($feed['bodytemplate']);
     } else {
         $body_template = $feed['bodytemplate'];
     }
     $pagetext = $feed['xml']->parse_template($body_template, $item);
     if ($feed['rssoptions'] & $vbulletin->bf_misc_feedoptions['html2bbcode']) {
         $pagetext = $html_parser->parse_wysiwyg_html_to_bbcode($pagetext, false, true);
         // disable for announcements
         $feed['rssoptions'] = $feed['rssoptions'] & ~$vbulletin->bf_misc_feedoptions['allowhtml'];
     }
     $pagetext = convert_url_to_bbcode($pagetext);
     // insert the forumid of this item into an array for the update_forum_counters() function later
     $update_forumids["{$feed['forumid']}"] = true;
     switch ($feed['itemtype']) {
         // insert item as announcement
         case 'announcement':
             // init announcement datamanager
             $itemdata =& datamanager_init('Announcement', $vbulletin, $error_type);
             $itemdata->set_info('forum', fetch_foruminfo($feed['forumid']));
             $itemdata->set_info('user', $feed);
             $itemdata->set('userid', $feed['userid']);
             $itemdata->set('forumid', $feed['forumid']);
Example #4
0
     if ($xml->parse_xml() === false) {
         print_stop_message('xml_error_x_at_line_y', $xml->feedtype == 'unknown' ? 'Unknown Feed Type' : $xml->xml_object->error_string(), $xml->xml_object->error_line());
     }
 }
 require_once DIR . '/includes/class_bbcode.php';
 $bbcode_parser = new vB_BbCodeParser($vbulletin, fetch_tag_list());
 $output = '';
 $count = 0;
 foreach ($xml->fetch_items() as $item) {
     if ($vbulletin->GPC['maxresults'] and $count++ >= $vbulletin->GPC['maxresults']) {
         break;
     }
     if (!empty($item['content:encoded'])) {
         $content_encoded = true;
     }
     $title = $bbcode_parser->parse(strip_bbcode($html_parser->parse_wysiwyg_html_to_bbcode($xml->parse_template($vbulletin->GPC['titletemplate'], $item))), 0, false);
     if ($vbulletin->GPC['options']['html2bbcode']) {
         $body_template = nl2br($vbulletin->GPC['bodytemplate']);
     } else {
         $body_template = $vbulletin->GPC['bodytemplate'];
     }
     $body = $xml->parse_template($body_template, $item);
     if ($vbulletin->GPC['options']['html2bbcode']) {
         $body = $html_parser->parse_wysiwyg_html_to_bbcode($body, false, true);
     }
     $body = $bbcode_parser->parse($body, 0, false);
     $output .= '<div class="alt2" style="border:inset 1px; padding:5px; width:400px; height: 175px; margin:10px; overflow: auto;"><h3><em>' . $title . '</em></h3>' . $body . '</div>';
 }
 $feed = array();
 foreach ($input_vars as $varname => $foo) {
     $feed["{$varname}"] = $vbulletin->GPC["{$varname}"];
Example #5
0
if ($_POST['do'] == 'postthread') {
    // Variables reused in templates
    $posthash = $vbulletin->input->clean_gpc('p', 'posthash', TYPE_NOHTML);
    $poststarttime = $vbulletin->input->clean_gpc('p', 'poststarttime', TYPE_UINT);
    $vbulletin->input->clean_array_gpc('p', array('wysiwyg' => TYPE_BOOL, 'preview' => TYPE_STR, 'message' => TYPE_STR, 'subject' => TYPE_STR, 'iconid' => TYPE_UINT, 'rating' => TYPE_UINT, 'prefixid' => TYPE_NOHTML, 'taglist' => TYPE_NOHTML, 'postpoll' => TYPE_BOOL, 'polloptions' => TYPE_UINT, 'signature' => TYPE_BOOL, 'disablesmilies' => TYPE_BOOL, 'parseurl' => TYPE_BOOL, 'folderid' => TYPE_UINT, 'subscribe' => TYPE_BOOL, 'emailupdate' => TYPE_UINT, 'stickunstick' => TYPE_BOOL, 'openclose' => TYPE_BOOL, 'htmlstate' => TYPE_STR, 'username' => TYPE_STR, 'loggedinuser' => TYPE_INT, 'humanverify' => TYPE_ARRAY, 'podcasturl' => TYPE_STR, 'podcastsize' => TYPE_UINT, 'podcastexplicit' => TYPE_BOOL, 'podcastkeywords' => TYPE_STR, 'podcastsubtitle' => TYPE_STR, 'podcastauthor' => TYPE_STR));
    if ($vbulletin->GPC['loggedinuser'] != 0 and $vbulletin->userinfo['userid'] == 0) {
        // User was logged in when writing post but isn't now. If we got this
        // far, guest posts are allowed, but they didn't enter a username so
        // they'll get an error. Force them to log back in.
        standard_error(fetch_error('session_timed_out_login'), '', false, 'STANDARD_ERROR_LOGIN');
    }
    ($hook = vBulletinHook::fetch_hook('newthread_post_start')) ? eval($hook) : false;
    if ($vbulletin->GPC['wysiwyg']) {
        require_once DIR . '/includes/class_wysiwygparser.php';
        $html_parser = new vB_WysiwygHtmlParser($vbulletin);
        $newpost['message'] = $html_parser->parse_wysiwyg_html_to_bbcode($vbulletin->GPC['message'], $foruminfo['allowhtml']);
    } else {
        $newpost['message'] =& $vbulletin->GPC['message'];
    }
    if (!($forumperms & $vbulletin->bf_ugp_forumpermissions['canpostpoll'])) {
        $vbulletin->GPC['postpoll'] = false;
    }
    $newpost['title'] =& $vbulletin->GPC['subject'];
    $newpost['iconid'] =& $vbulletin->GPC['iconid'];
    require_once DIR . '/includes/functions_prefix.php';
    if (can_use_prefix($vbulletin->GPC['prefixid'])) {
        $newpost['prefixid'] =& $vbulletin->GPC['prefixid'];
    }
    if ($show['tag_option']) {
        $newpost['taglist'] =& $vbulletin->GPC['taglist'];
    }
Example #6
0
            case 'signature':
                $dohtml = $vbulletin->userinfo['permissions']['signaturepermissions'] & $vbulletin->bf_ugp_signaturepermissions['allowhtml'];
                break;
            default:
                if (intval($vbulletin->GPC['parsetype'])) {
                    $parsetype = intval($vbulletin->GPC['parsetype']);
                    $foruminfo = fetch_foruminfo($parsetype);
                    $dohtml = $foruminfo['allowhtml'];
                    break;
                } else {
                    $dohtml = false;
                }
                //($hook = vBulletinHook::fetch_hook('editor_switch_wysiwyg_to_standard')) ? eval($hook) : false;
        }
        $html_parser = new vB_WysiwygHtmlParser($vbulletin);
        $vbulletin->GPC['pagetext'] = process_replacement_vars($html_parser->parse_wysiwyg_html_to_bbcode($vbulletin->GPC['pagetext'], $dohtml));
    }
    // If we have a posthash then only save it if it is valid
    // this can be used to grab attachments that are attached to this draft
    if ($vbulletin->GPC['posthash'] and $vbulletin->GPC['posthash'] != md5($vbulletin->GPC['poststarttime'] . $vbulletin->userinfo['userid'] . $vbulletin->userinfo['salt'])) {
        $vbulletin->GPC['posthash'] = '';
    }
    $db->query_write("\n\t\tREPLACE INTO " . TABLE_PREFIX . "autosave\n\t\t\t(contenttypeid, contentid, parentcontentid, userid, pagetext, title, posthash, dateline)\n\t\tVALUES\n\t\t(\n\t\t\t'" . $db->escape_string($vbulletin->GPC['contenttypeid']) . "',\n\t\t\t{$vbulletin->GPC['contentid']},\n\t\t\t{$vbulletin->GPC['parentcontentid']},\n\t\t\t{$vbulletin->userinfo['userid']},\n\t\t\t'" . $db->escape_string($vbulletin->GPC['pagetext']) . "',\n\t\t\t'" . $db->escape_string($vbulletin->GPC['title']) . "',\n\t\t\t'" . $db->escape_string($vbulletin->GPC['posthash']) . "',\n\t\t\t" . TIMENOW . "\n\t\t)\n\t");
    $xml = new vB_AJAX_XML_Builder($vbulletin, 'text/xml');
    $xml->add_tag('ok', 1);
    $xml->print_xml();
}
($hook = vBulletinHook::fetch_hook('ajax_complete')) ? eval($hook) : false;
/*======================================================================*\
|| ####################################################################
|| # Downloaded: 03:13, Sat Sep 7th 2013
Example #7
0
 $vbulletin->input->clean_array_gpc('p', array('wysiwyg' => TYPE_BOOL, 'message' => TYPE_STR, 'preview' => TYPE_STR, 'deletesigpic' => TYPE_BOOL, 'sigpicurl' => TYPE_STR));
 if (!($permissions['genericpermissions'] & $vbulletin->bf_ugp_genericpermissions['canusesignature'])) {
     eval(standard_error(fetch_error('nosignaturepermission')));
 }
 if ($permissions['signaturepermissions'] & $vbulletin->bf_ugp_signaturepermissions['cansigpic']) {
     $vbulletin->input->clean_gpc('f', 'upload', TYPE_FILE);
 }
 require_once DIR . '/includes/class_bbcode.php';
 require_once DIR . '/includes/class_sigparser.php';
 require_once DIR . '/includes/functions_misc.php';
 $errors = array();
 // DO WYSIWYG processing to get to BB code.
 if ($vbulletin->GPC['wysiwyg']) {
     require_once DIR . '/includes/class_wysiwygparser.php';
     $html_parser = new vB_WysiwygHtmlParser($vbulletin);
     $signature = $html_parser->parse_wysiwyg_html_to_bbcode($vbulletin->GPC['message'], $permissions['signaturepermissions'] & $vbulletin->bf_ugp_signaturepermissions['allowhtml']);
 } else {
     $signature = $vbulletin->GPC['message'];
 }
 ($hook = vBulletinHook::fetch_hook('profile_updatesignature_start')) ? eval($hook) : false;
 // handle image uploads
 if ($vbulletin->GPC['deletesigpic']) {
     if (preg_match('#\\[sigpic\\](.*)\\[/sigpic\\]#siU', $signature)) {
         $errors[] = fetch_error('sigpic_in_use');
     } else {
         $userpic =& datamanager_init('Userpic_Sigpic', $vbulletin, ERRTYPE_STANDARD, 'userpic');
         $userpic->condition = "userid = " . $vbulletin->userinfo['userid'];
         $userpic->delete();
     }
     $redirectsig = true;
 } else {
Example #8
0
/**
* Returns process pagetext
*
* @param	string	Text to process
*
* @return	array	text and bbcode, bbcode is used by VB_API
*/
function process_toolbar_text($text, $toolbartype, $ishtml, $forumid, $allowsmilie, $parsesmilie)
{
    global $vbulletin;
    $result = array('message' => '', 'bbcode' => '');
    if (!$text) {
        return $result;
    }
    if ($toolbartype == 2 or defined('VB_API') and VB_API === true) {
        // got to parse the message to be displayed from bbcode into HTML
        if ($text !== '') {
            require_once DIR . '/includes/class_wysiwygparser.php';
            $html_parser = new vB_WysiwygHtmlParser($vbulletin);
            $result['message'] = $html_parser->parse_wysiwyg_html($text, $ishtml, $forumid, ($allowsmilie and $parsesmilie) ? 1 : 0);
        } else {
            $result['message'] = '';
        }
        $result['message'] = htmlspecialchars_uni($result['message']);
        if (defined('VB_API') and VB_API === true) {
            if ($ishtml) {
                require_once DIR . '/includes/class_wysiwygparser.php';
                $html_parser = new vB_WysiwygHtmlParser($vbulletin);
                $result['bbcode'] = $html_parser->parse_wysiwyg_html_to_bbcode($result['message']);
            } else {
                $result['bbcode'] = $result['message'];
            }
        }
    } else {
        $result['message'] = $text;
    }
    return $result;
}