コード例 #1
0
 /**
  * Sets the breadcrumbs for the route
  *
  * @return	array
  */
 protected function setBreadcrumbs()
 {
     $this->breadcrumbs = array();
     $phrase = 'create_new_topic';
     if (isset($this->arguments['nodeid']) && $this->arguments['nodeid']) {
         $onlyAddTopParent = false;
         $channelInfo = vB_Api::instanceInternal('Content_Channel')->fetchChannelById(intval($this->arguments['nodeid']));
         if ($channelInfo) {
             switch ($channelInfo['channeltype']) {
                 case 'blog':
                     $phrase = 'create_new_blog_entry';
                     break;
                 case 'group':
                     $phrase = 'create_new_topic';
                     break;
                 case 'article':
                     $phrase = 'create_new_article';
                     // when creating an article, the breadcrumb should
                     // always be home > articles > create article
                     // since you can choose the category when creating the article
                     $onlyAddTopParent = true;
                     break;
                 default:
                     break;
             }
         }
         $this->addParentNodeBreadcrumbs($this->arguments['nodeid'], $onlyAddTopParent);
     }
     $this->breadcrumbs[] = array('phrase' => $phrase);
 }
コード例 #2
0
ファイル: blog.php プロジェクト: cedwards-reisys/nexus-web
 /**
  * Create a blog channel.
  *
  * @param array $input
  * @param int $channelid
  * @param int $channelConvTemplateid
  * @param int $channelPgTemplateId
  * @param int $ownerSystemGroupId
  *
  * @return int The nodeid of the new blog channel
  */
 public function createChannel($input, $channelid, $channelConvTemplateid, $channelPgTemplateId, $ownerSystemGroupId)
 {
     $input['parentid'] = $channelid;
     $input['inlist'] = 1;
     // we don't want it to be shown in channel list, but we want to move them
     $input['protected'] = 0;
     if (empty($input['userid'])) {
         $input['userid'] = vB::getCurrentSession()->get('userid');
     }
     if (!isset($input['publishdate'])) {
         $input['publishdate'] = vB::getRequest()->getTimeNow();
     }
     $input['templates']['vB5_Route_Channel'] = $channelPgTemplateId;
     $input['templates']['vB5_Route_Conversation'] = $channelConvTemplateid;
     // add channel node
     $channelLib = vB_Library::instance('content_channel');
     $input['page_parentid'] = 0;
     $result = $channelLib->add($input, array('skipFloodCheck' => true, 'skipDupCheck' => true));
     //Make the current user the channel owner.
     $userApi = vB_Api::instanceInternal('user');
     $usergroup = vB::getDbAssertor()->getRow('usergroup', array('systemgroupid' => $ownerSystemGroupId));
     if (empty($usergroup) or !empty($usergroup['errors'])) {
         //This should never happen. It would mean an invalid parameter was passed
         throw new vB_Exception_Api('invalid_request');
     }
     vB_User::setGroupInTopic($input['userid'], $result['nodeid'], $usergroup['usergroupid']);
     vB_Cache::allCacheEvent(array('nodeChg_' . $this->blogChannel, "nodeChg_{$channelid}"));
     vB::getUserContext()->rebuildGroupAccess();
     vB_Channel::rebuildChannelTypes();
     // clear follow cache
     vB_Api::instanceInternal('follow')->clearFollowCache(array($input['userid']));
     return $result['nodeid'];
 }
コード例 #3
0
ファイル: article.php プロジェクト: cedwards-reisys/nexus-web
 /**
  * Create an article category channel. This function works basically like the blog library's version
  *
  * @param array 	$input						data array, should have standard channel data like title, parentid, 
  * @param int 		$channelid					parentid that the new channel should fall under. 
  * @param int		$channelConvTemplateid		"Conversation" level pagetemplate to use. Typically vB_Page::getArticleConversPageTemplate()
  * @param int 		$channelPgTemplateId		"Channel" level pagetemplate to use. Typically  vB_Page::getArticleChannelPageTemplate()
  * @param int 		$ownerSystemGroupId
  *
  * @return int The nodeid of the new blog channel
  */
 public function createChannel($input, $channelid, $channelConvTemplateid, $channelPgTemplateId, $ownerSystemGroupId)
 {
     if (!isset($input['parentid']) or intval($input['parentid']) < 1) {
         $input['parentid'] = $channelid;
     }
     $input['inlist'] = 1;
     // we don't want it to be shown in channel list, but we want to move them
     $input['protected'] = 0;
     if (empty($input['userid'])) {
         $input['userid'] = vB::getCurrentSession()->get('userid');
     }
     if (!isset($input['publishdate'])) {
         $input['publishdate'] = vB::getRequest()->getTimeNow();
     }
     $input['templates']['vB5_Route_Channel'] = $channelPgTemplateId;
     $input['templates']['vB5_Route_Article'] = $channelConvTemplateid;
     $input['childroute'] = 'vB5_Route_Article';
     // add channel node
     $channelLib = vB_Library::instance('content_channel');
     $input['page_parentid'] = 0;
     $result = $channelLib->add($input, array('skipNotifications' => true, 'skipFloodCheck' => true, 'skipDupCheck' => true));
     //Make the current user the channel owner.
     $userApi = vB_Api::instanceInternal('user');
     $usergroup = vB::getDbAssertor()->getRow('usergroup', array('systemgroupid' => $ownerSystemGroupId));
     vB_Cache::allCacheEvent(array('nodeChg_' . $this->articleHomeChannel, "nodeChg_{$channelid}"));
     vB::getUserContext()->rebuildGroupAccess();
     vB_Channel::rebuildChannelTypes();
     // clear follow cache
     vB_Api::instanceInternal('follow')->clearFollowCache(array($input['userid']));
     return $result['nodeid'];
 }
コード例 #4
0
function do_get_conversations()
{
    $userinfo = vB_Api::instance('user')->fetchUserInfo();
    $cleaned = vB::getCleaner()->cleanArray($_REQUEST, array('page' => vB_Cleaner::TYPE_UINT, 'perpage' => vB_Cleaner::TYPE_UINT));
    if (!$userinfo['userid']) {
        return json_error(ERR_INVALID_LOGGEDIN, RV_NOT_LOGGED_IN);
    }
    $pm_out = array();
    $totalmessages = 0;
    $page = $cleaned['page'] ? $cleaned['page'] : 1;
    $perpage = $cleaned['perpage'] ? $cleaned['perpage'] : 10;
    $folders = vB_Api::instanceInternal('content_privatemessage')->listFolders();
    $folderid = array_search("Inbox", $folders);
    $order = "desc";
    $messages = vB_Api::instanceInternal('content_privatemessage')->listMessages(array("folderid" => $folderid, "page" => $page, "perpage" => $perpage, "sortDir" => $order));
    if ($messages == false) {
        json_error("Invalid PM Folder");
    }
    $totalmessages = vB_Api::instance('content_privatemessage')->getFolderMsgCount($folderid);
    $totalmessages = $totalmessages['count'];
    foreach ($messages as $message) {
        $pm_out[] = fr_parse_conversation($message);
    }
    return array('conversations' => $pm_out, 'total_conversations' => $totalmessages, 'canstart' => true);
}
コード例 #5
0
function construct_user_ip_table($userid, $previpaddress, $depth = 2)
{
    global $vbulletin, $vbphrase;
    if (VB_AREA == 'AdminCP') {
        $userscript = 'usertools.php';
    } else {
        $userscript = 'user.php';
    }
    $depth--;
    $ips = vB_Api::instanceInternal('user')->searchIP($userid, $depth);
    $retdata = '';
    // @TODO user api currently returns only 1 IP per user.
    $result = array('ipaddress' => $ips['regip']);
    foreach ($result as $ip) {
        $retdata .= '<li>' . "<a href=\"{$userscript}?" . vB::getCurrentSession()->get('sessionurl') . "do=gethost&amp;ip={$ip['ipaddress']}\" title=\"" . $vbphrase['resolve_address'] . "\">{$ip['ipaddress']}</a> &nbsp; " . construct_link_code($vbphrase['find_more_users_with_this_ip_address'], "{$userscript}?" . vB::getCurrentSession()->get('sessionurl') . "do=doips&amp;ipaddress={$ip['ipaddress']}&amp;hash=" . CP_SESSIONHASH) . "</li>\n";
        if ($depth > 0) {
            $retdata .= construct_ip_usage_table($ip['ipaddress'], $userid, $depth);
        }
    }
    if (empty($retdata)) {
        return '';
    } else {
        return '<ul>' . $retdata . '</ul>';
    }
}
コード例 #6
0
ファイル: node.php プロジェクト: cedwards-reisys/nexus-web
 public function getCanonicalRoute()
 {
     if (!isset($this->canonicalRoute)) {
         if (empty($this->arguments['nodeid'])) {
             throw new vB_Exception_NodePermission();
         }
         $nodeApi = vB_Api::instanceInternal('node');
         try {
             // this method will return an error if the user does not have permission
             $node = $nodeApi->getNode($this->arguments['nodeid']);
         } catch (vB_Exception_Api $ex) {
             // throw the proper NodePermission exception to return a 403 status instead of a 500 internal error
             if ($ex->has_errors('no_permission')) {
                 throw new vB_Exception_NodePermission($this->arguments['nodeid']);
             } else {
                 // otherwise, just let the caller catch the exception
                 throw $ex;
             }
         }
         $contentApi = vB_Api_Content::getContentApi($node['contenttypeid']);
         if (!$contentApi->validate($node, vB_Api_Content::ACTION_VIEW, $node['nodeid'], array($node['nodeid'] => $node))) {
             throw new vB_Exception_NodePermission($node['nodeid']);
         }
         $parent = $nodeApi->getNode($node['starter']);
         $parent['innerPost'] = $this->arguments['nodeid'];
         $this->canonicalRoute = self::getRoute($node['routeid'], $parent, $this->queryParameters);
     }
     return $this->canonicalRoute;
 }
コード例 #7
0
ファイル: 91.php プロジェクト: cedwards-reisys/nexus-web
 protected function buildOutputFromItems($items, $options)
 {
     parent::buildOutputFromItems($items, $options);
     $xml = new vB_Xml_Builder();
     $xml->add_group('rss', array('version' => '0.91'));
     $xml->add_group('channel');
     $xml->add_tag('title', $this->rssinfo['title']);
     $xml->add_tag('link', $this->rssinfo['link'] . '/', array(), false, true);
     $xml->add_tag('description', $this->rssinfo['description']);
     $xml->add_tag('language', $this->defaultLang['languagecode']);
     $xml->add_group('image');
     $xml->add_tag('url', $this->rssinfo['icon']);
     $xml->add_tag('title', $this->rssinfo['title']);
     $xml->add_tag('link', $this->rssinfo['link'] . '/', array(), false, true);
     $xml->close_group('image');
     $dateformat = vB::getDatastore()->getOption('dateformat');
     $timeformat = vB::getDatastore()->getOption('timeformat');
     // gather channel info
     $channelsInfo = $this->getItemsChannelInfo($items);
     $items = $this->formatItems($items, $options);
     foreach ($items as $id => $item) {
         $item = $item['content'];
         $xml->add_group('item');
         $xml->add_tag('title', $item['external_prefix_plain'] . vB_String::htmlSpecialCharsUni($item['external_title']));
         $xml->add_tag('link', vB_Api::instanceInternal('route')->getAbsoluteNodeUrl($item['external_nodeid']), array(), false, true);
         $xml->add_tag('description', vB_Phrase::fetchSinglePhrase('rss_91_forum_w_posted_by_x_post_time_y_at_z', array($channelsInfo[$item['channelid']]['htmltitle'], $item['authorname'], $this->callvBDate($dateformat, $item['publishdate']), $this->callvBDate($timeformat, $item['publishdate']))));
         $xml->close_group('item');
     }
     $xml->close_group('channel');
     $xml->close_group('rss');
     $output .= '<!DOCTYPE rss PUBLIC "-//RSS Advisory Board//DTD RSS 0.91//EN" "http://www.rssboard.org/rss-0.91.dtd">' . "\r\n";
     $output .= $xml->output();
     return $xml->fetch_xml_tag() . $output;
 }
コード例 #8
0
 /**
  * Returns the phrased page title based on the GUID
  *
  * @param string Page GUID
  */
 public function getPageTitleByGuid($guid)
 {
     $phraseLib = vB_Library::instance('phrase');
     $phraseVarname = 'page_' . $phraseLib->cleanGuidForPhrase($guid) . '_title';
     $phrases = vB_Api::instanceInternal('phrase')->fetch(array($phraseVarname));
     return $phrases[$phraseVarname];
 }
コード例 #9
0
 /**
  * Fetches announcements by channel ID
  *
  * @param  int              $channelid (optional) Channel ID
  * @param  int              $announcementid (optional) Announcement ID
  *
  * @throws vB_Exception_Api no_permission if the user doesn't have permission to view the announcements
  *
  * @return array            Announcements, each element is an array containing all the fields
  *                          in the announcement table and username, avatarurl, and the individual
  *                          options from the announcementoptions bitfield-- dohtml, donl2br,
  *                          dobbcode, dobbimagecode, dosmilies.
  */
 public function fetch($channelid = 0, $announcementid = 0)
 {
     $usercontext = vB::getUserContext();
     $userapi = vB_Api::instanceInternal('user');
     $channelapi = vB_Api::instanceInternal('content_channel');
     $parentids = array();
     // Check channel permission
     if ($channelid) {
         // This is to verify $channelid
         $channelapi->fetchChannelById($channelid);
         if (!$usercontext->getChannelPermission('forumpermissions', 'canview', $channelid)) {
             throw new vB_Exception_Api('no_permission');
         }
         $parents = vB_Library::instance('node')->getParents($channelid);
         foreach ($parents as $parent) {
             if ($parent['nodeid'] != 1) {
                 $parentids[] = $parent['nodeid'];
             }
         }
     }
     $data = array(vB_dB_Query::TYPE_KEY => vB_dB_Query::QUERY_SELECT, vB_dB_Query::CONDITIONS_KEY => array(array('field' => 'startdate', 'value' => vB::getRequest()->getTimeNow(), 'operator' => vB_dB_Query::OPERATOR_LTE), array('field' => 'enddate', 'value' => vB::getRequest()->getTimeNow(), 'operator' => vB_dB_Query::OPERATOR_GTE)));
     if ($parentids) {
         $parentids[] = -1;
         // We should always include -1 for global announcements
         $data[vB_dB_Query::CONDITIONS_KEY][] = array('field' => 'nodeid', 'value' => $parentids);
     } elseif ($channelid) {
         $channelid = array($channelid, -1);
         // We should always include -1 for global announcements
         $data[vB_dB_Query::CONDITIONS_KEY][] = array('field' => 'nodeid', 'value' => $channelid);
     } else {
         $data[vB_dB_Query::CONDITIONS_KEY][] = array('field' => 'nodeid', 'value' => '-1');
     }
     $announcements = $this->assertor->getRows('vBForum:announcement', $data, array('field' => array('startdate', 'announcementid'), 'direction' => array(vB_dB_Query::SORT_DESC, vB_dB_Query::SORT_DESC)));
     if (!$announcements) {
         return array();
     } else {
         $results = array();
         $bf_misc_announcementoptions = vB::getDatastore()->getValue('bf_misc_announcementoptions');
         foreach ($announcements as $k => $post) {
             $userinfo = $userapi->fetchUserinfo($post['userid'], array(vB_Api_User::USERINFO_AVATAR, vB_Api_User::USERINFO_SIGNPIC));
             $announcements[$k]['username'] = $userinfo['username'];
             $announcements[$k]['avatarurl'] = $userapi->fetchAvatar($post['userid']);
             $announcements[$k]['dohtml'] = $post['announcementoptions'] & $bf_misc_announcementoptions['allowhtml'];
             if ($announcements[$k]['dohtml']) {
                 $announcements[$k]['donl2br'] = false;
             } else {
                 $announcements[$k]['donl2br'] = true;
             }
             $announcements[$k]['dobbcode'] = $post['announcementoptions'] & $bf_misc_announcementoptions['allowbbcode'];
             $announcements[$k]['dobbimagecode'] = $post['announcementoptions'] & $bf_misc_announcementoptions['allowbbcode'];
             $announcements[$k]['dosmilies'] = $post['announcementoptions'] & $bf_misc_announcementoptions['allowsmilies'];
             if ($announcements[$k]['dobbcode'] and $post['announcementoptions'] & $bf_misc_announcementoptions['parseurl']) {
                 require_once DIR . '/includes/functions_newpost.php';
                 $announcements[$k]['pagetext'] = convert_url_to_bbcode($post['pagetext']);
             }
         }
         return $announcements;
     }
 }
コード例 #10
0
ファイル: rss.php プロジェクト: cedwards-reisys/nexus-web
 /**
  * Loads information needed for RSS output
  *
  * @param 	array 	Options to be considered for feed.
  */
 protected function loadRssInfo($options)
 {
     $description = $this->getPhraseFromGuid(vB_Page::PAGE_HOME, 'metadesc');
     $stylevars = vB_Api::instanceInternal('style')->fetchStylevars(array(vB::getDatastore()->getOption('styleid')));
     $imgdir = (!empty($stylevars['imgdir_misc']) and !empty($stylevars['imgdir_misc']['imagedir'])) ? $stylevars['imgdir_misc']['imagedir'] : '';
     $this->rssinfo = array('title' => vB::getDatastore()->getOption('bbtitle'), 'link' => vB::getDatastore()->getOption('frontendurl'), 'icon' => vB::getDatastore()->getOption('bburl') . '/' . $imgdir . '/rss.png', 'description' => $description, 'ttl' => 60);
     $this->rssinfo = $this->applyRssOptions($options, $this->rssinfo);
 }
コード例 #11
0
ファイル: profile.php プロジェクト: cedwards-reisys/nexus-web
 /**
  * Sets the breadcrumbs for the route
  */
 protected function setBreadcrumbs()
 {
     //if we are coming in for a route (instead of generating a URL) then the $this->arguments['username'] is the
     //url slug, which we don't want.  The API call is cached and will be called later anyway to generate the
     //profile page so its not a bit performance hit to load this way.
     $userInfo = vB_Api::instanceInternal('user')->fetchProfileInfo($this->arguments['userid']);
     $this->breadcrumbs = array(0 => array('title' => $userInfo['username'], 'url' => ''));
 }
コード例 #12
0
 public function call($forumid, $perpage = 20, $pagenumber = 1)
 {
     $contenttype = vB_Api::instance('contenttype')->fetchContentTypeIdFromClass('Channel');
     $forum = vB_Api::instance('node')->getNodeFullContent($forumid);
     if (empty($forum) or isset($forum['errors'])) {
         return array("response" => array("errormessage" => array("invalidid")));
     }
     $forum = $forum[$forumid];
     $modPerms = vB::getUserContext()->getModeratorPerms($forum);
     $foruminfo = array('forumid' => $forum['nodeid'], 'title' => vB_String::unHtmlSpecialChars($forum['title']), 'description' => $forum['description'], 'title_clean' => $forum['htmltitle'], 'description_clean' => strip_tags($forum['description']), 'prefixrequired' => 0);
     $nodes = vB_Api::instance('node')->fetchChannelNodeTree($forumid, 3);
     $channels = array();
     if (!empty($nodes) and empty($nodes['errors']) and isset($nodes['channels']) and !empty($nodes['channels'])) {
         foreach ($nodes['channels'] as $node) {
             $channels[] = vB_Library::instance('vb4_functions')->parseForum($node);
         }
     }
     $forumbits = $channels;
     $topics = array();
     $topics_sticky = array();
     $page_nav = vB_Library::instance('vb4_functions')->pageNav(1, $perpage, 1);
     $search = array("channel" => $forumid);
     $search['view'] = vB_Api_Search::FILTER_VIEW_TOPIC;
     $search['depth'] = 1;
     $search['include_sticky'] = true;
     $search['sort']['lastcontent'] = 'desc';
     $search['nolimit'] = 1;
     $topic_search = vB_Api::instanceInternal('search')->getInitialResults($search, $perpage, $pagenumber, true);
     if (!isset($topic_search['errors']) and !empty($topic_search['results'])) {
         $topic_search['results'] = vB_Api::instance('node')->mergeNodeviewsForTopics($topic_search['results']);
         foreach ($topic_search['results'] as $key => $node) {
             if ($node['content']['contenttypeclass'] == 'Channel' or $node['content']['starter'] != $node['content']['nodeid']) {
                 unset($topic_search['results'][$key]);
             } else {
                 $topic = vB_Library::instance('vb4_functions')->parseThread($node);
                 if ($topic['thread']['sticky']) {
                     $topics_sticky[] = $topic;
                 } else {
                     $topics[] = $topic;
                 }
             }
         }
         $page_nav = vB_Library::instance('vb4_functions')->pageNav($topic_search['pagenumber'], $perpage, $topic_search['totalRecords']);
     }
     $inlinemod = $forum['canmoderate'] ? 1 : 0;
     $subscribed = vB_Api::instance('follow')->isFollowingContent($forum['nodeid']);
     $subscribed = $subscribed ? 1 : 0;
     $forumsearch = vB::getUserContext()->hasPermission('forumpermissions', 'cansearch');
     $response = array();
     $response['response']['forumbits'] = $forumbits;
     $response['response']['foruminfo'] = $foruminfo;
     $response['response']['threadbits'] = $topics;
     $response['response']['threadbits_sticky'] = $topics_sticky;
     $response['response']['pagenav'] = $page_nav;
     $response['response']['pagenumber'] = intval($pagenumber);
     $response['show'] = array('subscribed_to_forum' => $subscribed, 'inlinemod' => $inlinemod, 'spamctrls' => $modPerms['candeleteposts'] > 0 ? 1 : 0, 'openthread' => $modPerms['canopenclose'] > 0 ? 1 : 0, 'approvethread' => $modPerms['canmoderateposts'] > 0 ? 1 : 0, 'movethread' => $modPerms['canmassmove'] > 0 ? 1 : 0, 'forumsearch' => $forumsearch, 'stickies' => count($topics_sticky) > 0 ? 1 : 0);
     return $response;
 }
コード例 #13
0
 /**
  * Fetch all subscriptions that an user can join and already joined
  * It also fetches active payment APIs
  *
  * @param bool $isreg Whether to fetch subscriptions for signup page
  * @return array Paid subscriptions info for the user.
  */
 public function fetchAll($isreg = false)
 {
     try {
         $this->checkStatus();
     } catch (vB_Exception_Api $e) {
         return array();
     }
     $userinfo = vB::getCurrentSession()->fetch_userinfo();
     $usercontext = vB::getUserContext();
     $membergroupids = fetch_membergroupids_array($userinfo);
     $allow_secondary_groups = $usercontext->hasPermission('genericoptions', 'allowmembergroups');
     $subscribed = $this->fetchSubscribed();
     $vbphrase = vB_Api::instanceInternal('phrase')->fetch(array('day', 'week', 'month', 'year', 'days', 'weeks', 'months', 'years', 'length_x_units_y_recurring_z', 'recurring'));
     $lengths = array('D' => $vbphrase['day'], 'W' => $vbphrase['week'], 'M' => $vbphrase['month'], 'Y' => $vbphrase['year'], 'Ds' => $vbphrase['days'], 'Ws' => $vbphrase['weeks'], 'Ms' => $vbphrase['months'], 'Ys' => $vbphrase['years']);
     $cansubscribesubscriptions = array();
     $subscribedsubscriptions = array();
     foreach ($this->subobj->subscriptioncache as $subscription) {
         $subscriptionid =& $subscription['subscriptionid'];
         $subscription['cost'] = unserialize($subscription['cost']);
         $subscription['newoptions'] = @unserialize($subscription['newoptions']);
         foreach ($subscription['cost'] as $key => $currentsub) {
             if ($currentsub['length'] == 1) {
                 $currentsub['units'] = $lengths["{$currentsub['units']}"];
             } else {
                 $currentsub['units'] = $lengths[$currentsub['units'] . 's'];
             }
             $subscription['cost'][$key]['subscription_length'] = construct_phrase($vbphrase['length_x_units_y_recurring_z'], $currentsub['length'], $currentsub['units'], $currentsub['recurring'] ? " ({$vbphrase['recurring']})" : '');
         }
         if (isset($subscribed["{$subscription['subscriptionid']}"])) {
             // This subscription has been subscribed by the user
             $subscribedsubscriptions[$subscriptionid] = $subscription;
             $subscribedsubscriptions[$subscriptionid]['subscribed'] = $subscribed["{$subscription['subscriptionid']}"];
         }
         if ($subscription['active']) {
             if ($isreg and empty($subscription['newoptions']['regshow'])) {
                 // Display paid subscription during registration is set to false
                 continue;
             }
             // Check whether to show the subscription to the user.
             if (!empty($subscription['deniedgroups']) and ($allow_secondary_groups and !count(array_diff($membergroupids, $subscription['deniedgroups'])) or !$allow_secondary_groups and in_array($userinfo['usergroupid'], $subscription['deniedgroups']))) {
                 continue;
             }
             // List allowed payment apis
             $allowedapis = array();
             foreach ((array) $subscription['newoptions']['api'] as $api => $options) {
                 if (!empty($options['show'])) {
                     $allowedapis[] = $api;
                 }
             }
             $subscription['allowedapis'] = json_encode($allowedapis);
             $cansubscribesubscriptions[$subscriptionid] = $subscription;
         }
     }
     if (!$cansubscribesubscriptions and !$subscribedsubscriptions) {
         return array();
     }
     return array('subscribed' => $subscribedsubscriptions, 'cansubscribe' => $cansubscribesubscriptions, 'paymentapis' => $this->apicache, 'currencysymbols' => $this->subobj->_CURRENCYSYMBOLS);
 }
コード例 #14
0
ファイル: video.php プロジェクト: cedwards-reisys/nexus-web
 /**
  * Adds a new node.
  *
  * @param  mixed   Array of field => value pairs which define the record.
  * @param  array   Array of options for the content being created.
  *                 Understands skipTransaction, skipFloodCheck, floodchecktime, skipDupCheck, skipNotification, nl2br, autoparselinks.
  *                 - nl2br: if TRUE, all \n will be converted to <br /> so that it's not removed by the html parser (e.g. comments).
  *                 - wysiwyg: if true convert html to bbcode.  Defaults to true if not given.
  *
  * @return integer the new nodeid
  */
 public function add($data, $options = array())
 {
     vB_Api::instanceInternal('hv')->verifyToken($data['hvinput'], 'post');
     if (vB_Api::instanceInternal('node')->fetchAlbumChannel() == $data['parentid'] and !vB::getUserContext()->hasPermission('albumpermissions', 'picturefollowforummoderation')) {
         $data['approved'] = 0;
         $data['showapproved'] = 0;
     }
     return parent::add($data, $options);
 }
コード例 #15
0
/**
* Fetches the online states for the user, taking into account the browsing
* user's viewing permissions. Also modifies the user to include [buddymark]
* and [invisiblemark]
*
* @param	array	Array of userinfo to fetch online status for
* @param	boolean	True if you want to set $user[onlinestatus] with template results
*
* @return	integer	0 = offline, 1 = online, 2 = online but invisible (if permissions allow)
*/
function fetch_online_status(&$user)
{
    static $buddylist, $datecut;
    $session = vB::getCurrentSession();
    if (empty($session)) {
        $currentUserId = 0;
    } else {
        $currentUserId = vB::getCurrentSession()->get('userid');
    }
    // get variables used by this function
    if (!isset($buddylist) and !empty($currentUserId)) {
        $buddylist = array();
        //If we are asking for the current user's status we can skip the fetch
        if ($currentUserId == $user['userid']) {
            $currentUser =& $user;
        } else {
            $currentUser = vB_Api::instanceInternal('user')->fetchCurrentUserInfo();
        }
        if (isset($currentUser['buddylist']) and $currentUser['buddylist'] = trim($currentUser['buddylist'])) {
            $buddylist = preg_split('/\\s+/', $currentUser['buddylist'], -1, PREG_SPLIT_NO_EMPTY);
        }
    }
    if (!isset($datecut)) {
        $datecut = vB::getRequest()->getTimeNow() - vB::getDatastore()->getOption('cookietimeout');
    }
    // is the user on bbuser's buddylist?
    if (isset($buddylist) and is_array($buddylist) and in_array($user['userid'], $buddylist)) {
        $user['buddymark'] = '+';
    } else {
        $user['buddymark'] = '';
    }
    // set the invisible mark to nothing by default
    $user['invisiblemark'] = '';
    $onlinestatus = 0;
    $user['online'] = 'offline';
    // now decide if we can see the user or not
    if ($user['lastactivity'] > $datecut and $user['lastvisit'] != $user['lastactivity']) {
        $bf_misc_useroptions = vB::getDatastore()->getValue('bf_misc_useroptions');
        if ($user['options'] & $bf_misc_useroptions['invisible']) {
            if (!isset($userContext)) {
                $userContext = vB::getUserContext();
            }
            if ($currentUserId == $user['userid'] or $userContext and $userContext->hasPermission('genericpermissions', 'canseehidden')) {
                // user is online and invisible BUT bbuser can see them
                $user['invisiblemark'] = '*';
                $user['online'] = 'invisible';
                $onlinestatus = 2;
            }
        } else {
            // user is online and visible
            $onlinestatus = 1;
            $user['online'] = 'online';
        }
    }
    return $onlinestatus;
}
コード例 #16
0
 /**
  * Verifies that the specified nodeid is valid
  *
  * @param	integer	Forum ID (allow -1 = all forums)
  *
  * @return	boolean
  */
 function verify_nodeid(&$forumid)
 {
     $channels = vB_Api::instanceInternal('search')->getChannels(true);
     if ($forumid == -1 or isset($channels["{$forumid}"])) {
         return true;
     } else {
         $this->error('invalid_forum_specified');
         return false;
     }
 }
コード例 #17
0
function build_bbcode_video($checktable = false)
{
    if ($checktable) {
        try {
            vB::getDbAssertor()->assertQuery('bbcode_video', array(vB_dB_Query::TYPE_KEY => vB_dB_Query::QUERY_SELECT));
        } catch (Exception $e) {
            return false;
        }
    }
    require_once DIR . '/includes/class_xml.php';
    $xmlobj = new vB_XML_Parser(false, DIR . '/includes/xml/bbcode_video_vbulletin.xml');
    $data = $xmlobj->parse();
    if (is_array($data['provider'])) {
        $insert = array();
        foreach ($data['provider'] as $provider) {
            $items = array();
            $items['tagoption'] = $provider['tagoption'];
            $items['provider'] = $provider['title'];
            $items['url'] = $provider['url'];
            $items['regex_url'] = $provider['regex_url'];
            $items['regex_scrape'] = $provider['regex_scrape'];
            $items['embed'] = $provider['embed'];
            $insert[] = $items;
        }
        if (!empty($insert)) {
            vB::getDbAssertor()->assertQuery('truncateTable', array(vB_dB_Query::TYPE_KEY => vB_dB_Query::QUERY_METHOD, 'table' => 'bbcode_video'));
            vB::getDbAssertor()->assertQuery('bbcode_video', array(vB_dB_Query::TYPE_KEY => vB_dB_Query::QUERY_MULTIPLEINSERT, vB_dB_Query::FIELDS_KEY => array('tagoption', 'provider', 'url', 'regex_url', 'regex_scrape', 'embed'), vB_dB_Query::VALUES_KEY => $insert));
        }
    }
    $firsttag = '<vb:if condition="$provider == \'%1$s\'">';
    $secondtag = '<vb:elseif condition="$provider == \'%1$s\'" />';
    $template = array();
    $bbcodes = vB::getDbAssertor()->assertQuery('bbcode_video', array(vB_dB_Query::TYPE_KEY => vB_dB_Query::QUERY_SELECT), array('field' => array('priority'), 'direction' => array(vB_dB_Query::SORT_ASC)));
    foreach ($bbcodes as $bbcode) {
        if (empty($template)) {
            $template[] = sprintf($firsttag, $bbcode['tagoption']);
        } else {
            $template[] = sprintf($secondtag, $bbcode['tagoption']);
        }
        $template[] = $bbcode['embed'];
    }
    $template[] = "</vb:if>";
    $final = implode("\r\n", $template);
    $exists = vB::getDbAssertor()->getRow('template', array(vB_dB_Query::CONDITIONS_KEY => array(array('field' => 'title', 'value' => 'bbcode_video', 'operator' => vB_dB_Query::OPERATOR_EQ), array('field' => 'product', 'value' => array('', 'vbulletin'), 'operator' => vB_dB_Query::OPERATOR_EQ), array('field' => 'styleid', 'value' => -1, 'operator' => vB_dB_Query::OPERATOR_EQ))));
    if ($exists) {
        try {
            vB_Api::instanceInternal('template')->update($exists['templateid'], 'bbcode_video', $final, 'vbulletin', false, false, '');
        } catch (Exception $e) {
            return false;
        }
    } else {
        vB_Api::instanceInternal('template')->insert(-1, 'bbcode_video', $final, 'vbulletin');
    }
    return true;
}
コード例 #18
0
ファイル: 1.php プロジェクト: cedwards-reisys/nexus-web
 protected function buildOutputFromItems($items, $options)
 {
     parent::buildOutputFromItems($items, $options);
     if ($this->rssinfo['ttl'] <= 60) {
         $updateperiod = 'hourly';
         $updatefrequency = round(60 / $this->rssinfo['ttl']);
     } else {
         $updateperiod = 'daily';
         $updatefrequency = round(1440 / $this->rssinfo['ttl']);
     }
     $xml = new vB_Xml_Builder();
     $xml->add_group('rdf:RDF', array('xmlns:rdf' => 'http://www.w3.org/1999/02/22-rdf-syntax-ns#', 'xmlns:dc' => 'http://purl.org/dc/elements/1.1/', 'xmlns:syn' => 'http://purl.org/rss/1.0/modules/syndication/', 'xmlns:content' => 'http://purl.org/rss/1.0/modules/content/', 'xmlns' => 'http://purl.org/rss/1.0/'));
     $xml->add_group('channel', array('rdf:about' => $this->rssinfo['link']));
     $xml->add_tag('title', $this->rssinfo['title']);
     $xml->add_tag('link', $this->rssinfo['link'] . '/', array(), false, true);
     $xml->add_tag('description', $this->rssinfo['description']);
     $xml->add_tag('syn:updatePeriod', $updateperiod);
     $xml->add_tag('syn:updateFrequency', $updatefrequency);
     $xml->add_tag('syn:updateBase', '1970-01-01T00:00Z');
     $xml->add_tag('dc:language', $this->defaultLang['languagecode']);
     $xml->add_tag('dc:creator', 'vBulletin');
     $xml->add_tag('dc:date', gmdate('Y-m-d\\TH:i:s') . 'Z');
     $xml->add_group('items');
     $xml->add_group('rdf:Seq');
     $xml->add_tag('rdf:li', '', array('rdf:resource' => $this->rssinfo['link'] . '/'));
     $xml->close_group('rdf:Seq');
     $xml->close_group('items');
     $xml->add_group('image');
     $xml->add_tag('url', $this->rssinfo['icon']);
     $xml->add_tag('title', $this->rssinfo['title']);
     $xml->add_tag('link', $this->rssinfo['link'] . '/', array(), false, true);
     $xml->close_group('image');
     $xml->close_group('channel');
     // gather channel info
     $channelsInfo = $this->getItemsChannelInfo($items);
     $items = $this->formatItems($items, $options);
     foreach ($items as $id => $item) {
         $item = $item['content'];
         $xml->add_group('item', array('rdf:about' => vB_Api::instanceInternal('route')->getAbsoluteNodeUrl($item['external_nodeid'])));
         $xml->add_tag('title', $item['external_prefix_plain'] . vB_String::htmlSpecialCharsUni($item['external_title']));
         $xml->add_tag('link', vB_Api::instanceInternal('route')->getAbsoluteNodeUrl($item['external_nodeid']), array(), false, true);
         $xml->add_tag('description', $this->getItemDescription($item['rawtext'], $options));
         if (empty($options['nohtml'])) {
             $xml->add_tag('content:encoded', vB_Library::instance('bbcode')->doParse($item['rawtext']));
         }
         $xml->add_tag('dc:date', gmdate('Y-m-d\\TH:i:s', $item['publishdate']) . 'Z');
         $xml->add_tag('dc:creator', vB_String::unHtmlSpecialChars($item['authorname']));
         $xml->add_tag('dc:subject', $channelsInfo[$item['channelid']]['htmltitle']);
         $xml->close_group('item');
     }
     $xml->close_group('rdf:RDF');
     return $xml->fetch_xml();
 }
コード例 #19
0
 /**
  * Returns the HTML to be displayed to the user for Human Verification
  *
  * @param	string	Passed to template
  *
  * @return 	string	HTML to output
  *
  */
 function output_token($var_prefix = 'humanverify')
 {
     global $vbphrase, $show;
     $vbulletin =& $this->registry;
     $humanverify = $this->generate_token();
     $phraseAux = vB_Api::instanceInternal('phrase')->fetch(array('question' . $humanverify['answer']));
     $humanverify['question'] = $phraseAux['question' . $humanverify['answer']];
     $templater = vB_Template::create('humanverify_question');
     $templater->register('humanverify', $humanverify);
     $templater->register('var_prefix', $var_prefix);
     $output = $templater->render();
     return $output;
 }
コード例 #20
0
ファイル: faq.php プロジェクト: cedwards-reisys/nexus-web
 protected function getNewRouteInfo()
 {
     $param =& $this->queryParameters;
     if (!empty($param['faq'])) {
         try {
             $section = $param['faq'];
             $answer = vB_Api::instanceInternal('help')->getAnswer($section);
             $this->anchor = $answer['firstItem']['path'];
         } catch (Exception $e) {
         }
     }
     return 'help';
 }
コード例 #21
0
 public function message($message, $userid)
 {
     $cleaner = vB::getCleaner();
     $message = $cleaner->clean($message, vB_Cleaner::TYPE_STR);
     $userid = $cleaner->clean($userid, vB_Cleaner::TYPE_STR);
     $parentid = vB_Api::instanceInternal('node')->fetchVMChannel();
     $data = array('title' => '(Untitled)', 'parentid' => $parentid, 'channelid' => '', 'nodeid' => '', 'setfor' => $userid, 'rawtext' => $message);
     $result = vB_Api::instanceInternal('content_text')->add($data, array('wysiwyg' => false));
     if (!empty($result['errors'])) {
         return array('response' => array('postpreview' => array('invalidid')));
     }
     return array('response' => array('errormessage' => array('visitormessagethanks')));
 }
コード例 #22
0
 protected function addAdditionalRecipients()
 {
     $skipUsers = array();
     /*
     			TODO: if we get ignore list caching in memory, add them to the skip list.
     */
     if (!empty($this->notificationData['sender'])) {
         $skipUsers[$this->notificationData['sender']] = (int) $this->notificationData['sender'];
     }
     $apiResult = vB_Api::instanceInternal('follow')->getSubscribersForNotifications($this->notificationData['sentbynodeid'], $skipUsers);
     $subscribers = $apiResult['subscribers'];
     // Subscribers should be an array keyed by userids.
     return array_keys($subscribers);
 }
コード例 #23
0
ファイル: channel.php プロジェクト: cedwards-reisys/nexus-web
 /**
  * Moves all blog channels from the old blog channel parent to the new one.
  * @param int $oldChannelId
  * @param int $newChannelId
  */
 public static function moveBlogChannels($oldChannelId, $newChannelId)
 {
     if (empty($oldChannelId)) {
         $oldChannelId = vB::getDbAssertor()->getField('vBForum:channel', array(vB_dB_Query::TYPE_KEY => vB_dB_Query::QUERY_SELECT, 'guid' => self::DEFAULT_BLOG_PARENT));
     }
     $children = vB::getDbAssertor()->assertQuery('vBForum:closure', array(vB_dB_Query::TYPE_KEY => vB_dB_Query::QUERY_SELECT, 'parent' => $oldChannelId, 'depth' => 1));
     $childrenIds = array();
     foreach ($children as $child) {
         $childrenIds[] = $child['child'];
     }
     if (!empty($childrenIds)) {
         vB_Api::instanceInternal('node')->moveNodes($childrenIds, $newChannelId);
     }
 }
コード例 #24
0
ファイル: page.php プロジェクト: cedwards-reisys/nexus-web
 protected function checkStyle($channelguid)
 {
     $channel = vB_Api::instanceInternal('content_channel')->fetchChannelByGUID($channelguid);
     if (!empty($channel['styleid'])) {
         $forumOptions = vB::getDatastore()->getValue('bf_misc_forumoptions');
         if ($forumOptions['styleoverride'] & $channel['options']) {
             // the channel must force the style
             $this->arguments['forceStyleId'] = $channel['styleid'];
         } else {
             // the channel suggests to use this style
             $this->arguments['routeStyleId'] = $channel['styleid'];
         }
     }
 }
コード例 #25
0
ファイル: cms.php プロジェクト: cedwards-reisys/nexus-web
function getFullCategoryList(&$channelInfoArray = array(), $tabsize = 1, $tabchar = "--", $tabspace = " ")
{
    $cache = vB_Cache::instance(vB_Cache::CACHE_STD);
    $cacheKey = "vBAdminCP_CMS_Categories";
    $categories = $cache->read($cacheKey);
    $writeCache = false;
    $cacheEvents = array();
    if (empty($categories)) {
        $categories = vB::getDbAssertor()->getRows('vBAdminCP:getCMSChannels', array('articleChannelId' => vB_Api::instanceInternal('node')->fetchArticleChannel(), 'channelcontenttype' => vB_Api::instanceInternal('ContentType')->fetchContentTypeIdFromClass('Channel')));
        $writeCache = true;
    }
    $categoriesList = array();
    // The query result is sorted by depth first. We have to group/sort into a hierarchical order, such that
    // children come immediately after a parent.
    $parent_position = array();
    // parentid => position
    $nodeid_index = array();
    // nodeid => search result index
    foreach ($categories as $index => $category) {
        $cacheEvents[] = 'nodeChg_' . $category['nodeid'];
        $parentid = $category['parentid'];
        $nodeid_index[$category['nodeid']] = $index;
        if (empty($parent_position)) {
            $parent_position[$category['nodeid']] = 0;
        } else {
            $position = $parent_position[$parentid] + 1;
            // increment positions of parents whose positions are after $position
            foreach ($parent_position as $pid => $pos) {
                if ($pos >= $position) {
                    $parent_position[$pid]++;
                }
            }
            // node will be positioned after its parent, but above any siblings. This is why all but the depth is sort order DESC in the query.
            $parent_position[$category['nodeid']] = $position;
        }
    }
    // sort parent_position by position
    asort($parent_position);
    foreach ($parent_position as $nodeid => $position) {
        $category = $categories[$nodeid_index[$nodeid]];
        $channelInfoArray[$category['nodeid']] = array("title" => $category['htmltitle'], "parentid" => $category['parentid'], "showpublished" => $category['showpublished'], "textcount" => $category['textcount'], "displayorder" => $category['displayorder'], "description" => $category['description']);
        $tab = str_repeat($tabchar, $category['depth'] * $tabsize) . $tabspace;
        $categoriesList[$category['nodeid']] = $tab . $category['htmltitle'];
    }
    if ($writeCache) {
        $cache->write($cacheKey, $categories, 1440, $cacheEvents);
    }
    return $categoriesList;
}
コード例 #26
0
ファイル: hook.php プロジェクト: cedwards-reisys/nexus-web
 public function getXmlHooks()
 {
     if (!$this->hasPermission()) {
         return false;
     }
     $typelist = array();
     $hooklocations = array();
     require_once DIR . '/includes/class_xml.php';
     $types = $this->assertor->getRows('getHooktypePhrases');
     $hookfiles = vB_Api_Product::loadProductXmlList('hooks');
     foreach ($types as $type) {
         $typelist[] = $type['varname'];
     }
     $vbphrase = vB_Api::instanceInternal('phrase')->fetch($typelist);
     foreach ($hookfiles as $file) {
         if (!preg_match('#hooks_(.*).xml$#i', $file, $matches)) {
             continue;
         }
         $product = $matches[1];
         $phrased_product = $products[$product ? $product : 'vbulletin'];
         if (!$phrased_product) {
             $phrased_product = $product;
         }
         $xmlobj = new vB_XML_Parser(false, $location . $file);
         $xml = $xmlobj->parse();
         if (!is_array($xml['hooktype'][0])) {
             $xml['hooktype'] = array($xml['hooktype']);
         }
         foreach ($xml['hooktype'] as $key => $hooks) {
             if (!is_numeric($key)) {
                 continue;
             }
             $phrased_type = isset($vbphrase["hooktype_{$hooks['type']}"]) ? $vbphrase["hooktype_{$hooks['type']}"] : $hooks['type'];
             $hooktype = $phrased_type;
             $hooklocations["#{$hooktype}#"] = $hooktype;
             if (!is_array($hooks['hook'])) {
                 $hooks['hook'] = array($hooks['hook']);
             }
             foreach ($hooks['hook'] as $hook) {
                 $hookid = trim(is_string($hook) ? $hook : $hook['value']);
                 if ($hookid !== '') {
                     $hooklocations[$hookid] = '--- ' . $hookid . ($product != 'vbulletin' ? " ({$phrased_product})" : '');
                 }
             }
         }
     }
     return $hooklocations;
 }
コード例 #27
0
 public function getUrl()
 {
     if (empty($this->arguments['username'])) {
         $userInfo = vB_Api::instanceInternal('user')->fetchProfileInfo($this->arguments['userid']);
         $this->arguments['username'] = $userInfo['username'];
     }
     // the regex contains the url
     $url = '/' . $this->prefix . '/' . $this->arguments['userid'] . '-' . vB_String::getUrlIdent($this->arguments['username']) . '/' . $this->arguments['tab'];
     if (isset($this->arguments['pagenum']) and is_numeric($this->arguments['pagenum']) and $this->arguments['pagenum'] > 1) {
         $url .= '/page' . intval($this->arguments['pagenum']);
     }
     if (strtolower(vB_String::getCharset()) != 'utf-8') {
         $url = vB_String::encodeUtf8Url($url);
     }
     return $url;
 }
コード例 #28
0
ファイル: list.php プロジェクト: cedwards-reisys/nexus-web
 public function getBreadcrumbs()
 {
     $breadcrumbs = array(array('phrase' => 'inbox', 'url' => vB5_Route::buildUrl('privatemessage')));
     try {
         $folder = vB_Api::instanceInternal('content_privatemessage')->getFolderInfoFromId($this->folderid);
         if (isset($folder[$this->folderid]) and $folder[$this->folderid]['iscustom']) {
             $breadcrumbs[] = array('title' => $folder[$this->folderid]['title'], 'url' => '');
         } else {
             if (isset($folder[$this->folderid]) and !$folder[$this->folderid]['iscustom']) {
                 $breadcrumbs[] = array('phrase' => $folder[$this->folderid]['title'], 'url' => '');
             }
         }
     } catch (vB_Exception_Api $e) {
         // something went wrong... don't display that crumb
     }
     return $breadcrumbs;
 }
コード例 #29
0
ファイル: pms.php プロジェクト: cedwards-reisys/nexus-web
function do_get_pms()
{
    $userinfo = vB_Api::instance('user')->fetchUserInfo();
    $cleaned = vB::getCleaner()->cleanArray($_REQUEST, array('folderid' => vB_Cleaner::TYPE_INT, 'page' => vB_Cleaner::TYPE_UINT, 'perpage' => vB_Cleaner::TYPE_UINT));
    if (!$userinfo['userid']) {
        return json_error(ERR_INVALID_LOGGEDIN, RV_NOT_LOGGED_IN);
    }
    $pm_out = array();
    $totalmessages = 0;
    $folderid = $cleaned['folderid'] ? $cleaned['folderid'] : 0;
    $page = $cleaned['page'] ? $cleaned['page'] : 1;
    $perpage = $cleaned['perpage'] ? $cleaned['perpage'] : 10;
    //
    //  vB4 folders are:
    //      0   = Inbox
    //      -1  = Sent
    //      N   = Custom
    //
    $folders = vB_Api::instanceInternal('content_privatemessage')->listFolders();
    if ($folderid == -1) {
        $folderid = array_search("Sent Items", $folders);
    } else {
        if ($folderid == 0) {
            $folderid = array_search("Inbox", $folders);
        } else {
            if (!array_key_exists($folderid, $folders)) {
                return json_error("Invalid PM Folder");
            }
            if ($folders[$folderid] == "Trash" || $folders[$folderid] == "Requests" || $folders[$folderid] == "Pending Posts" || $folders[$folderid] == "Notifications") {
                return json_error("Invalid PM Folder");
            }
        }
    }
    $order = "desc";
    $messages = vB_Api::instanceInternal('content_privatemessage')->listMessages(array("folderid" => $folderid, "page" => $page, "perpage" => $perpage, "sortDir" => $order));
    if ($messages == false) {
        json_error("Invalid PM Folder");
    }
    $totalmessages = vB_Api::instance('content_privatemessage')->getFolderMsgCount($folderid);
    $totalmessages = $totalmessages['count'];
    foreach ($messages as $message) {
        $pm_out[] = fr_parse_pm($message);
    }
    return array('pms' => $pm_out, 'total_pms' => $totalmessages);
}
コード例 #30
0
ファイル: rssfeed.php プロジェクト: cedwards-reisys/nexus-web
 /**
  * Verifies that the specified forumid is valid
  *
  * @param	integer	Forum ID (allow -1 = all forums)
  *
  * @return	boolean
  */
 function verify_nodeid(&$forumid)
 {
     try {
         $node = vB_Api::instanceInternal('node')->getNodeContent($forumid);
         $node = $node[$forumid];
     } catch (vB_Exception_Api $ex) {
         return false;
     }
     if ($forumid != -1 and empty($node)) {
         $this->error('invalid_forum_specified');
         return false;
     }
     if ($node['category']) {
         $this->error('forum_is_a_category_allow_posting');
         return false;
     }
     return true;
 }