本文整理汇总了PHP中user::getUserById方法的典型用法代码示例。如果您正苦于以下问题:PHP user::getUserById方法的具体用法?PHP user::getUserById怎么用?PHP user::getUserById使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类user
的用法示例。
在下文中一共展示了user::getUserById方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: show
public function show()
{
$user_id = $this->user['id'];
include_once ROOT_PATH . 'lib/user/user.class.php';
$info = new user();
$user_info = $info->getUserById($user_id, "all");
$user_info = $user_info[0];
$id = $user_info['id'];
$hot_station = $this->mVideo->get_station(0, 0, 0, 10);
if (is_array($hot_station)) {
unset($hot_station[count($hot_station) - 1]);
}
$hot_video = $this->mVideo->get_video_info(0, 0, 6, '', 2);
$stationInfo = $this->mVideo->get_user_station();
$this->page_title = $this->lang['pageTitle'];
$this->settings['nav_menu'][3] = array("name" => "频道设置", "url" => SNS_VIDEO . SCRIPTNAME, "last" => 1);
$gScriptName = SCRIPTNAME;
hg_add_head_element('js-c', "\r\n\t\t\tvar re_back = 'my_station.php';\r\n\t\t\tvar re_back_login = 'login.php';\r\n\t\t");
hg_add_head_element('js', RESOURCE_DIR . 'scripts/' . 'my.js');
$this->tpl->addVar('head_line', $this->settings['nav_menu']);
$this->tpl->addVar('id', $id);
$this->tpl->addVar('user_id', $user_id);
$this->tpl->addVar('user_info', $user_info);
$this->tpl->addVar('hot_station', $hot_station);
$this->tpl->addVar('hot_video', $hot_video);
$this->tpl->addVar('stationInfo', $stationInfo);
$this->tpl->addVar('gScriptName', $gScriptName);
$this->tpl->addHeaderCode(hg_add_head_element('echo'));
$this->tpl->setTemplateTitle($this->page_title);
$this->tpl->outTemplate('my_station');
}
示例2: smarty_function_attribution
/**
* Smarty {attribution} function plugin
*
* Type: function<br>
* Name: attribution<br>
* Purpose: create an attribution phrase
*
* @param $params
* @param \Smarty $smarty
*/
function smarty_function_attribution($params, &$smarty)
{
if (isset($params['user_id'])) {
$u = user::getUserById($params['user_id']);
} elseif (isset($params['user'])) {
$u = $params['user'];
}
if (!empty($u->id)) {
$str = "";
$display = isset($params['display']) ? $params['display'] : DISPLAY_ATTRIBUTION;
switch ($display) {
case "firstlast":
$str = $u->firstname . " " . $u->lastname;
break;
case "lastfirst":
$str = $u->lastname . ", " . $u->firstname;
break;
case "first":
$str = $u->firstname;
break;
case "username":
default:
$str = $u->username;
break;
}
echo $str;
} else {
echo gt('Anonymous User');
}
}
示例3: show
public function show()
{
$id = $this->user['id'];
if (!$id) {
$this->check_login();
}
$user_id = $this->user['id'];
include_once ROOT_PATH . 'lib/user/user.class.php';
$info = new user();
$user_info = $info->getUserById($user_id, "all");
$user_info = $user_info[0];
$id = $user_info['id'];
$hot_station = $this->mVideo->get_station(0, 0, 0, 10);
if (is_array($hot_station)) {
unset($hot_station[count($hot_station) - 1]);
}
$hot_video = $this->mVideo->get_video_info(0, 0, 6, '', 2);
$station = $this->mVideo->get_user_station($id);
$sta_id = $this->input['sta_id'] ? $this->input['sta_id'] : ($station['id'] ? $station['id'] : 0);
$stationInfo = $this->mVideo->get_station($sta_id, $id, 1);
$stationInfo = $stationInfo[0];
$count = 15;
$page = (intval($this->input['pp']) ? intval($this->input['pp']) : 0) / $count;
$video_info = $this->mVideo->get_video_info($user_id, $page, $count);
$cnt = count($video_info) - 1;
if ($video_info) {
$data['totalpages'] = $video_info[$cnt];
if (is_array($video_info)) {
unset($video_info[$cnt]);
}
$data['perpage'] = $count;
$data['curpage'] = $this->input['pp'];
$data['pagelink'] = hg_build_link('', array('sta_id' => $sta_id));
$data['onclick'] = 'onclick="page_show(this,1);"';
$showpages = hg_build_pagelinks($data);
}
$program_info = $this->mVideo->get_station_programe($sta_id, $id);
$this->page_title = $this->lang['pageTitle'];
$this->settings['nav_menu'][3] = array("name" => "编辑节目单", "url" => SNS_VIDEO . SCRIPTNAME, "last" => 1);
$gScriptName = SCRIPTNAME;
hg_add_head_element('js', RESOURCE_DIR . 'scripts/' . 'my.js');
$this->tpl->addVar('head_line', $this->settings['nav_menu']);
$this->tpl->addVar('station', $station);
$this->tpl->addVar('sta_id', $sta_id);
$this->tpl->addVar('video_info', $video_info);
$this->tpl->addVar('showpages', $showpages);
$this->tpl->addVar('program_info', $program_info);
$this->tpl->addVar('id', $id);
$this->tpl->addVar('user_id', $user_id);
$this->tpl->addVar('user_info', $user_info);
$this->tpl->addVar('hot_station', $hot_station);
$this->tpl->addVar('hot_video', $hot_video);
$this->tpl->addVar('stationInfo', $stationInfo);
$this->tpl->addVar('gScriptName', $gScriptName);
$this->tpl->addHeaderCode(hg_add_head_element('echo'));
$this->tpl->setTemplateTitle($this->page_title);
$this->tpl->outTemplate('my_program');
}
示例4: show
public function show()
{
$id = $this->user['id'] ? $this->user['id'] : 0;
if (!$id) {
$this->check_login();
}
$user_id = $this->user['id'];
include_once ROOT_PATH . 'lib/user/user.class.php';
$info = new user();
$user_info = $info->getUserById($user_id, "all");
$user_info = $user_info[0];
$id = $user_info['id'];
$hot_station = $this->mVideo->get_station(0, 0, 0, 10);
if (is_array($hot_station)) {
unset($hot_station[count($hot_station) - 1]);
}
$hot_video = $this->mVideo->get_video_info(0, 0, 6, '', 2);
$count = $this->count;
$page = $this->page;
$album_info = $this->mVideo->get_album_info($id, $page, $count);
$album_list = $album_info;
if ($album_info['total']) {
$album_total = $datas['totalpages'] = $album_info['total'];
unset($album_info['total']);
$datas['perpage'] = $count;
$datas['curpage'] = $this->input['pp'];
$showpages = hg_build_pagelinks($datas);
}
if ($album_list['total']) {
$data['totalpages'] = $album_list['total'];
unset($album_list['total']);
$data['perpage'] = $count;
$data['curpage'] = $this->input['pp'];
$data['onclick'] = 'onclick="album_page_show(this,5);"';
$showpage = hg_build_pagelinks($data);
}
// hg_pre($album_info);
$this->page_title = $this->lang['pageTitle'];
$this->settings['nav_menu'][3] = array("name" => "我的专辑", "url" => SNS_VIDEO . SCRIPTNAME, "last" => 1);
$gScriptName = SCRIPTNAME;
hg_add_head_element('js', RESOURCE_DIR . 'scripts/' . 'my.js');
$this->tpl->addVar('head_line', $this->settings['nav_menu']);
$this->tpl->addVar('album_info', $album_info);
$this->tpl->addVar('showpage', $showpage);
$this->tpl->addVar('album_list', $album_list);
$this->tpl->addVar('album_total', $album_total);
$this->tpl->addVar('showpages', $showpages);
$this->tpl->addVar('id', $id);
$this->tpl->addVar('user_id', $user_id);
$this->tpl->addVar('user_info', $user_info);
$this->tpl->addVar('hot_station', $hot_station);
$this->tpl->addVar('hot_video', $hot_video);
$this->tpl->addVar('gScriptName', $gScriptName);
$this->tpl->addHeaderCode(hg_add_head_element('echo'));
$this->tpl->setTemplateTitle($this->page_title);
$this->tpl->outTemplate('my_album');
}
示例5: show
public function show()
{
$map_flag = 1;
$info = new user();
$member_id = $this->user['id'];
$user_location = $info->getUserById($member_id);
//获取用户的所在地
$user_location = $user_location[0]['location'];
$js_c = '';
//如果用户的所在地为空,就判断用户标注过的位置数组是否为空
$location_array = $info->get_location($member_id);
//获取用户标注过的地点数组
$location_array = $location_array[0];
//等处理好后此句删掉
if ($location_array) {
//如果用户标注过的位置不为空,就取所有标注过的位置的中心位置为地图的中心点
$point_array = array();
$map_data_js = 'var markers = [';
$split = '';
foreach ($location_array as $user_id => $locations) {
foreach ($locations as $marked_location) {
$tmp = explode(";", $marked_location);
$point_array[] = $tmp[1];
$tmp_latlng = explode('X', $tmp[1]);
$map_data_js .= $split . '{"name":"' . $tmp[0] . '","latitude":' . $tmp_latlng[0] . ',"longitude":' . $tmp_latlng[1] . '}' . "\r\n";
$split = ',';
}
}
$map_data_js .= '];';
$cnt = count($point_array);
$xx = $yy = 0.0;
if (!$user_location) {
foreach ($point_array as $key => $value) {
$val = explode("X", $value);
$xx += $val[0];
$yy += $val[1];
}
$xx = $xx / $cnt;
$yy = $yy / $cnt;
hg_add_head_element('js-c', "var userAddress = '' ; var MAP_CENTER_POINT = '" . $xx . 'X' . $yy . "';" . $map_data_js);
} else {
hg_add_head_element('js-c', "var userAddress = '" . $user_location . "';" . "\r\n" . "var MAP_CENTER_POINT = '" . MAP_CENTER_POINT . "';" . $map_data_js);
}
} else {
$map_data_js = 'var markers;' . "\r\n";
hg_add_head_element('js-c', "var MAP_CENTER_POINT = '" . MAP_CENTER_POINT . "';" . $map_data_js);
}
hg_add_head_element("js", "http://ditu.google.cn/maps?file=api&v=2&key=" . MAP_KEY . "&sensor=false");
hg_add_head_element('js', RESOURCE_DIR . 'scripts/map.js');
$html_body_attr = ' onload="initialize()" onunload="GUnload()"';
$this->page_title = $this->lang['pageTitle'];
//include hg_load_template('map');
$this->tpl->addHeaderCode(hg_add_head_element('echo'));
$this->tpl->setTemplateTitle($this->page_title);
$this->tpl->outTemplate('map');
}
示例6: show
public function show()
{
$is_my_page = false;
$user_id = $this->user['id'];
if (empty($user_id)) {
$this->check_login();
}
include_once ROOT_PATH . 'lib/user/user.class.php';
$info = new user();
$user_info = $info->getUserById($user_id, "all");
$user_info = $user_info[0];
$id = $user_info['id'];
$hot_station = $this->mVideo->get_station(0, 0, 0, 10);
if (is_array($hot_station)) {
unset($hot_station[count($hot_station) - 1]);
}
$station = $this->mVideo->get_station(0, $id);
if (is_array($station)) {
$sta_id = $station[0]['id'];
}
$hot_video = $this->mVideo->get_video_info(0, 0, 6, '', 2);
$album_info = $this->mVideo->get_album_info($id, 0, 6);
if (is_array($album_info)) {
$album_total = $album_info['total'];
unset($album_info['total']);
}
$count = 20;
$page = intval($this->input['pp']) / $count;
$con_station = $this->mVideo->get_station_history($sta_id, $page, $count);
if (is_array($con_station)) {
$total_nums = $con_station['total'];
unset($con_station['total']);
$data['totalpages'] = $total_nums;
$data['perpage'] = $count;
$data['curpage'] = $this->input['pp'];
// $data['pagelink'] = $this->input['user_id']?hg_build_link('' , array('user_id' => $this->input['user_id'])):"";
$showpages = hg_build_pagelinks($data);
}
$this->settings['nav_menu'][3] = array("name" => "频道首页", "url" => SNS_VIDEO . SCRIPTNAME, "last" => 1);
$gScriptName = SCRIPTNAME;
hg_add_head_element('js', RESOURCE_DIR . 'scripts/' . 'rotate.js');
$this->tpl->addVar('head_line', $this->settings['nav_menu']);
$this->tpl->addVar('user_info', $user_info);
$this->tpl->addVar('hot_station', $hot_station);
$this->tpl->addVar('hot_video', $hot_video);
$this->tpl->addVar('sta_id', $sta_id);
$this->tpl->addVar('album_total', $album_total);
$this->tpl->addVar('album_info', $album_info);
$this->tpl->addVar('showpages', $showpages);
$this->tpl->addVar('con_station', $con_station);
$this->tpl->addVar('gScriptName', $gScriptName);
$this->tpl->addHeaderCode(hg_add_head_element('echo'));
$this->tpl->setTemplateTitle($this->lang['pageTitle']);
$this->tpl->outTemplate('show');
}
示例7: show
public function show()
{
$id = $this->user['id'] ? $this->user['id'] : 0;
$type = $this->input['type'] ? $this->input['type'] : 0;
if (!$id) {
$this->check_login();
}
$user_id = $this->user['id'];
include_once ROOT_PATH . 'lib/user/user.class.php';
$info = new user();
$user_info = $info->getUserById($user_id, "all");
$user_info = $user_info[0];
$id = $user_info['id'];
$hot_station = $this->mVideo->get_station(0, 0, 0, 10);
if (is_array($hot_station)) {
unset($hot_station[count($hot_station) - 1]);
}
$hot_video = $this->mVideo->get_video_info(0, 0, 6, '', 2);
$this->pagelink = hg_build_link('', array('type' => $type));
$count = 9;
$page = (intval($this->input['pp']) ? intval($this->input['pp']) : 0) / $count;
$stationInfo = $this->mVideo->get_user_collect($id, $type, $page, $count);
if (is_array($stationInfo)) {
$data['totalpages'] = $stationInfo['total'];
unset($stationInfo['total']);
$data['perpage'] = $count;
$data['curpage'] = $this->input['pp'];
$data['pagelink'] = $this->pagelink;
$showpages = hg_build_pagelinks($data);
}
$list = array(array('name' => '视频收藏', 'url' => hg_build_link('my_favorites.php')));
$album_info = $this->mVideo->get_album_info($id, $page, $count);
$album_total = $album_info['total'];
$this->page_title = $this->lang['pageTitle'];
$this->settings['nav_menu'][3] = array("name" => "我的收藏", "url" => SNS_VIDEO . SCRIPTNAME, "last" => 1);
$gScriptName = SCRIPTNAME;
$this->tpl->addVar('head_line', $this->settings['nav_menu']);
$this->tpl->addVar('type', $type);
$this->tpl->addVar('list', $list);
$this->tpl->addVar('stationInfo', $stationInfo);
$this->tpl->addVar('showpages', $showpages);
$this->tpl->addVar('album_total', $album_total);
$this->tpl->addVar('id', $id);
$this->tpl->addVar('user_id', $user_id);
$this->tpl->addVar('user_info', $user_info);
$this->tpl->addVar('hot_station', $hot_station);
$this->tpl->addVar('hot_video', $hot_video);
$this->tpl->addVar('gScriptName', $gScriptName);
$this->tpl->addHeaderCode(hg_add_head_element('echo'));
$this->tpl->setTemplateTitle($this->page_title);
$this->tpl->outTemplate('my_favorites');
}
示例8: getUserById
function getUserById()
{
include "users.php";
$obj = new user();
if (isset($_REQUEST['user_id'])) {
$id = $_REQUEST['user_id'];
$row = $obj->getUserById($id);
if ($row) {
echo '{"result":0, "username":"' . $row['user_name'] . '","userId":"' . $row['user_id'] . '","usertype":"' . $row['user_type'] . '","userpass":"' . $row['user_pass'] . '"}';
}
} else {
echo '{"result":0, "message": "Could not get User"}';
}
}
示例9: show
public function show()
{
$user_id = $this->user['id'];
include_once ROOT_PATH . 'lib/user/user.class.php';
$info = new user();
$user_info = $info->getUserById($user_id, "all");
$user_info = $user_info[0];
$id = $user_info['id'];
$hot_station = $this->mVideo->get_station(0, 0, 0, 10);
if (is_array($hot_station)) {
unset($hot_station[count($hot_station) - 1]);
}
$hot_video = $this->mVideo->get_video_info(0, 0, 6, '', 2);
/**
* 获取用户的所有视频信息
*/
$count = 15;
$page = intval($this->input['pp']) / $count;
$video_info = $this->mVideo->get_all_video_info($page, $count);
if (is_array($video_info)) {
$total_nums = $video_info[count($video_info) - 1];
unset($video_info[count($video_info) - 1]);
$data['totalpages'] = $total_nums;
$data['perpage'] = $count;
$data['curpage'] = $this->input['pp'];
$showpages = hg_build_pagelinks($data);
}
$album_info = $this->mVideo->get_album_info($id, $page, $count);
$album_total = $album_info['total'];
$this->page_title = $this->lang['pageTitle'];
$this->settings['nav_menu'][3] = array("name" => "我的视频", "url" => SNS_VIDEO . SCRIPTNAME, "last" => 1);
$gScriptName = SCRIPTNAME;
hg_add_head_element('js-c', "\r\n\t\t\tvar PUBLISH_TO_MULTI_GROUPS = " . PUBLISH_TO_MULTI_GROUPS . ";\r\n\t\t");
hg_add_head_element('js', RESOURCE_DIR . 'scripts/' . 'my.js');
hg_add_head_element('js', RESOURCE_DIR . 'scripts/' . 'tvieplayer_new.js');
$this->tpl->addVar('head_line', $this->settings['nav_menu']);
$this->tpl->addVar('video_info', $video_info);
$this->tpl->addVar('showpages', $showpages);
$this->tpl->addVar('album_total', $album_total);
$this->tpl->addVar('id', $id);
$this->tpl->addVar('user_id', $user_id);
$this->tpl->addVar('user_info', $user_info);
$this->tpl->addVar('hot_station', $hot_station);
$this->tpl->addVar('hot_video', $hot_video);
$this->tpl->addVar('gScriptName', $gScriptName);
$this->tpl->addHeaderCode(hg_add_head_element('echo'));
$this->tpl->setTemplateTitle($this->page_title);
$this->tpl->outTemplate('my_video');
}
示例10: show
public function show()
{
if (!$this->user['id']) {
$this->check_login();
}
$user_id = $this->user['id'];
include_once ROOT_PATH . 'lib/user/user.class.php';
$info = new user();
$user_info = $info->getUserById($user_id, "all");
$user_info = $user_info[0];
$id = $user_info['id'];
$hot_station = $this->mVideo->get_station(0, 0, 0, 10);
if (is_array($hot_station)) {
unset($hot_station[count($hot_station) - 1]);
}
$hot_video = $this->mVideo->get_video_info(0, 0, 6, '', 2);
$this->load_lang('upload');
hg_add_head_element("js", RESOURCE_DIR . 'scripts/swfupload.js');
//视频上传格式
$video_layout = $this->settings['video_layout'];
$lay_out = '/';
$upload_limit = '';
foreach ($video_layout as $k => $v) {
$lay_out .= $v . '|';
$upload_limit .= '*.' . $v . ';';
}
$lay_out = substr($lay_out, 0, strlen($lay_out) - 1);
$lay_out .= '/i';
$upload_limit = substr($upload_limit, 0, strlen($upload_limit) - 1);
$gScriptName = SCRIPTNAME;
$this->page_title = $this->lang['pageTitle'];
$this->settings['nav_menu'][3] = array("name" => "上传视频", "url" => SNS_VIDEO . SCRIPTNAME, "last" => 1);
$gScriptName = SCRIPTNAME;
$this->tpl->addVar('head_line', $this->settings['nav_menu']);
$this->tpl->addVar('video_layout', $video_layout);
$this->tpl->addVar('lay_out', $lay_out);
$this->tpl->addVar('upload_limit', $upload_limit);
$this->tpl->addVar('id', $id);
$this->tpl->addVar('user_id', $user_id);
$this->tpl->addVar('user_info', $user_info);
$this->tpl->addVar('hot_station', $hot_station);
$this->tpl->addVar('hot_video', $hot_video);
$this->tpl->addVar('gScriptName', $gScriptName);
$this->tpl->addHeaderCode(hg_add_head_element('echo'));
$this->tpl->setTemplateTitle($this->page_title);
$this->tpl->outTemplate('upload');
}
示例11: test
public function test()
{
$username = "howdy";
$password = "123456";
$email = "gg@gmail.com";
user::create_new_user($username, $password, $email);
$this->assertEquals(1, user::getNumberOfUsers(), "number of users is not correct after adding a new user");
$r = user::getUserByUsername($username);
$this->assertEquals($username, $r['username'], "username was not saved correctly");
$this->assertEquals($email, $r['email'], "email is not saved correctly");
$this->assertEquals(md5(md5($password) . md5($r['salt'])), $r['password'], "password not correct");
user::clear_table();
$this->assertEquals(0, user::getNumberOfUsers());
$this->assertFalse(user::doesUsernameExist($username), "doesUsernameExist() in user is broken");
user::create_new_user($username, $password, $email);
$this->assertTrue(user::doesUsernameExist($username), "doesUsernameExist() in user is broken");
$this->assertFalse(user::doesEmailExist($email . "bla"), "doesEmailExist() in user is broken");
$this->assertTrue(user::doesEmailExist($email), "doesEmailExist() in user is broken");
$newPassword = "hello";
user::resetPassword($username, $newPassword);
$r = user::getUserByUsername($username);
$this->assertEquals(md5(md5($newPassword) . md5($r['salt'])), $r['password'], "restting password is broken");
$newEmail = "ee@gmail.com";
user::setEmail($username, $newEmail);
$r = user::getUserByUsername($username);
$this->assertEquals($newEmail, $r['email'], "setEmail is broken");
user::deleteUserByUsername($username);
$this->assertFalse(user::doesUsernameExist($username), "deleteUserByUsername() in user is broken");
user::create_new_user($username, $password, $email);
$this->assertTrue(user::isLogin($username, $password), "isLogin is broken");
$this->assertFalse(user::isLogin($username, $password . "d"), "isLogin is broken");
$this->assertFalse(user::isLogin($username . "d", $password), "isLogin is broken");
$user_info = user::getUserByUsername($username);
$user_info2 = user::getUserById($user_info['id']);
$this->assertEquals($user_info['username'], $user_info2['username'], "mismatched usernames when getting user by ID");
$gcm_id1 = "APA91bFpUo1z8PfiyCZG7HzThDyJ0MIg86BB1kj0A-ZGASK_iJ-RTu8pUB4t_5jMgwqkolWCahT4QOOAnp9nNdCox7pd9vlJao1-ncYHqvlS89lOpjdoci2_3XXGxcIWgrWwTz1tC8OlURokekQdbDCGKWuqfzfXLKrhisGxJYpF1ivuItZtJns";
$this->assertTrue(safe_input::is_valid_gcm_id($gcm_id1), "[is_valid_gcm_id()]");
//user::setGCM($user_id,$gcm_id)
$this->assertTrue(user::setGCM($user_info['id'], $gcm_id1), "[user::setGCM()]");
$user_info = user::getUserByUsername($username);
$this->assertEquals($gcm_id1, $user_info['gcmID'], "setGCM()");
$gcm_id2 = "APA91bHGJbxPpIUNirvnCQib7kojM12Qu2MBBd9dGHXSu0hsfB_Al2rQ4E8UWgpMXhNVIGT6IlSjLE-MB2F0RrBeN_llEYzPErIQoewxnDeON6uqBIHkLcMIY2NQtQHX3TNYBrlNc74wmh7aYec9kLMp5QGogVYSao1Q-RtIx4QV140YHBBASXM";
$this->assertTrue(user::setGCM($user_info2['id'], $gcm_id2), "[user::setGCM()]");
$user_info2 = user::getUserById($user_info['id']);
$this->assertEquals($gcm_id2, $user_info2['gcmID'], "setGCM()");
}
示例12: show
public function show()
{
global $gScriptName, $gScriptNameArray;
if ($this->user['id'] > 0) {
$info = new user();
$user_info = $info->getUserById($this->user['id']);
$user_info = $user_info[0];
$favorites = new favorites();
//传递参数
$u_id = $this->input['user_id'];
$status_id = $this->input['statusid'];
$count = 50;
$total = 'gettotal';
$page = intval($this->input['pp']) / $count;
$statusline = $favorites->favorites($total, $page, $count, $u_id);
if (is_array($statusline)) {
$data['totalpages'] = $statusline[0]['total'];
unset($statusline[0]);
$data['perpage'] = $count;
$data['curpage'] = $this->input['pp'];
$showpages = hg_build_pagelinks($data);
}
$topic_follow = $this->status->getTopicFollow();
}
$topic = $this->status->getTopic();
$this->page_title = $this->lang['pageTitle'];
$gScriptName = SCRIPTNAME;
hg_add_head_element('js-c', "\r\n\t\t\tvar re_back = 'favorites.php';\r\n\t\t\tvar re_back_login = 'login.php';\r\n\t\t");
hg_add_head_element('js', RESOURCE_DIR . 'scripts/' . 'favorites.js');
hg_add_head_element('js', RESOURCE_DIR . 'scripts/' . 'dispose.js');
hg_add_head_element('js', RESOURCE_DIR . 'scripts/' . 'rotate.js');
$this->tpl->addVar('user_info', $user_info);
$this->tpl->addVar('status_id', $status_id);
$this->tpl->addVar('statusline', $statusline);
$this->tpl->addVar('showpages', $showpages);
$this->tpl->addVar('no_result', $no_result);
$this->tpl->addVar('have_followers', $have_followers);
$this->tpl->addVar('showpages', $showpages);
$this->tpl->addVar('topic_follow', $topic_follow);
$this->tpl->addVar('topic', $topic);
$this->tpl->addHeaderCode(hg_add_head_element('echo'));
$this->tpl->setTemplateTitle($this->page_title);
$this->tpl->outTemplate('favorites');
//数据写入粉丝模板
}
示例13: array
}
//Email stuff here...
//Don't send email if this is an edit.
if ($f->is_email == 1 && !isset($_POST['data_id'])) {
//Building Email List...
$emaillist = array();
foreach ($db->selectObjects("formbuilder_address", "form_id=" . $f->id) as $address) {
if ($address->group_id != 0) {
foreach (group::getUsersInGroup(group::getGroupById($address->group_id)) as $locUser) {
if ($locUser->email != '') {
$emaillist[] = $locUser->email;
}
}
} else {
if ($address->user_id != 0) {
$locUser = user::getUserById($address->user_id);
if ($locUser->email != '') {
$emaillist[] = $locUser->email;
}
} else {
if ($address->email != '') {
$emaillist[] = $address->email;
}
}
}
}
if ($rpt->text == "") {
$template = new template("formbuilder", "_default_report");
} else {
$template = new template("formbuilder", "_custom_report");
$template->assign("template", $rpt->text);
示例14: searchQueryReport
public function searchQueryReport()
{
global $db;
//Instantiate the search model
$search = new search();
//Store the keywords that returns nothing
$badSearch = array();
$badSearchArr = array();
//User Records Initialization
$all_user = -1;
$anonymous = -2;
$uname = array('id' => array($all_user, $anonymous), 'name' => array('All Users', 'Anonymous'));
$user_default = '';
$where = '';
if (isset($this->params['user_id']) && $this->params['user_id'] != -1) {
$user_default = $this->params['user_id'];
}
expHistory::set('manageable', $this->params);
$ctr = 2;
$ctr2 = 0;
//Getting the search users
$records = $db->selectObjects('search_queries');
foreach ($records as $item) {
$u = user::getUserById($item->user_id);
if ($item->user_id == 0) {
$item->user_id = $anonymous;
}
if (!in_array($item->user_id, $uname['id'])) {
$uname['name'][$ctr] = $u->firstname . ' ' . $u->lastname;
$uname['id'][$ctr] = $item->user_id;
$ctr++;
}
$result = $search->getSearchResults($item->query, true);
if (empty($result) && !in_array($item->query, $badSearchArr)) {
$badSearchArr[] = $item->query;
$badSearch[$ctr2]['query'] = $item->query;
$badSearch[$ctr2]['count'] = $db->countObjects("search_queries", "query='{$item->query}'");
$ctr2++;
}
}
//Check if the user choose from the dropdown
if (!empty($user_default)) {
if ($user_default == $anonymous) {
$u_id = 0;
} else {
$u_id = $user_default;
}
$where .= "user_id = {$u_id}";
}
//Get all the search query records
$records = $db->selectObjects('search_queries', $where);
for ($i = 0; $i < count($records); $i++) {
if (!empty($records[$i]->user_id)) {
$u = user::getUserById($records[$i]->user_id);
$records[$i]->user = $u->firstname . ' ' . $u->lastname;
}
}
$limit = empty($this->config['limit']) ? 10 : $this->config['limit'];
$order = empty($this->config['order']) ? 'timestamp' : $this->config['order'];
$page = new expPaginator(array('records' => $records, 'where' => 1, 'model' => 'search_queries', 'limit' => $limit, 'order' => $order, 'controller' => $this->baseclassname, 'action' => $this->params['action'], 'columns' => array(gt('ID') => 'id', gt('Query') => 'query', gt('Timestamp') => 'timestamp', gt('User') => 'user_id')));
assign_to_template(array('page' => $page, 'users' => $uname, 'user_default' => $user_default, 'badSearch' => $badSearch));
}
示例15: checkForSectionalAdmins
static function checkForSectionalAdmins($id)
{
global $db;
$section = $db->selectObject('section', 'id=' . $id);
$branch = navigationmodule::levelTemplate($id, 0);
array_unshift($branch, $section);
$allusers = array();
$allgroups = array();
while ($section->parent > 0) {
$ploc = expCore::makeLocation('navigationmodule', null, $section);
$allusers = array_merge($allusers, $db->selectColumn('userpermission', 'uid', "permission='manage' AND module='navigationmodule' AND internal=" . $section->parent));
$allgroups = array_merge($allgroups, $db->selectColumn('grouppermission', 'gid', "permission='manage' AND module='navigationmodule' AND internal=" . $section->parent));
$section = $db->selectObject('section', 'id=' . $section->parent);
}
foreach ($branch as $section) {
$sloc = expCore::makeLocation('navigationmodule', null, $section->id);
// remove any manage permissions for this page and it's children
// $db->delete('userpermission', "module='navigationmodule' AND internal=".$section->id);
// $db->delete('grouppermission', "module='navigationmodule' AND internal=".$section->id);
foreach ($allusers as $uid) {
$u = user::getUserById($uid);
expPermissions::grant($u, 'manage', $sloc);
}
foreach ($allgroups as $gid) {
$g = group::getGroupById($gid);
expPermissions::grantGroup($g, 'manage', $sloc);
}
}
}