/** * Returns array, which determinate what post types are defaults of the blogs * * @return array ( key => Blog ID, value => ItemType ID ) */ static function get_default_ids() { global $DB; // Get default value of blog setting "default_post_type" load_class('collections/model/_collsettings.class.php', 'CollectionSettings'); $CollectionSettings = new CollectionSettings(); $item_types['default'] = $CollectionSettings->get_default('default_post_type'); // Get default post type of each blog $SQL = new SQL(); $SQL->SELECT('cset_coll_ID, cset_value'); $SQL->FROM('T_coll_settings'); $SQL->WHERE('cset_name = "default_post_type"'); $item_types += $DB->get_assoc($SQL->get()); return $item_types; }
$subs_blog_IDs[] = $blog_sub->blog_ID; $subscriptions = array(array('sub_items_' . $blog_sub->blog_ID, '1', T_('All posts'), $blog_sub->sub_items), array('sub_comments_' . $blog_sub->blog_ID, '1', T_('All comments'), $blog_sub->sub_comments)); $Form->checklist($subscriptions, 'subscriptions', format_to_output($blog_sub->blog_shortname, 'htmlbody')); } $Form->hidden('subs_blog_IDs', implode(',', $subs_blog_IDs)); if ($is_admin_page && $Settings->get('subscribe_new_blogs') == 'page') { // To subscribe from blog page only $Form->info_field('', T_('In order to subscribe to a new blog, go to the relevant blog and subscribe from there.'), array('class' => 'info_full')); } else { // To subscribe from current list of blogs // Init $BlogCache object to display a select list to subscribe $BlogCache = new BlogCache(); $BlogCache_SQL = $BlogCache->get_SQL_object(); load_class('collections/model/_collsettings.class.php', 'CollectionSettings'); $CollectionSettings = new CollectionSettings(); if ($CollectionSettings->get_default('allow_subscriptions') == 0) { // If default setting disables to subscribe on blogs, we should get only the blogs which allow the subsriptions $BlogCache_SQL->FROM_add('LEFT JOIN T_coll_settings ON cset_coll_ID = blog_ID'); $BlogCache_SQL->WHERE_and('cset_name = \'allow_subscriptions\''); $BlogCache_SQL->WHERE_and('cset_value = 1'); } else { // If default setting enables to subscribe on blogs, we should exclude the blogs which don't allow the subsriptions $blogs_settings_SQL = new SQL('Get blogs which don\'t allow the subscriptions'); $blogs_settings_SQL->SELECT('cset_coll_ID'); $blogs_settings_SQL->FROM('T_coll_settings'); $blogs_settings_SQL->WHERE('cset_name = \'allow_subscriptions\''); $blogs_settings_SQL->WHERE_and('cset_value = 0'); $blogs_disabled_subscriptions_IDs = $DB->get_col($blogs_settings_SQL->get()); if (count($blogs_disabled_subscriptions_IDs)) { // Exclude the blogs which don't allow the subscriptions $BlogCache_SQL->WHERE_and('blog_ID NOT IN (' . $DB->quote($blogs_disabled_subscriptions_IDs) . ')');