Example #1
0
                case '3':
                    // bbcode & plain
                    if ($v == 'message') {
                        unset($VB_API_WHITELIST['response']['layout']['content']['comment_block']['node_comments']['cms_comments']['*']['postbit']['post'][$k]);
                    }
                    break;
            }
        }
    }
}
if ($methodsegments[1] == 'edit' or $methodsegments[1] == 'addcontent') {
    $VB_API_WHITELIST = array('response' => array('content' => array('content' => array('type', 'title', 'contenttypetitle', 'id', 'userid', 'username', 'class', 'url', 'contentid', 'nodeid', 'tags', 'previewtext', 'editor' => array('attachmentoption' => $VB_API_WHITELIST_COMMON['attachmentoption'], 'messagearea' => array('newpost'), 'nodeid', 'posthash', 'poststarttime', 'contentid', 'contenttypeid', 'values'), 'contenttypeid', 'item_type', 'item_class', 'item_id', 'publisher' => array('publishdate', 'calendardateformat', 'username', 'node', 'sectionid', 'categories' => array('*' => array('categoryid', 'checked', 'text', 'title')), 'groups' => array('*' => array('usergroupid', 'title')), 'nodelist' => array('*' => array('nodeid', 'selected', 'parent', 'leaf')), 'setpublish', 'show24', 'hour', 'minute', 'offset', 'showpreview', 'showcomments', 'comments_enabled', 'publicpreview', 'show_showsettings', 'showtitle', 'showuser', 'showpublishdate', 'showpreviewonly', 'showupdated', 'showviewcount', 'showrating', 'settingsforboth', 'show_htmloption', 'htmloption', 'show_hidden', 'hidden', 'show_pagination_link', 'pagination_links', 'is_section', 'show_shownav', 'shownav', 'nosearch', 'show_categories'), 'metadata' => array('html_title', 'description', 'keywords'), 'editbar' => array('formid', 'view_url', 'submit_url', 'is_section', 'candelete'), 'view_url', 'can_edit', 'showtags', 'style_select', 'display_order_select', 'content_layout_select', 'per_page', 'sections', 'displayorder_array', 'perpage_select', 'nodes' => array('*' => array('nodeid', 'sequence', 'view_url', 'title', 'class', 'parenttitle', 'prev_checked', 'published_select', 'author', 'pub_date', 'viewcount', 'replycount')), 'pagination'))), 'bbuserinfo' => array('userid', 'username'));
}
function api_result_prerender_1($t, &$r)
{
    global $vbulletin;
    switch ($t) {
        case 'vbcms_content_article_page':
        case 'vbcms_content_article_preview':
            $r['publishdate'] = $r['publishdateline'];
            $r['previewtext'] = strip_tags($r['previewtext']);
            break;
    }
}
vB_APICallback::instance()->add('result_prerender', 'api_result_prerender_1', 1);
/*======================================================================*\
|| ####################################################################
|| # Downloaded: 03:13, Sat Sep 7th 2013
|| # CVS: $RCSfile$ - $Revision: 35584 $
|| ####################################################################
\*======================================================================*/
Example #2
0
|| # This file may not be redistributed in whole or significant part. # ||
|| # ---------------- VBULLETIN IS NOT FREE SOFTWARE ---------------- # ||
|| # http://www.vbulletin.com | http://www.vbulletin.com/license.html # ||
|| #################################################################### ||
\*======================================================================*/
if (!VB_API) {
    die;
}
$VB_API_ROUTE_SEGMENT_WHITELIST = array('action' => array('list'));
loadCommonWhiteList();
global $methodsegments;
// $methodsegments[0] 'type'
if ($methodsegments[0] == 'category') {
    $VB_API_WHITELIST = array('response' => array('layout' => array('content' => array('rawtitle', 'contents' => array('*' => array('id', 'node', 'title', 'authorid', 'authorname', 'page_url', 'showtitle', 'can_edit', 'showuser', 'showpublishdate', 'viewcount', 'showviewcount', 'showrating', 'publishdate', 'setpublish', 'publishdatelocal', 'publishtimelocal', 'showupdated', 'lastupdated', 'dateformat', 'rating', 'category', 'section_url', 'previewvideo', 'showpreviewonly', 'previewimage', 'previewtext', 'preview_chopped', 'newcomment_url', 'comment_count', 'ratingnum', 'ratingavg', 'avatar')), 'pagenav'))));
    function api_result_prewhitelist_1(&$value)
    {
        if ($value['response']) {
            $value['response']['layout']['content']['contents'] = $value['response']['layout']['content']['content_rendered']['contents'];
            foreach ($value['response']['layout']['content']['contents'] as $k => &$v) {
                $v['title'] = unhtmlspecialchars($v['title']);
            }
        }
    }
    vB_APICallback::instance()->add('result_prewhitelist', 'api_result_prewhitelist_1', 1);
}
/*======================================================================*\
|| ####################################################################
|| # Downloaded: 03:13, Sat Sep 7th 2013
|| # CVS: $RCSfile$ - $Revision: 35584 $
|| ####################################################################
\*======================================================================*/
Example #3
0
 /**
  * Renders the template.
  *
  * @param	boolean	Whether to suppress the HTML comment surrounding option (for JS, etc)
  * @return	string	Rendered version of the template
  */
 public function render($suppress_html_comments = false, $final = false, $nopermissioncheck = false)
 {
     global $vbulletin, $show;
     $vb5_config =& vB::getConfig();
     $callback = vB_APICallback::instance();
     if ($final) {
         self::remove_common_show($show);
         // register whitelisted globals
         $this->register_globals();
         $callback->setname('result_prewhitelist');
         $callback->addParamRef(0, $this->registered);
         $callback->callback();
         if (!($vb5_config['Misc']['debug'] and $vbulletin->GPC['showall'])) {
             $this->whitelist_filter();
         }
         $callback->setname('result_overwrite');
         $callback->addParamRef(0, $this->registered);
         $callback->callback();
         if ($vb5_config['Misc']['debug'] and $vbulletin->GPC['debug']) {
             return '<pre>' . htmlspecialchars(var_export($this->registered, true)) . '</pre>' . '<br />' . number_format(memory_get_usage() / 1024) . 'KB';
         } else {
             // only render data on final render
             return $this->render_output($suppress_html_comments, $nopermissioncheck);
         }
     } else {
         $callback->setname('result_prerender');
         $callback->addParam(0, $this->template);
         $callback->addParamRef(1, $this->registered);
         $callback->callback();
     }
     return $this->render_token();
 }
Example #4
0
 /**
  * Returns singleton instance of self.
  *
  * @return vB_APICallback
  */
 public function instance()
 {
     if (!isset(self::$instance)) {
         $class = __CLASS__;
         self::$instance = new $class();
     }
     return self::$instance;
 }