当前位置: 首页>>代码示例>>PHP>>正文


PHP get_visibility_statuses函数代码示例

本文整理汇总了PHP中get_visibility_statuses函数的典型用法代码示例。如果您正苦于以下问题:PHP get_visibility_statuses函数的具体用法?PHP get_visibility_statuses怎么用?PHP get_visibility_statuses使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了get_visibility_statuses函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: get_manual_link

$Form->hidden_ctrl();
$Form->hidden('action', 'update');
$Form->hidden('tab', 'features');
$Form->hidden('blog', $edited_Blog->ID);
$Form->begin_fieldset(T_('Post list') . get_manual_link('item-list-features'));
$Form->select_input_array('orderby', $edited_Blog->get_setting('orderby'), get_available_sort_options(), T_('Order by'), T_('Default ordering of posts.'));
$Form->select_input_array('orderdir', $edited_Blog->get_setting('orderdir'), array('ASC' => T_('Ascending'), 'DESC' => T_('Descending')), T_('Direction'));
$Form->radio('what_to_show', $edited_Blog->get_setting('what_to_show'), array(array('days', T_('days')), array('posts', T_('posts'))), T_('Display unit'), false, T_('Do you want to restrict on the number of days or the number of posts?'));
$Form->text('posts_per_page', $edited_Blog->get_setting('posts_per_page'), 4, T_('Posts/Days per page'), T_('How many days or posts do you want to display on the home page?'), 4);
$Form->radio('timestamp_min', $edited_Blog->get_setting('timestamp_min'), array(array('yes', T_('yes')), array('no', T_('no')), array('duration', T_('only the last'))), T_('Show past posts'), true);
$Form->duration_input('timestamp_min_duration', $edited_Blog->get_setting('timestamp_min_duration'), '');
$Form->radio('timestamp_max', $edited_Blog->get_setting('timestamp_max'), array(array('yes', T_('yes')), array('no', T_('no')), array('duration', T_('only the next'))), T_('Show future posts'), true);
$Form->duration_input('timestamp_max_duration', $edited_Blog->get_setting('timestamp_max_duration'), '');
$Form->end_fieldset();
$Form->begin_fieldset(T_('Post options') . get_manual_link('blog_features_settings'));
$Form->select_input_array('default_post_status', $edited_Blog->get_setting('default_post_status'), get_visibility_statuses('notes-string'), T_('Default status'), T_('Default status for new posts'));
$Form->radio('require_title', $edited_Blog->get_setting('require_title'), array(array('required', T_('Always'), T_('The blogger must provide a title')), array('optional', T_('Optional'), T_('The blogger can leave the title field empty')), array('none', T_('Never'), T_('No title field'))), T_('Post titles'), true);
$Form->checkbox('allow_html_post', $edited_Blog->get_setting('allow_html_post'), T_('Allow HTML'), T_('Check to allow HTML in posts.') . ' (' . T_('HTML code will pass several sanitization filters.') . ')');
$Form->radio('enable_goto_blog', $edited_Blog->get_setting('enable_goto_blog'), array(array('no', T_('No'), T_('Check this to view list of the posts.')), array('blog', T_('View home page'), T_('Check this to automatically view the blog after publishing a post.')), array('post', T_('View new post'), T_('Check this to automatically view the post page.'))), T_('View blog after publishing'), true);
$Form->radio('editing_goto_blog', $edited_Blog->get_setting('editing_goto_blog'), array(array('no', T_('No'), T_('Check this to view list of the posts.')), array('blog', T_('View home page'), T_('Check this to automatically view the blog after editing a post.')), array('post', T_('View edited post'), T_('Check this to automatically view the post page.'))), T_('View blog after editing'), true);
// FP> TODO:
// -post_url  always('required')|optional|never
// -multilingual:  true|false   or better yet: provide a list to narrow down the active locales
// -tags  always('required')|optional|never
$Form->radio('post_categories', $edited_Blog->get_setting('post_categories'), array(array('one_cat_post', T_('Allow only one category per post')), array('multiple_cat_post', T_('Allow multiple categories per post')), array('main_extra_cat_post', T_('Allow one main + several extra categories')), array('no_cat_post', T_('Don\'t allow category selections'), T_('(Main cat will be assigned automatically)'))), T_('Post category options'), true);
$Form->radio('post_navigation', $edited_Blog->get_setting('post_navigation'), array(array('same_blog', T_('same blog')), array('same_category', T_('same category')), array('same_author', T_('same author'))), T_('Default post by post navigation should stay in'), true, T_('Skins may override this setting!'));
$location_options = array(array('optional', T_('Optional')), array('required', T_('Required')), array('hidden', T_('Hidden')));
$Form->radio('location_country', $edited_Blog->get_setting('location_country'), $location_options, T_('Country'));
$Form->radio('location_region', $edited_Blog->get_setting('location_region'), $location_options, T_('Region'));
$Form->radio('location_subregion', $edited_Blog->get_setting('location_subregion'), $location_options, T_('Sub-region'));
$Form->radio('location_city', $edited_Blog->get_setting('location_city'), $location_options, T_('City'));
开发者ID:ldanielz,项目名称:uesp.blog,代码行数:31,代码来源:_coll_features.form.php

示例2: get_filter_titles


//.........这里部分代码省略.........
         if ($this->filters['lc'] != 'all') {
             $filter_class_i = $filter_class_i > count($filter_classes) - 1 ? 0 : $filter_class_i;
             $user_clear_icon = $clear_icon ? action_icon(T_('Remove this filter'), 'remove', regenerate_url($this->param_prefix . 'lc')) : '';
             $loc = str_replace(array('$group_title$', '$filter_name$', '$clear_icon$', '$filter_class$'), array(T_('Locale') . ': ', $this->filters['lc'], $user_clear_icon, $filter_classes[$filter_class_i]), $params['filter_mask']);
             $title_array[] = str_replace(array('$group_title$', '$filter_items$'), array(T_('Locale') . ': ', $loc), $params['group_mask']);
             $filter_class_i++;
         }
     }
     // EXTRA STATUSES:
     if ($params['display_status']) {
         if (!empty($this->filters['statuses'])) {
             $filter_class_i = $filter_class_i > count($filter_classes) - 1 ? 0 : $filter_class_i;
             if ($this->filters['statuses'] == '-') {
                 $status_clear_icon = $clear_icon ? action_icon(T_('Remove this filter'), 'remove', regenerate_url($this->param_prefix . 'status=-')) : '';
                 $title_array[] = str_replace(array('$filter_name$', '$clear_icon$', '$filter_class$'), array(T_('Without status'), $status_clear_icon, $filter_classes[$filter_class_i]), $params['filter_mask_nogroup']);
             } else {
                 $status_IDs = explode(',', $this->filters['statuses']);
                 $ItemStatusCache =& get_ItemStatusCache();
                 $statuses = array();
                 foreach ($status_IDs as $status_ID) {
                     if ($ItemStatus =& $ItemStatusCache->get_by_ID($status_ID)) {
                         $status_clear_icon = $clear_icon ? action_icon(T_('Remove this filter'), 'remove', regenerate_url($this->param_prefix . 'status=' . $status_ID)) : '';
                         $statuses[] = str_replace(array('$group_title$', '$filter_name$', '$clear_icon$', '$filter_class$'), array($params['status_text'], $ItemStatus->get_name(), $status_clear_icon, $filter_classes[$filter_class_i]), $params['filter_mask']);
                     }
                 }
                 $title_array[] = str_replace(array('$group_title$', '$filter_items$'), count($statuses) > 1 ? array($params['statuses_text'], $params['before_items'] . implode($params['separator_comma'], $statuses) . $params['after_items']) : array($params['status_text'], implode($params['separator_comma'], $statuses)), $params['group_mask']);
             }
             $filter_class_i++;
         }
     }
     // VISIBILITY (SHOW STATUSES):
     if ($params['display_visibility']) {
         if (!in_array('visibility', $ignore)) {
             $post_statuses = get_visibility_statuses();
             if (count($this->filters['visibility_array']) != count($post_statuses)) {
                 // Display it only when visibility filter is changed
                 $status_titles = array();
                 $filter_class_i = $filter_class_i > count($filter_classes) - 1 ? 0 : $filter_class_i;
                 foreach ($this->filters['visibility_array'] as $status) {
                     $vis_clear_icon = $clear_icon ? action_icon(T_('Remove this filter'), 'remove', regenerate_url($this->param_prefix . 'show_statuses=' . $status)) : '';
                     $status_titles[] = str_replace(array('$group_title$', '$filter_name$', '$clear_icon$', '$filter_class$'), array($params['visibility_text'], $post_statuses[$status], $vis_clear_icon, $filter_classes[$filter_class_i]), $params['filter_mask']);
                 }
                 $filter_class_i++;
                 $title_array[] = str_replace(array('$group_title$', '$filter_items$'), count($status_titles) > 1 ? array($params['visibility_text'], $params['before_items'] . implode($params['separator_comma'], $status_titles) . $params['after_items']) : array($params['visibility_text'], implode($params['separator_comma'], $status_titles)), $params['group_mask']);
             }
         }
     }
     if ($params['display_time']) {
         // START AT:
         if (!empty($this->filters['ymdhms_min']) || !empty($this->filters['ts_min'])) {
             $filter_class_i = $filter_class_i > count($filter_classes) - 1 ? 0 : $filter_class_i;
             if (!empty($this->filters['ymdhms_min'])) {
                 $time_clear_icon = $clear_icon ? action_icon(T_('Remove this filter'), 'remove', regenerate_url($this->param_prefix . 'dstart')) : '';
                 $title_array['ts_min'] = str_replace(array('$group_title$', '$filter_name$', '$clear_icon$', '$filter_class$'), array(T_('Start at') . ': ', date2mysql($this->filters['ymdhms_min']), $time_clear_icon, $filter_classes[$filter_class_i]), $params['filter_mask']);
             } else {
                 if ($this->filters['ts_min'] == 'now') {
                     $time_clear_icon = $clear_icon ? action_icon(T_('Remove this filter'), 'remove', regenerate_url($this->param_prefix . 'show_future')) : '';
                     $title_array['ts_min'] = str_replace(array('$filter_name$', '$clear_icon$', '$filter_class$'), array(T_('Hide past'), $time_clear_icon, $filter_classes[$filter_class_i]), $params['filter_mask_nogroup']);
                 } else {
                     $time_clear_icon = $clear_icon ? action_icon(T_('Remove this filter'), 'remove', regenerate_url($this->param_prefix . 'show_future')) : '';
                     $title_array['ts_min'] = str_replace(array('$group_title$', '$filter_name$', '$clear_icon$', '$filter_class$'), array(T_('Start at') . ': ', date2mysql($this->filters['ts_min']), $time_clear_icon, $filter_classes[$filter_class_i]), $params['filter_mask']);
                 }
             }
             $filter_class_i++;
         }
         // STOP AT:
开发者ID:Ariflaw,项目名称:b2evolution,代码行数:67,代码来源:_itemlistlight.class.php

示例3: statuses

 /**
  * Template function: display all statuses and only one is visible by css class name
  *
  * Statuses:
  * - published
  * - community
  * - protected
  * - review
  * - private
  * - draft
  */
 function statuses()
 {
     $statuses = get_visibility_statuses('', array('deprecated', 'redirected', 'trash'));
     foreach ($statuses as $status => $title) {
         echo get_styled_status($status, $title);
     }
 }
开发者ID:ldanielz,项目名称:uesp.blog,代码行数:18,代码来源:_comment.class.php

示例4: get_filter_titles


//.........这里部分代码省略.........
             foreach ($authors as $author_ID) {
                 if ($tmp_User = $UserCache->get_by_ID($author_ID, false, false)) {
                     $author_names[] = $tmp_User->get_identity_link(array('link_text' => 'login'));
                 }
             }
         }
         $title_array[] = T_('Author(s)') . ': ' . implode(', ', $author_names);
     }
     // ASSIGNEES:
     if (!empty($this->filters['assignees']) || !empty($this->filters['assignees_login'])) {
         if ($this->filters['assignees'] == '-') {
             $title_array[] = T_('Not assigned');
         } else {
             $assignees = trim($this->filters['assignees'] . ',' . get_users_IDs_by_logins($this->filters['assignees_login']), ',');
             $assignees = preg_split('~\\s*,\\s*~', $assignees, -1, PREG_SPLIT_NO_EMPTY);
             $assignees_names = array();
             if ($assignees) {
                 $UserCache =& get_UserCache();
                 foreach ($assignees as $user_ID) {
                     if ($tmp_User =& $UserCache->get_by_ID($user_ID, false, false)) {
                         $assignees_names[] = $tmp_User->get_identity_link(array('link_text' => 'login'));
                     }
                 }
             }
             $title_array[] = T_('Assigned to') . ': ' . implode(', ', $assignees_names);
         }
     }
     // LOCALE:
     if ($this->filters['lc'] != 'all') {
         $title_array[] = T_('Locale') . ': ' . $this->filters['lc'];
     }
     // EXTRA STATUSES:
     if (!empty($this->filters['statuses'])) {
         if ($this->filters['statuses'] == '-') {
             $title_array[] = T_('Without status');
         } else {
             $title_array[] = T_('Status(es)') . ': ' . $this->filters['statuses'];
         }
     }
     // SHOW STATUSES
     if (count($this->filters['visibility_array']) < 5 && !in_array('visibility', $ignore)) {
         $post_statuses = get_visibility_statuses();
         $status_titles = array();
         foreach ($this->filters['visibility_array'] as $status) {
             $status_titles[] = $post_statuses[$status];
         }
         $title_array[] = T_('Visibility') . ': ' . implode(', ', $status_titles);
     }
     // START AT
     if (!empty($this->filters['ymdhms_min'])) {
         $title_array['ymdhms_min'] = T_('Start at') . ': ' . $this->filters['ymdhms_min'];
     }
     if (!empty($this->filters['ts_min'])) {
         if ($this->filters['ts_min'] == 'now') {
             $title_array['ts_min'] = T_('Hide past');
         } else {
             $title_array['ts_min'] = T_('Start at') . ': ' . $this->filters['ts_min'];
         }
     }
     // STOP AT
     if (!empty($this->filters['ymdhms_max'])) {
         $title_array['ymdhms_max'] = T_('Stop at') . ': ' . $this->filters['ymdhms_max'];
     }
     if (!empty($this->filters['ts_max'])) {
         if ($this->filters['ts_max'] == 'now') {
             if (!in_array('hide_future', $ignore)) {
                 $title_array['ts_max'] = T_('Hide future');
             }
         } else {
             $title_array['ts_max'] = T_('Stop at') . ': ' . $this->filters['ts_max'];
         }
     }
     // LIMIT TO
     if ($this->single_post) {
         // Single post: no paging required!
     } elseif (!empty($this->filters['ymdhms'])) {
         // no restriction if we request a month... some permalinks may point to the archive!
     } elseif ($this->filters['unit'] == 'posts' || $this->filters['unit'] == 'all') {
         // We're going to page, so there's no real limit here...
     } elseif ($this->filters['unit'] == 'days') {
         // We are going to limit to x days:
         // echo 'LIMIT DAYS ';
         if (empty($this->filters['ymdhms_min'])) {
             // We have no start date, we'll display the last x days:
             if (!empty($this->filters['keywords']) || !empty($this->filters['cat_array']) || !empty($this->filters['authors'])) {
                 // We are in DAYS mode but we can't restrict on these! (TODO: ?)
             } else {
                 // We are going to limit to LAST x days:
                 // TODO: rename 'posts' to 'limit'
                 $title_array['posts'] = sprintf(T_('Limited to %d last days'), $this->limit);
             }
         } else {
             // We have a start date, we'll display x days starting from that point:
             $title_array['posts'] = sprintf(T_('Limited to %d days'), $this->limit);
         }
     } else {
         debug_die('Unhandled LIMITING mode in ItemList:' . $this->filters['unit'] . ' (paged mode is obsolete)');
     }
     return $title_array;
 }
开发者ID:ldanielz,项目名称:uesp.blog,代码行数:101,代码来源:_itemlistlight.class.php

示例5: init_list_mode

/**
 * Initialize list mode; Several actions need this.
 */
function init_list_mode()
{
    global $tab, $Blog, $UserSettings, $ItemList, $AdminUI, $posttypes_perms;
    // set default itemslist param prefix
    $items_list_param_prefix = 'items_';
    if (param('p', 'integer', NULL) || param('title', 'string', NULL)) {
        // Single post requested, do not filter any post types. If the user
        // has clicked a post link on the dashboard and previously has selected
        // a tab which would filter this post, it wouldn't be displayed now.
        $tab = 'full';
        // in case of single item view params prefix must be empty
        $items_list_param_prefix = NULL;
    } else {
        // Store/retrieve preferred tab from UserSettings:
        $UserSettings->param_Request('tab', 'pref_browse_tab', 'string', NULL, true, true);
    }
    /*
     * Init list of posts to display:
     */
    load_class('items/model/_itemlist.class.php', 'ItemList2');
    if (!empty($tab) && !empty($items_list_param_prefix)) {
        // Use different param prefix for each tab
        $items_list_param_prefix .= substr($tab, 0, 7) . '_';
    }
    // Create empty List:
    $ItemList = new ItemList2($Blog, NULL, NULL, $UserSettings->get('results_per_page'), 'ItemCache', $items_list_param_prefix, $tab);
    // COPY (func)
    $ItemList->set_default_filters(array('visibility_array' => get_visibility_statuses('keys')));
    if ($Blog->get_setting('orderby') == 'RAND') {
        // Do not display random posts in backoffice for easy management
        $ItemList->set_default_filters(array('orderby' => 'datemodified'));
    }
    switch ($tab) {
        case 'full':
            $ItemList->set_default_filters(array('types' => NULL));
            // $AdminUI->breadcrumbpath_add( T_('All items'), '?ctrl=items&amp;blog=$blog$&amp;tab='.$tab.'&amp;filter=restore' );
            // require colorbox js
            require_js_helper('colorbox');
            break;
        case 'manual':
            if ($Blog->get('type') != 'manual') {
                // Display this tab only for manual blogs
                global $admin_url;
                header_redirect($admin_url . '?ctrl=items&blog=' . $Blog->ID . '&tab=list&filter=restore');
            }
            $AdminUI->breadcrumbpath_add(T_('Manual Pages'), '?ctrl=items&amp;blog=$blog$&amp;tab=' . $tab . '&amp;filter=restore');
            break;
        case 'list':
            // Nothing special
            $AdminUI->breadcrumbpath_add(T_('Regular posts'), '?ctrl=items&amp;blog=$blog$&amp;tab=' . $tab . '&amp;filter=restore');
            break;
        case 'pages':
            $ItemList->set_default_filters(array('types' => implode(',', $posttypes_perms['page'])));
            $AdminUI->breadcrumbpath_add(T_('Pages'), '?ctrl=items&amp;blog=$blog$&amp;tab=' . $tab . '&amp;filter=restore');
            break;
        case 'intros':
            $ItemList->set_default_filters(array('types' => implode(',', $posttypes_perms['intro'])));
            $AdminUI->breadcrumbpath_add(T_('Intro posts'), '?ctrl=items&amp;blog=$blog$&amp;tab=' . $tab . '&amp;filter=restore');
            break;
        case 'podcasts':
            $ItemList->set_default_filters(array('types' => implode(',', $posttypes_perms['podcast'])));
            $AdminUI->breadcrumbpath_add(T_('Podcasts'), '?ctrl=items&amp;blog=$blog$&amp;tab=' . $tab . '&amp;filter=restore');
            break;
        case 'links':
            $ItemList->set_default_filters(array('types' => '3000'));
            $AdminUI->breadcrumbpath_add(T_('Links'), '?ctrl=items&amp;blog=$blog$&amp;tab=' . $tab . '&amp;filter=restore');
            break;
        case 'ads':
            $ItemList->set_default_filters(array('types' => '4000'));
            $AdminUI->breadcrumbpath_add(T_('Advertisements'), '?ctrl=items&amp;blog=$blog$&amp;tab=' . $tab . '&amp;filter=restore');
            break;
        case 'tracker':
            // In tracker mode, we want a different default sort:
            $ItemList->set_default_filters(array('orderby' => 'priority', 'order' => 'ASC'));
            break;
        default:
            // Delete the pref_browse_tab setting so that the default
            // (full) gets used the next time the user wants to browse
            // a blog and we don't run into the same error again.
            $UserSettings->delete('pref_browse_tab');
            $UserSettings->dbupdate();
            debug_die('Unknown filterset [' . $tab . ']');
    }
    // Init filter params:
    if (!$ItemList->load_from_Request()) {
        // If we could not init a filterset from request
        // typically happens when we could no fall back to previously saved filterset...
        // echo ' no filterset!';
    }
}
开发者ID:ldanielz,项目名称:uesp.blog,代码行数:93,代码来源:items.ctrl.php

示例6: get_filter_titles

 /**
  * Generate a title for the current list, depending on its filtering params
  *
  * @return array List of titles to display, which are escaped for HTML display
  */
 function get_filter_titles($ignore = array(), $params = array())
 {
     $title_array = array();
     if (empty($this->filters)) {
         // Filters have no been set before, we'll use the default filterset
         $this->set_filters($this->default_filters);
     }
     if (isset($this->filters['statuses'])) {
         $visibility_statuses = get_visibility_statuses('', array('redirected'));
         $visibility_array = array();
         foreach ($this->filters['statuses'] as $status) {
             $visibility_array[] = $visibility_statuses[$status];
         }
         $title_array['statuses'] = T_('Visibility') . ': ' . implode(', ', $visibility_array);
     }
     if (!empty($this->filters['keywords'])) {
         $title_array['keywords'] = T_('Keywords') . ': ' . $this->filters['keywords'];
     }
     return $title_array;
 }
开发者ID:Ariflaw,项目名称:b2evolution,代码行数:25,代码来源:_commentlist.class.php

示例7: unset

        unset($edited_IPRange);
        forget_param('iprange_ID');
        $Messages->add(sprintf(T_('Requested &laquo;%s&raquo; object does not exist any longer.'), T_('IP Range')), 'error');
    }
}
switch ($action) {
    case 'ban':
        // only an action if further "actions" given
        // Check that this action request is not a CSRF hacked request:
        $Session->assert_received_crumb('antispam');
        // Check permission:
        $current_User->check_perm('spamblacklist', 'edit', true);
        // TODO: This should become different for 'edit'/'add' perm level - check for 'add' here.
        $keyword = utf8_substr($keyword, 0, 80);
        param('delhits', 'integer', 0);
        $all_statuses = get_visibility_statuses('keys', array('trash', 'redirected'));
        $delstatuses = array();
        foreach ($all_statuses as $status) {
            // collect which comments should be delteded
            if (param('del' . $status, 'integer', 0)) {
                // matching comments with this status should be deleted
                $delstatuses[] = $status;
            }
        }
        $delcomments = count($delstatuses);
        param('blacklist_locally', 'integer', 0);
        param('report', 'integer', 0);
        // Check if the string is too short,
        // it has to be a minimum of 5 characters to avoid being too generic
        if (utf8_strlen($keyword) < 5) {
            $Messages->add(sprintf(T_('The keyword &laquo;%s&raquo; is too short, it has to be a minimum of 5 characters!'), htmlspecialchars($keyword)), 'error');
开发者ID:Edind304,项目名称:b2evolution,代码行数:31,代码来源:antispam.ctrl.php

示例8: generic_ctp_number

/**
 * Generic comments/trackbacks/pingbacks counting
 *
 * @todo check this in a multiblog page...
 * @todo This should support visibility: at least in the default front office (_feedback.php), there should only the number of visible comments/trackbacks get used ({@link Item::feedback_link()}).
 *
 * @param integer
 * @param string what to count
 * @param mixed string or array to count comments with this/these status(es)
 * @param boolean set true to count expired comments, leave on false otherwise
 */
function generic_ctp_number($post_id, $mode = 'comments', $status = 'published', $count_expired = false, $filter_by_perm = true)
{
    global $DB, $debug, $postdata, $cache_ctp_number, $preview, $servertimenow, $blog;
    if ($preview) {
        // we are in preview mode, no comments yet!
        return 0;
    }
    $show_statuses = is_admin_page() ? get_visibility_statuses('keys', array('trash', 'redirected')) : get_inskin_statuses();
    $filter_index = $filter_by_perm ? 0 : 1;
    if (!isset($cache_ctp_number) || !isset($cache_ctp_number[$filter_index][$post_id])) {
        // we need a query to count comments
        $count_SQL = new SQL();
        $count_SQL->SELECT('comment_post_ID, comment_type, comment_status, COUNT(*) AS type_count');
        $count_SQL->FROM('T_comments');
        $count_SQL->GROUP_BY('comment_post_ID, comment_type, comment_status');
        if (!empty($blog)) {
            $count_SQL->WHERE(statuses_where_clause($show_statuses, 'comment_', $blog, 'blog_comment!', $filter_by_perm));
        }
        if (!$count_expired) {
            $count_SQL->FROM_add('LEFT JOIN T_items__item_settings as expiry_setting ON comment_post_ID = iset_item_ID AND iset_name = "post_expiry_delay"');
            $count_SQL->WHERE_and('expiry_setting.iset_value IS NULL OR expiry_setting.iset_value = "" OR TIMESTAMPDIFF(SECOND, comment_date, ' . $DB->quote(date2mysql($servertimenow)) . ') < expiry_setting.iset_value');
        }
    }
    // init statuses count array
    $statuses_array = array('published' => 0, 'community' => 0, 'protected' => 0, 'private' => 0, 'review' => 0, 'draft' => 0, 'deprecated' => 0, 'trash' => 0, 'total' => 0);
    /*
     * Make sure cache is loaded for current display list:
     */
    if (!isset($cache_ctp_number) || !isset($cache_ctp_number[$filter_index])) {
        global $postIDlist, $postIDarray;
        // if( $debug ) echo "LOADING generic_ctp_number CACHE for posts: $postIDlist<br />";
        if (!empty($postIDlist)) {
            foreach ($postIDarray as $tmp_post_id) {
                // Initializes each post to nocount!
                $cache_ctp_number[$filter_index][$tmp_post_id] = array('comments' => $statuses_array, 'trackbacks' => $statuses_array, 'pingbacks' => $statuses_array, 'feedbacks' => $statuses_array);
            }
            $countall_SQL = $count_SQL;
            $countall_SQL->WHERE_and('comment_post_ID IN (' . $postIDlist . ')');
            foreach ($DB->get_results($countall_SQL->get()) as $row) {
                // detail by status, tyep and post:
                $cache_ctp_number[$filter_index][$row->comment_post_ID][$row->comment_type . 's'][$row->comment_status] = $row->type_count;
                // Total for type on post:
                $cache_ctp_number[$filter_index][$row->comment_post_ID][$row->comment_type . 's']['total'] += $row->type_count;
                // Total for status on post:
                $cache_ctp_number[$filter_index][$row->comment_post_ID]['feedbacks'][$row->comment_status] += $row->type_count;
                // Total for post:
                $cache_ctp_number[$filter_index][$row->comment_post_ID]['feedbacks']['total'] += $row->type_count;
            }
        }
    }
    /*	else
    	{
    		echo "cache set";
    	}*/
    if (!isset($cache_ctp_number[$filter_index][$post_id])) {
        // this should be extremely rare...
        // echo "CACHE not set for $post_id";
        // Initializes post to nocount!
        $cache_ctp_number[$filter_index][intval($post_id)] = array('comments' => $statuses_array, 'trackbacks' => $statuses_array, 'pingbacks' => $statuses_array, 'feedbacks' => $statuses_array);
        $count_SQL->WHERE_and('comment_post_ID = ' . intval($post_id));
        foreach ($DB->get_results($count_SQL->get()) as $row) {
            // detail by status, type and post:
            $cache_ctp_number[$filter_index][$row->comment_post_ID][$row->comment_type . 's'][$row->comment_status] = $row->type_count;
            // Total for type on post:
            $cache_ctp_number[$filter_index][$row->comment_post_ID][$row->comment_type . 's']['total'] += $row->type_count;
            // Total for status on post:
            $cache_ctp_number[$filter_index][$row->comment_post_ID]['feedbacks'][$row->comment_status] += $row->type_count;
            // Total for post:
            $cache_ctp_number[$filter_index][$row->comment_post_ID]['feedbacks']['total'] += $row->type_count;
        }
    }
    if ($mode != 'comments' && $mode != 'trackbacks' && $mode != 'pingbacks') {
        $mode = 'feedbacks';
    }
    if (is_array($status)) {
        // $status is an array and probably contains more then one visibility status
        $result = 0;
        foreach ($status as $one_status) {
            if (isset($cache_ctp_number[$filter_index][$post_id][$mode][$one_status])) {
                $result = $result + $cache_ctp_number[$filter_index][$post_id][$mode][$one_status];
            }
        }
    } elseif (isset($cache_ctp_number[$filter_index][$post_id][$mode][$status])) {
        // $status is a string with one visibility status
        $result = $cache_ctp_number[$filter_index][$post_id][$mode][$status];
    } else {
        // $status is not recognized return total feedback number
        $result = $cache_ctp_number[$filter_index][$post_id][$mode]['total'];
    }
//.........这里部分代码省略.........
开发者ID:ldanielz,项目名称:uesp.blog,代码行数:101,代码来源:_comment.funcs.php

示例9: get

 /**
  * Get a member param by its name
  *
  * @param mixed Name of parameter
  * @return mixed Value of parameter
  */
 function get($parname)
 {
     switch ($parname) {
         case 't_author':
             // Text: author
             $this->get_creator_User();
             return $this->creator_User->get('preferredname');
         case 't_assigned_to':
             // Text: assignee
             if (!$this->get_assigned_User()) {
                 return '';
             }
             return $this->assigned_User->get('preferredname');
         case 't_status':
             // Text status:
             $post_statuses = get_visibility_statuses();
             return $post_statuses[$this->status];
         case 't_extra_status':
             $ItemStatusCache =& get_ItemStatusCache();
             if (!($Element =& $ItemStatusCache->get_by_ID($this->pst_ID, true, false))) {
                 // No status:
                 return '';
             }
             return $Element->get_name();
         case 't_type':
             // Post type (name):
             if (empty($this->ityp_ID)) {
                 return '';
             }
             $ItemTypeCache =& get_ItemTypeCache();
             $type_Element =& $ItemTypeCache->get_by_ID($this->ityp_ID);
             return $type_Element->get_name();
         case 't_priority':
             return $this->priorities[$this->priority];
         case 'pingsdone':
             // Deprecated by fp 2006-08-21
             return $this->post_notifications_status == 'finished';
         case 'excerpt':
             return $this->get_excerpt2();
     }
     return parent::get($parname);
 }
开发者ID:Ariflaw,项目名称:b2evolution,代码行数:48,代码来源:_item.class.php

示例10: compare_visibility_status

/**
 * Compare two visibility status in the point of public level
 *
 * @param string first_status
 * @param string second_status
 * @return integer
 *   0 if the two statuses have the same public level
 *   1 if the first status has higher public level
 *   -1 if it first status has lower public level
 */
function compare_visibility_status($first_status, $second_status)
{
    $status_index = get_visibility_statuses('ordered-index', array());
    if (!isset($status_index[$first_status]) || !isset($status_index[$second_status])) {
        // At least one of the given statuses doesn't exist
        debug_die('Invalid status given to compare!');
    }
    $first_status_index = $status_index[$first_status];
    $second_status_index = $status_index[$second_status];
    if ($first_status_index == $second_status_index) {
        // The two status public level is equal, but note this doesn't mean that the two status must be same!
        return 0;
    }
    return $first_status_index > $second_status_index ? 1 : -1;
}
开发者ID:ldanielz,项目名称:uesp.blog,代码行数:25,代码来源:_blog.funcs.php

示例11: T_

    if ($perm_blog_admin) {
        // Only admin can set this setting to 'Public'
        $status_options['published'] .= ' [' . T_('Admin') . ']';
    } else {
        // Remove published status for non-admin users
        unset($status_options['published']);
    }
}
// put this on feedback details container, this way it won't be displayed if comment posting is not allowed
echo '<div class="feedback_details_container">';
$Form->select_input_array('new_feedback_status', $edited_Blog->get_setting('new_feedback_status'), $status_options, T_('New feedback status'), $newstatus_warning . T_('Logged in users will get the highest possible status allowed by their permissions. Plugins may also override this default.'));
echo '</div>';
// Moderation statuses setting
$not_moderation_statuses = array_diff(get_visibility_statuses('keys', NULL), get_visibility_statuses('moderation'));
// Get moderation statuses with status text
$moderation_statuses = get_visibility_statuses('', $not_moderation_statuses);
$blog_moderation_statuses = $edited_Blog->get_setting('moderation_statuses');
$checklist_options = array();
foreach ($moderation_statuses as $status => $status_text) {
    // Add a checklist option for each possible modeartion status
    $is_checked = strpos($blog_moderation_statuses, $status) !== false;
    $checklist_options[] = array('notif_' . $status, 1, $status_text, $is_checked);
}
$Form->checklist($checklist_options, 'moderation_statuses', T_('Comment moderation reminder statuses'), false, false, array('note' => 'Comments with the selected statuses will be notified on the "Send reminders about comments awaiting moderation" scheduled job.'));
$Form->radio('comment_quick_moderation', $edited_Blog->get_setting('comment_quick_moderation'), array(array('never', T_('Never')), array('expire', T_('Links expire on first edit action')), array('always', T_('Always available'))), T_('Comment quick moderation'), true);
$Form->end_fieldset();
$Form->begin_fieldset(T_('RSS/Atom feeds'));
$Form->radio('comment_feed_content', $edited_Blog->get_setting('comment_feed_content'), array(array('none', T_('No feeds')), array('excerpt', T_('Comment excerpts')), array('normal', T_('Standard comment contents'))), T_('Comment feed contents'), true, T_('How much content do you want to make available in comment feeds?'));
$Form->text('comments_per_feed', $edited_Blog->get_setting('comments_per_feed'), 4, T_('Comments in feeds'), T_('How many of the latest comments do you want to include in RSS & Atom feeds?'), 4);
$Form->end_fieldset();
$Form->begin_fieldset(T_('Subscriptions'));
开发者ID:ldanielz,项目名称:uesp.blog,代码行数:31,代码来源:_coll_comments.form.php

示例12: CommentList2

 $AdminUI->append_path_level('comments');
 if (empty($tab3)) {
     $tab3 = 'fullview';
 }
 $AdminUI->set_path('collections', 'comments', $tab3);
 $comments_list_param_prefix = 'cmnt_';
 if (!empty($tab3)) {
     // Use different param prefix for each tab
     $comments_list_param_prefix .= $tab3 . '_';
 }
 /*
  * List of comments to display:
  */
 $CommentList = new CommentList2($Blog, NULL, 'CommentCache', $comments_list_param_prefix, $tab3);
 // Filter list:
 $CommentList->set_default_filters(array('statuses' => get_visibility_statuses('keys', array('redirected', 'trash')), 'order' => 'DESC'));
 $CommentList->load_from_Request();
 /**
  * Mass delete comments
  */
 param('mass_type', 'string', '');
 if ($action == 'mass_delete' && !empty($mass_type)) {
     // Check that this action request is not a CSRF hacked request:
     $Session->assert_received_crumb('comment');
     // Init the comment list query, but don't execute it
     $CommentList->query_init();
     // Set sql query to get deletable comment ids
     $deletable_comments_query = 'SELECT DISTINCT ' . $CommentList->Cache->dbIDname . ' ' . $CommentList->CommentQuery->get_from() . $CommentList->CommentQuery->get_where();
     // Set an action param to display a correct template
     $process_action = $action;
     unset($_POST['actionArray']);
开发者ID:Ariflaw,项目名称:b2evolution,代码行数:31,代码来源:_comments.ctrl.php

示例13: item_row_status

/**
 * Get buttons to change item type
 *
 * @param object Item
 * @param integer Index of the row on page
 * @return string
 */
function item_row_status($Item, $index)
{
    global $current_User, $AdminUI, $Blog, $admin_url;
    if (empty($Blog)) {
        // global Blog object is not set, e.g. back-office User activity tab
        $Item->load_Blog();
        $blog_ID = $Item->Blog->ID;
    } else {
        $blog_ID = $Blog->ID;
    }
    // Get those statuses which are not allowed for the current User to create posts in this blog
    $exclude_statuses = array_merge(get_restricted_statuses($blog_ID, 'blog_post!', 'create'), array('trash'));
    // Get allowed visibility statuses
    $status_options = get_visibility_statuses('', $exclude_statuses);
    if (is_logged_in() && $current_User->check_perm('item_post!CURSTATUS', 'edit', false, $Item) && isset($AdminUI, $AdminUI->skin_name) && $AdminUI->skin_name == 'bootstrap') {
        // Use dropdown for bootstrap skin and if current user can edit this post
        $status_icon_options = get_visibility_statuses('icons', $exclude_statuses);
        $r = '<div class="btn-group ' . ($index > 5 ? 'dropup' : 'dropdown') . ' post_status_dropdown">' . '<button type="button" class="btn btn-sm btn-status-' . $Item->status . ' dropdown-toggle" data-toggle="dropdown" aria-expanded="false" id="post_status_dropdown">' . '<span>' . $status_options[$Item->status] . '</span>' . ' <span class="caret"></span></button>' . '<ul class="dropdown-menu" role="menu" aria-labelledby="post_status_dropdown">';
        foreach ($status_options as $status_key => $status_title) {
            $r .= '<li rel="' . $status_key . '" role="presentation"><a href="' . $admin_url . '?ctrl=items&amp;blog=' . $blog_ID . '&amp;action=update_status&amp;post_ID=' . $Item->ID . '&amp;status=' . $status_key . '&amp;' . url_crumb('item') . '" role="menuitem" tabindex="-1">' . $status_icon_options[$status_key] . ' <span>' . $status_title . '</span></a></li>';
        }
        $r .= '</ul>' . '</div>';
    } else {
        // Display only status badge when user has no permission to edit this post and for chicago skin
        $r = $Item->get_format_status(array('template' => '<span class="note status_$status$"><span>$status_title$</span></span>'));
    }
    return $r;
}
开发者ID:Ariflaw,项目名称:b2evolution,代码行数:35,代码来源:_item.funcs.php

示例14: array

    }
    if ($user_has_cat_perms) {
        // Field to create a new category if current user has the rights
        $categories[] = array('value' => 'new', 'label' => T_('New') . ':', 'suffix' => '<input type="text" id="new_categories[' . $post_counter . ']" name="new_categories[' . $post_counter . ']" class="form_text_input" maxlength="255" size="25" />');
    }
    $Form->radio_input('category[' . $post_counter . ']', $selected_category_ID, $categories, T_('Category'), array('suffix' => '<br />'));
    // Clear last option to create a new for next item with other $post_counter
    array_pop($categories);
    $Form->info(T_('Post content'), '<img src="' . $fm_FileRoot->ads_url . urldecode($item) . '" width="200" />');
    $Form->end_fieldset();
    $post_counter++;
}
$edited_Item = NULL;
$visibility_statuses = get_visibility_statuses('notes-string', array(), true, $blog);
if (empty($visibility_statuses)) {
    $visibility_statuses = get_visibility_statuses('notes-string');
    if (isset($visibility_statuses[$Blog->get_setting('default_post_status')])) {
        // Current user can create a post only with default status
        $Form->info(T_('Status of new posts'), $visibility_statuses[$Blog->get_setting('default_post_status')]);
    }
} else {
    // Display a list with the post statuses
    $Form->select_input_array('post_status', $Blog->get_setting('default_post_status'), $visibility_statuses, T_('Status of new posts'));
}
$Form->end_form(array(array('submit', 'actionArray[make_posts_from_files]', T_('Make posts'), 'ActionButton')));
?>
<script type="text/javascript">
jQuery( 'input[id^=new_categories]' ).focus( function()
{
	var num = jQuery( this ).attr( 'id' ).replace( /new_categories\[(\d+)\]/gi, '$1' );
	jQuery( 'input[name=category\\[' + num + '\\]]' ).attr( 'checked', 'checked' );
开发者ID:Ariflaw,项目名称:b2evolution,代码行数:31,代码来源:_file_create_posts.form.php

示例15: echo_item_comments

/**
 * Display CommentList with the given filters
 *
 * @param integer Blog ID
 * @param integer Item ID
 * @param array Status filters
 * @param integer Limit
 * @param array Comments IDs string to exclude from the list
 * @param string Filterset name
 * @param string Expiry status: 'all', 'active', 'expired'
 */
function echo_item_comments($blog_ID, $item_ID, $statuses = NULL, $currentpage = 1, $limit = 20, $comment_IDs = array(), $filterset_name = '', $expiry_status = 'active')
{
    global $inc_path, $status_list, $Blog, $admin_url;
    $BlogCache =& get_BlogCache();
    $Blog =& $BlogCache->get_by_ID($blog_ID, false, false);
    global $CommentList;
    $CommentList = new CommentList2($Blog, $limit, 'CommentCache', '', $filterset_name);
    $exlude_ID_list = NULL;
    if (!empty($comment_IDs)) {
        $exlude_ID_list = '-' . implode(",", $comment_IDs);
    }
    if (empty($statuses)) {
        $statuses = get_visibility_statuses('keys', array('redirected', 'trash'));
    }
    if ($expiry_status == 'all') {
        // Display all comments
        $expiry_statuses = array('active', 'expired');
    } else {
        // Display active or expired comments
        $expiry_statuses = array($expiry_status);
    }
    // if item_ID == -1 then don't use item filter! display all comments from current blog
    if ($item_ID == -1) {
        $item_ID = NULL;
    }
    // set redirect_to
    if ($item_ID != null) {
        // redirect to the items full view
        param('redirect_to', 'url', url_add_param($admin_url, 'ctrl=items&blog=' . $blog_ID . '&p=' . $item_ID, '&'));
        param('item_id', 'integer', $item_ID);
        param('currentpage', 'integer', $currentpage);
        if (count($statuses) == 1) {
            $show_comments = $statuses[0];
        } else {
            $show_comments = 'all';
        }
        param('comments_number', 'integer', generic_ctp_number($item_ID, 'comments', $show_comments));
        // Filter list:
        $CommentList->set_filters(array('types' => array('comment', 'trackback', 'pingback'), 'statuses' => $statuses, 'expiry_statuses' => $expiry_statuses, 'comment_ID_list' => $exlude_ID_list, 'post_ID' => $item_ID, 'order' => 'ASC', 'comments' => $limit, 'page' => $currentpage));
    } else {
        // redirect to the comments full view
        param('redirect_to', 'url', url_add_param($admin_url, 'ctrl=comments&blog=' . $blog_ID . '&filter=restore', '&'));
        // this is an ajax call we always have to restore the filterst (we can set filters only without ajax call)
        $CommentList->set_filters(array('types' => array('comment', 'trackback', 'pingback')));
        $CommentList->restore_filterset();
    }
    // Get ready for display (runs the query):
    $CommentList->display_init();
    $CommentList->display_if_empty(array('before' => '<div class="bComment"><p>', 'after' => '</p></div>', 'msg_empty' => T_('No feedback for this post yet...')));
    // display comments
    require $inc_path . 'comments/views/_comment_list.inc.php';
}
开发者ID:ldanielz,项目名称:uesp.blog,代码行数:63,代码来源:_item.funcs.php


注:本文中的get_visibility_statuses函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。