Ejemplo n.º 1
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;
}
define('VB_API_LOADLANG', true);
$VB_API_ROUTE_SEGMENT_WHITELIST = array('action' => array('view', 'edit', 'addcontent'));
loadCommonWhiteList();
global $methodsegments;
// $methodsegments[1] 'action'
if ($methodsegments[1] == 'view') {
    $VB_API_WHITELIST = array('response' => array('layout' => array('content' => array('nodeid', 'title', 'page_url', 'publishdatelocal', 'publishtimelocal', 'filter_unpublished_url', 'section_list_url', 'section_url', 'parenttitle', 'parentid', 'no_results_phrase', 'pagenav', 'class', 'package', 'result_count', 'can_publish', 'published', 'setpublish', 'publishdate', 'showall', 'content' => array('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'))), 'userid', 'username', 'rating', 'ratingnum', 'ratingavg', 'node', 'votechecked', 'showrating', 'comment_block' => array('nodeid', 'threadid', 'pageno', 'node_comments' => array('pagenav', 'cms_comments' => array('*' => array('postid', 'postbit' => array('post' => array('postid', 'avatarurl', 'userid', 'username', 'postdate', 'posttime', 'message', 'message_bbcode', 'message_plain', 'editlink', 'replylink')))))), 'categories' => array('*' => array('category', 'categoryid', 'category_url')), 'showpublishdate', 'showupdated', 'lastupdated', 'viewcount', 'showviewcount', 'dateformat', 'comment_count', 'next_page_url', 'prev_page_url', 'pagelist', 'pagetext', 'thumbnailattachments', 'imageattachments', 'imageattachmentlinks', 'otherattachments', 'threadinfo', 'postitle', 'poststarter', 'postauthor', 'postid', 'promoted_blogid', 'category', 'contentid', 'showtags', 'tag_count', 'tags', 'can_edit', 'message', 'message_plain', 'message_bbcode'))));
    processApiTextFormat($VB_API_WHITELIST['response']['layout']['content']);
    // format switch
    if ($_REQUEST['apitextformat']) {
        foreach ($VB_API_WHITELIST['response']['layout']['content']['comment_block']['node_comments']['cms_comments']['*']['postbit']['post'] as $k => $v) {
            switch ($_REQUEST['apitextformat']) {
                case '1':
                    // plain
                    if ($v == 'message' or $v == 'message_bbcode') {
                        unset($VB_API_WHITELIST['response']['layout']['content']['comment_block']['node_comments']['cms_comments']['*']['postbit']['post'][$k]);
                    }
                    break;
                case '2':
                    // html
                    if ($v == 'message_plain' or $v == 'message_bbcode') {
                        unset($VB_API_WHITELIST['response']['layout']['content']['comment_block']['node_comments']['cms_comments']['*']['postbit']['post'][$k]);
                    }
Ejemplo n.º 2
0
$VB_API_WHITELIST_COMMON['thread'] = array('threadid', 'threadtitle', 'postusername', 'postuserid', 'status', 'del_userid', 'moderatedprefix', 'realthreadid', 'rating', 'sticky', 'preview', 'dot_count', 'dot_lastpost', 'threadiconpath', 'threadicontitle', 'movedprefix', 'typeprefix', 'prefix_rich', 'redirectthreadid', 'starttime', 'dot_count', 'dot_lastpost', 'forumid', 'forumtitle', 'avatarurl', 'pagenav' => array('*' => array('curpage')), 'totalpages', 'lastpagelink', 'taglist', 'expiretime', 'attach', 'replycount', 'views', 'lastposttime', 'highlight', 'lastposterid', 'lastposter', 'lastpostid', 'del_username', 'issubscribed');
$VB_API_WHITELIST_COMMON['threadbit'] = array('thread' => $VB_API_WHITELIST_COMMON['thread'], 'avatar', 'show' => array('threadtitle', 'deletereason', 'viewthread', 'managethread', 'moderated', 'deletedthread', 'rexpires', 'rmanage', 'threadmoved', 'paperclip', 'unsubscribe', 'sticky', 'pagenavmore', 'threadicon', 'gotonewpost', 'threadmoved', 'subscribed', 'pagenav', 'guestuser', 'threadrating', 'threadcount', 'taglist', 'avatar'));
$VB_API_WHITELIST_COMMON['threadinfo'] = array('meta_description', 'prefix_plain_html', 'title', 'threadid', 'rating', 'keywords', 'forumid');
$VB_API_WHITELIST_COMMON['moderator'] = array('moderatorid', 'userid', 'username', 'musername');
$VB_API_WHITELIST_COMMON['forum'] = array('forumid', 'threadcount', 'replycount', 'title', 'description', 'title_clean', 'description_clean', 'lastpostinfo' => array('icon', 'lastpostinfo' => array('lastposter', 'lastposterid', 'lastthread', 'lastthreadid', 'lastposttime', 'trimthread', 'prefix'), 'show' => array('icon', 'lastpostinfo')), 'statusicon', 'moderators' => array('*' => array('moderator' => $VB_API_WHITELIST_COMMON['moderator'])), 'subforums' => array('*' => array('forum' => array('forumid', 'threadcount', 'replycount', 'title', 'description', 'title_clean', 'description_clean', 'statusicon'))), 'browsers');
$VB_API_WHITELIST_COMMON['forumbit'] = array('childforumbits' => array('*' => array('forum' => $VB_API_WHITELIST_COMMON['forum'], 'parent_is_category', 'show' => array('forumsubscription', 'forumdescription', 'subforums', 'browsers'))), 'forum' => $VB_API_WHITELIST_COMMON['forum'], 'parent_is_category', 'show' => array('forumsubscription', 'forumdescription', 'subforums', 'browsers'));
$VB_API_WHITELIST_COMMON['foruminfo'] = array('forumid', 'title', 'description', 'title_clean', 'description_clean', 'prefixrequired');
$VB_API_WHITELIST_COMMON['attachmentoption'] = array('attachments' => array('*' => array('attach' => array('imgpath', 'filesize', 'attachmentid', 'filename', 'extension'))), 'posthash', 'contentid', 'poststarttime', 'attachuserid', 'contenttypeid');
$VB_API_WHITELIST_COMMON['loggedin'] = array('username', 'userid', 'musername', 'buddymark', 'invisiblemark');
$VB_API_WHITELIST_COMMON['activeusers'] = array('*' => array('loggedin' => $VB_API_WHITELIST_COMMON['loggedin']));
$VB_API_WHITELIST_COMMON['bookmarksites'] = array('*' => array('bookmarksite' => array('bookmarksiteid', 'title', 'iconpath', 'link')));
$VB_API_WHITELIST_COMMON['pagenav'] = array('firstnumbers', 'lastnumbers', 'nextnumbers', 'nextpage', 'pagenumber', 'prevnumbers', 'prevpage', 'total', 'totalpages', 'show_prior_elipsis', 'show_after_elipsis', 'pagenav' => array('*' => array('curpage', 'numbers', 'pagenumbers', 'total', 'show' => array('curpage'))));
$VB_API_WHITELIST_COMMON['blog'] = array('blogid', 'profilepicurl', 'postedby_username', 'avatarurl', 'title', 'ratingnum', 'time', 'blogtitle', 'message', 'message_plain', 'message_bbcode', 'edit_time', 'edit_userid', 'edit_username', 'edit_reason', 'tag_list' => array('*' => array('tag', 'tag_url')), 'categorybits' => array('*' => array('category' => array('blogcategoryid', 'creatorid', 'title'))), 'thumbnailattachments', 'imageattachments', 'imageattachmentlinks', 'otherattachments', 'comments_visible', 'hidden');
processApiTextFormat($VB_API_WHITELIST_COMMON['blog']);
$VB_API_WHITELIST_COMMON['responsebits'] = array('*' => array('response' => array('blogtextid', 'checkbox_value', 'userid', 'username', 'musername', 'time', 'avatarurl', 'message', 'message_plain', 'message_bbcode', 'edit_time', 'edit_userid', 'edit_username', 'edit_reason')));
processApiTextFormat($VB_API_WHITELIST_COMMON['responsebits']['*']['response']);
$VB_API_WHITELIST_COMMON['bloginfo'] = array('blog_title', 'username', 'blogid', 'title', 'rating', 'ratingnum', 'ratingavg', 'trackback_visible', 'views', 'userid');
$VB_API_WHITELIST_COMMON['albumbits'] = array('*' => array('album' => array('albumid', 'attachmentid', 'thumbnail_dateline', 'title_html', 'username', 'picturetime', 'picturecount', 'hasthumbnail', 'moderatedcount', 'description_html', 'lastpicturedate', 'pictureurl'), 'show' => array('personalalbum', 'moderated')));
$VB_API_WHITELIST_COMMON['blogsidebarcategory'] = array('sidebar' => array('categorybits' => array('*' => array('category' => array('blogcategoryid', 'userid', 'title', 'description', 'parentid', 'displayorder', 'entrycount', 'childlist', 'parentlist'))), 'localcategorybits', 'globalcategorybits'));
function api_result_prerender_c2($t, &$r)
{
    if ($r['blog']['tag_list']['tag_list']) {
        $temp = array();
        foreach ($r['blog']['tag_list']['tag_list'] as $key => $info) {
            $temp[] = array('tag' => $info['tag'], 'tag_url' => $info['url']);
        }
        $r['blog']['tag_list'] = $temp;
        unset($temp);
    }
    switch ($t) {
        case 'forumhome_lastpostby':