本文整理汇总了PHP中Globals::user_info方法的典型用法代码示例。如果您正苦于以下问题:PHP Globals::user_info方法的具体用法?PHP Globals::user_info怎么用?PHP Globals::user_info使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Globals
的用法示例。
在下文中一共展示了Globals::user_info方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: pixlr
public function pixlr ($query) {
$info = Globals::user_info();
if (empty($info['username'])) {
$info = Database::get_full_row('user', 0);
}
$this->user_id = $info['id'];
$alias = Meta_Author::get_alias_by_name($info['username']);
$image_data = file_get_contents($query['image']);
$this->save($image_data, $alias);
$this->redirect_address = '/gallery/author/'.$alias.'/';
}
示例2: test_rights
protected function test_rights ($query) {
if ($query['type'] == 'art') {
$params = array(
$query['id'],
Globals::user_info('id')
);
return Database::get_field('art', 'id', 'id = ? and user_id = ?', $params);
}
if ($query['type'] == 'author') {
$user = Meta_Author::get_data_by_alias((array) $query['id']);
if (empty($user)) {
return false;
}
$user = current($user);
return (Globals::user_info('username') == $user['name']);
}
}
示例3: main
public function main ($query) {
$this->items = Globals::user_info();
}
示例4: description
public function description ($query) {
$params = array();
if (isset($query['meta']) && $query['meta'] == 'author' && isset($query['alias'])) {
$params['type'] = 'author';
$params['id'] = $query['alias'];
} elseif (isset($query['id'])) {
$params['type'] = 'art';
$params['id'] = $query['id'];
} else {
return;
}
$text = Database::get_row(
'description',
array('text', 'pretty_text'),
'type = ? and description_id = ?',
$params
);
if (!empty($text)) {
$params = array_merge($params, $text);
}
if ($params['type'] == 'author') {
$user = Meta_Author::get_data_by_alias((array) $params['id']);
$user = current($user);
$params['username'] = $user['name'];
} else {
$params['data'] = Database::get_full_row('art', $query['id']);
$params['username'] = Database::get_field('user', 'username', $params['data']['user_id']);
$params['alias'] = Meta_Author::get_alias_by_name($params['username']);
$params['data']['weight'] = Transform_File::weight($params['data']['weight']);
$params['data']['date'] = Transform_String::rudate(Database::date_to_unix($params['data']['date']));
}
$params['can_edit'] = ($params['username'] == Globals::user_info('username'));
return $params;
}