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


PHP UserList::query方法代码示例

本文整理汇总了PHP中UserList::query方法的典型用法代码示例。如果您正苦于以下问题:PHP UserList::query方法的具体用法?PHP UserList::query怎么用?PHP UserList::query使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在UserList的用法示例。


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

示例1: wp_getauthors

/**
 * wp.getAuthors
 *
 * @see http://codex.wordpress.org/XML-RPC_wp#wp.getAuthors
 *
 * @param xmlrpcmsg XML-RPC Message
 *					0 blogid (int): Unique identifier of the blog.
 *					1 username (string): User login.
 *					2 password (string): Password for said username.
 */
function wp_getauthors($m)
{
    // CHECK LOGIN:
    /**
     * @var User
     */
    if (!($current_User =& xmlrpcs_login($m, 1, 2))) {
        // Login failed, return (last) error:
        return xmlrpcs_resperror();
    }
    // GET BLOG:
    /**
     * @var Blog
     */
    if (!($Blog =& xmlrpcs_get_Blog($m, 0))) {
        // Login failed, return (last) error:
        return xmlrpcs_resperror();
    }
    if (!$current_User->check_perm('users', 'view')) {
        return xmlrpcs_resperror(5, T_('You have no permission to view other users!'));
    }
    load_class('users/model/_userlist.class.php', 'UserList');
    $UserList = new UserList('', NULL, 'u_', array('join_group' => false, 'join_session' => false, 'join_country' => false, 'join_city' => false));
    // Run the query:
    $UserList->query();
    logIO('Found users: ' . $UserList->result_num_rows);
    $data = array();
    while ($User =& $UserList->get_next()) {
        $data[] = new xmlrpcval(array('user_id' => new xmlrpcval($User->ID, 'int'), 'user_login' => new xmlrpcval($User->login), 'display_name' => new xmlrpcval($User->get_preferred_name())), 'struct');
    }
    logIO('OK.');
    return new xmlrpcresp(new xmlrpcval($data, 'array'));
}
开发者ID:ldanielz,项目名称:uesp.blog,代码行数:43,代码来源:_wordpress.api.php

示例2: array

     _set_setting_by_path($edit_Plugin, 'UserSettings', $set_path, array());
     $edit_Plugin->Settings->dbupdate();
     $action = 'edit';
     break;
 case 'search':
     // Quick search
     // Check that this action request is not a CSRF hacked request:
     $Session->assert_received_crumb('user');
     param('user_search', 'string', '');
     set_param('keywords', $user_search);
     set_param('filter', 'new');
     load_class('users/model/_userlist.class.php', 'UserList');
     $UserList = new UserList('admin', $UserSettings->get('results_per_page'), 'users_', array('join_city' => false));
     $UserList->load_from_Request();
     // Make query to get a count of users
     $UserList->query();
     if ($UserList->get_total_rows() == 1) {
         // If we find only one user by quick search we do a redirect to user's edit page
         $User = $UserList->rows[0];
         if (!empty($User)) {
             header_redirect('?ctrl=user&user_tab=profile&user_ID=' . $User->user_ID);
         }
     }
     // Unset the filter to avoid the step 1 in the function $UserList->query() on the users list
     set_param('filter', '');
     break;
 case 'remove_sender_customization':
     // Check that this action request is not a CSRF hacked request:
     $Session->assert_received_crumb('users');
     // Check required permission
     $current_User->check_perm('users', 'edit', true);
开发者ID:Ariflaw,项目名称:b2evolution,代码行数:31,代码来源:users.ctrl.php

示例3: getLists

 function getLists()
 {
     require_once ROOT_DIR . '/sys/LocalEnrichment/UserList.php';
     $lists = array();
     $sql = "SELECT user_list.* FROM user_list " . "WHERE user_list.user_id = '{$this->id}' " . "ORDER BY user_list.title";
     $list = new UserList();
     $list->query($sql);
     if ($list->N) {
         while ($list->fetch()) {
             $lists[] = clone $list;
         }
     }
     return $lists;
 }
开发者ID:victorfcm,项目名称:VuFind-Plus,代码行数:14,代码来源:User.php


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