當前位置: 首頁>>代碼示例>>PHP>>正文


PHP UserList::set_order方法代碼示例

本文整理匯總了PHP中UserList::set_order方法的典型用法代碼示例。如果您正苦於以下問題:PHP UserList::set_order方法的具體用法?PHP UserList::set_order怎麽用?PHP UserList::set_order使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在UserList的用法示例。


在下文中一共展示了UserList::set_order方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: array

if (!$current_User->check_perm('users', 'edit', false)) {
    if ($filter_reported) {
        $UserList->cols[] = $userlist_col_reputaion;
    }
    $UserList->cols[] = array('th' => T_('Level'), 'th_class' => 'shrinkwrap small', 'td_class' => 'shrinkwrap small', 'order' => 'user_level', 'default_dir' => 'D', 'td' => '$user_level$');
} else {
    $UserList->cols[] = array('th' => T_('Status'), 'th_class' => 'shrinkwrap small', 'td_class' => 'shrinkwrap small', 'order' => 'user_status', 'default_dir' => 'D', 'td' => '%user_status( #user_status#, #user_ID# )%');
    if ($filter_reported) {
        $UserList->cols[] = $userlist_col_reputaion;
    }
    $UserList->cols[] = array('th' => T_('Level'), 'th_class' => 'shrinkwrap small', 'td_class' => 'shrinkwrap user_level_edit small', 'order' => 'user_level', 'default_dir' => 'D', 'td' => '<a href="#" rel="$user_level$">$user_level$</a>');
    $UserList->cols[] = array('th' => T_('Actions'), 'th_class' => 'small', 'td_class' => 'shrinkwrap small', 'td' => action_icon(T_('Edit this user...'), 'edit', '%regenerate_url( \'ctrl,action\', \'ctrl=user&amp;user_ID=$user_ID$&amp;user_tab=profile\' )%') . action_icon(T_('Duplicate this user...'), 'copy', '%regenerate_url( \'ctrl,action\', \'ctrl=user&amp;action=new&amp;user_ID=$user_ID$&amp;user_tab=profile\' )%') . '~conditional( (#user_ID# != 1) && (#user_ID# != ' . $current_User->ID . '), \'' . action_icon(T_('Delete this user!'), 'delete', '%regenerate_url( \'action\', \'action=delete&amp;user_ID=$user_ID$&amp;' . url_crumb('user') . '\' )%') . '\', \'' . get_icon('delete', 'noimg') . '\' )~');
}
if ($action == 'show_recent') {
    // Sort an users list by "Registered" field
    $UserList->set_order('user_created_datetime');
}
// Execute query
$UserList->query();
$filter_presets = array('all' => array(T_('All users'), get_dispctrl_url('users&amp;filter=new')), 'men' => array(T_('Men'), get_dispctrl_url('users', 'gender_men=1&amp;filter=new')), 'women' => array(T_('Women'), get_dispctrl_url('users', 'gender_women=1&amp;filter=new')));
if (is_admin_page()) {
    // Add show only activated users filter only on admin interface
    $filter_presets['activated'] = array(T_('Activated users'), get_dispctrl_url('users', 'status_activated=1&amp;filter=new'));
    if ($current_User->check_perm('users', 'edit')) {
        // Show "Reported Users" filter only for users with edit user permission
        $filter_presets['reported'] = array(T_('Reported users'), get_dispctrl_url('users', 'reported=1&amp;filter=new'));
    }
}
if ($UserList->is_filtered()) {
    // Display link to reset filters only if some filter is applied
    $filter_presets['reset'] = array(T_('Reset Filters'), get_dispctrl_url('users&amp;filter=reset'), 'class="floatright"');
開發者ID:ldanielz,項目名稱:uesp.blog,代碼行數:31,代碼來源:_user_list.view.php


注:本文中的UserList::set_order方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。