本文整理汇总了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'));
}
示例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);
示例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;
}