<?php
 class vB_Channel { use vB_Trait_NoSerialize; const MAIN_CHANNEL = 'vbulletin-4ecbdf567f2773.55528984'; const DEFAULT_CHANNEL_PARENT = 'vbulletin-4ecbdf567f3341.44451100'; const DEFAULT_FORUM_PARENT = 'vbulletin-4ecbdf567f2c35.70389590'; const MAIN_FORUM = 'vbulletin-4ecbdf567f3341.44450667'; const MAIN_FORUM_CATEGORY = 'vbulletin-4ecbdf567f3341.44450666'; const DEFAULT_BLOG_PARENT = 'vbulletin-4ecbdf567f3a38.99555305'; const DEFAULT_ARTICLE_PARENT = 'vbulletin-c-cmshome5229fa38b251e2.92227401'; const DEFAULT_GALLERY_PARENT = 'vbulletin-0bde8aba17fd48.73444372'; const DEFAULT_SOCIALGROUP_PARENT = 'vbulletin-4ecbdf567f3a38.99555306'; const DEFAULT_UNCATEGORIZEDGROUPS_PARENT = 'vbulletin-4ecbdf567f3a38.99555307'; const PRIVATEMESSAGE_CHANNEL = 'vbulletin-4ecbdf567f3da8.31769341'; const VISITORMESSAGE_CHANNEL = 'vbulletin-4ecbdf567f36c3.90966558'; const ALBUM_CHANNEL = 'vbulletin-4ecbdf567f3a38.99555303'; const REPORT_CHANNEL = 'vbulletin-4ecbdf567f3a38.99555304'; const INFRACTION_CHANNEL = 'vbulletin-4ecbdf567f3a38.99555308'; protected static $channelTypes = [ self::DEFAULT_FORUM_PARENT => 'forum', self::DEFAULT_BLOG_PARENT => 'blog', self::DEFAULT_ARTICLE_PARENT => 'article', self::DEFAULT_SOCIALGROUP_PARENT => 'group', self::VISITORMESSAGE_CHANNEL => 'vm', self::PRIVATEMESSAGE_CHANNEL => 'pm', self::ALBUM_CHANNEL => 'album', self::REPORT_CHANNEL => 'report', self::INFRACTION_CHANNEL => 'infraction', self::DEFAULT_GALLERY_PARENT => 'gallery', ]; protected static $channelLabels = [ 'forum' => 'forum', 'blog' => 'posttype_blog', 'group' => 'group', 'vm' => 'posttype_visitorMessage', 'pm' => 'private_message', 'album' => 'album', 'report' => 'report', 'infraction' => 'infraction', 'article' => 'articles', 'gallery' => 'channeltype_gallery', ]; public static function getDefaultGUIDs() { return [ 'MAIN_CHANNEL' => self::MAIN_CHANNEL, 'MAIN_FORUM' => self::MAIN_FORUM, 'DEFAULT_CHANNEL_PARENT' => self::DEFAULT_CHANNEL_PARENT, 'DEFAULT_FORUM_PARENT' => self::DEFAULT_FORUM_PARENT, 'DEFAULT_BLOG_PARENT' => self::DEFAULT_BLOG_PARENT, 'DEFAULT_SOCIALGROUP_PARENT' => self::DEFAULT_SOCIALGROUP_PARENT, 'DEFAULT_UNCATEGORIZEDGROUPS_PARENT' => self::DEFAULT_UNCATEGORIZEDGROUPS_PARENT, 'DEFAULT_ARTICLE_PARENT' => self::DEFAULT_ARTICLE_PARENT, 'DEFAULT_GALLERY_PARENT' => self::DEFAULT_GALLERY_PARENT, 'PRIVATEMESSAGE_CHANNEL' => self::PRIVATEMESSAGE_CHANNEL, 'VISITORMESSAGE_CHANNEL' => self::VISITORMESSAGE_CHANNEL, 'ALBUM_CHANNEL' => self::ALBUM_CHANNEL, 'REPORT_CHANNEL' => self::REPORT_CHANNEL, 'INFRACTION_CHANNEL' => self::INFRACTION_CHANNEL, ]; } public static function rebuildChannelTypes() { $channelQry = vB::getDbAssertor()->assertQuery('vBAdmincp:getChannelTypes', ['guids' => array_keys(self::$channelTypes)]); $channelTypes = []; foreach ($channelQry AS $channelType) { $channelTypes[$channelType['nodeid']] = self::$channelTypes[$channelType['guid']]; } vB::getDatastore()->build('vBChannelTypes', serialize($channelTypes), 1); } public static function getChannelTypes() { $types = []; $vBChannelTypes = vB::getDbAssertor()->assertQuery('vBForum:channel', ['guid' => array_keys(self::$channelTypes)]); foreach ($vBChannelTypes AS $channel) { $types[$channel['nodeid']] = [ 'type' => self::$channelTypes[$channel['guid']], 'GUID' => $channel['guid'], 'label' => self::$channelLabels[self::$channelTypes[$channel['guid']]] ]; } return $types; } public static function getProtectedChannelGuids() { return [ 'MAIN_CHANNEL' => self::MAIN_CHANNEL, 'DEFAULT_CHANNEL_PARENT' => self::DEFAULT_CHANNEL_PARENT, 'DEFAULT_FORUM_PARENT' => self::DEFAULT_FORUM_PARENT, 'DEFAULT_BLOG_PARENT' => self::DEFAULT_BLOG_PARENT, 'DEFAULT_SOCIALGROUP_PARENT' => self::DEFAULT_SOCIALGROUP_PARENT, 'DEFAULT_ARTICLE_PARENT' => self::DEFAULT_ARTICLE_PARENT, 'DEFAULT_GALLERY_PARENT' => self::DEFAULT_GALLERY_PARENT, 'PRIVATEMESSAGE_CHANNEL' => self::PRIVATEMESSAGE_CHANNEL, 'VISITORMESSAGE_CHANNEL' => self::VISITORMESSAGE_CHANNEL, 'ALBUM_CHANNEL' => self::ALBUM_CHANNEL, 'REPORT_CHANNEL' => self::REPORT_CHANNEL, 'INFRACTION_CHANNEL' => self::INFRACTION_CHANNEL, ]; } public static function getSpecialChannelGuids() { return [ 'DEFAULT_CHANNEL_PARENT' => self::DEFAULT_CHANNEL_PARENT, 'PRIVATEMESSAGE_CHANNEL' => self::PRIVATEMESSAGE_CHANNEL, 'VISITORMESSAGE_CHANNEL' => self::VISITORMESSAGE_CHANNEL, 'ALBUM_CHANNEL' => self::ALBUM_CHANNEL, 'REPORT_CHANNEL' => self::REPORT_CHANNEL, 'INFRACTION_CHANNEL' => self::INFRACTION_CHANNEL, ]; } } 