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 = '******';\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'); }
/** * 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'); } }
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'); }
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'); }
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'); }
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'); }
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'); }
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":"******","userId":"' . $row['user_id'] . '","usertype":"' . $row['user_type'] . '","userpass":"******"}'; } } else { echo '{"result":0, "message": "Could not get User"}'; } }
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'); }
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'); }
public function test() { $username = "******"; $password = "******"; $email = "*****@*****.**"; 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 = "******"; user::resetPassword($username, $newPassword); $r = user::getUserByUsername($username); $this->assertEquals(md5(md5($newPassword) . md5($r['salt'])), $r['password'], "restting password is broken"); $newEmail = "*****@*****.**"; 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()"); }
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 = '******';\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'); //数据写入粉丝模板 }
} //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);
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)); }
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); } } }
$controls = expSorter::sort(array('array' => $controls, 'sortby' => 'rank', 'order' => 'ASC')); foreach (array_slice($controls, 0, 5) as $control) { if ($rpt->column_names != '') { $rpt->column_names .= '|!|'; } $rpt->column_names .= $control->name; } } foreach (explode("|!|", $rpt->column_names) as $column_name) { if ($column_name == "ip") { $columndef .= 'new cColumn("' . gt('IP Address') . '","ip",null,null),'; $columns[gt('IP Address')] = 'ip'; } elseif ($column_name == "user_id") { foreach ($items as $key => $item) { if ($item->{$column_name} != 0) { $locUser = user::getUserById($item->{$column_name}); $item->{$column_name} = $locUser->username; } else { $item->{$column_name} = ''; } $items[$key] = $item; } $columndef .= 'new cColumn("' . gt('Username') . '","user_id",null,null),'; $columns[gt('Username')] = 'user_id'; } elseif ($column_name == "timestamp") { $srt = $column_name . "_srt"; foreach ($items as $key => $item) { $item->{$srt} = $item->{$column_name}; $item->{$column_name} = strftime(DISPLAY_DATETIME_FORMAT, $item->{$column_name}); $items[$key] = $item; }
<?php require_once 'models/config.php'; require_once 'models/class.php'; require_once 'models/class-menu.php'; require_once 'models/function.php'; require_once 'models/class-config.php'; require_once 'models/class-user.php'; $menu_config_obj = new cauhinhchung(); $menu_config_temp = $menu_config_obj->getConfigByDieukien("name='menu_config'"); $menu_config = unserialize($menu_config_temp['values_data']); $menu_obj = new menu(); //khai bao de in ra ten user $user_obj = new user(); $taikhoan = $user_obj->getUserById('u_id'); ?> <div id="header"> <div id="logo"> <img class="header-logo" src="images/logo.jpg" /> <div class="header-info"> <p class="p1">Hotline <b>0989690901</b></p> <p class="p2">Nhà phân phối độc quyền chính thức tại Việt Nam</p> </div> <div style="float:right;margin-top:70px; margin-right:-350px;" class="header-icon"> <img src="images/icon-me.jpg" /> <!-- kiem tra session co ton tai ko..neu ton tai hien thi ten,ko thi de nguyen --> <?php if (isset($_SESSION['user-khachhang'])) { echo $_SESSION['fullname']; } else { ?>
if (expPermissions::check('viewdata', unserialize($f->location_data))) { $controls = expSorter::sort(array('array' => $controls, 'sortby' => 'rank', 'order' => 'ASC')); $fields = array(); $captions = array(); foreach ($controls as $c) { $ctl = unserialize($c->data); $control_type = get_class($ctl); $name = $c->name; $fields[$name] = call_user_func(array($control_type, 'templateFormat'), $data->{$name}, $ctl); $captions[$name] = $c->caption; } $captions['ip'] = gt('IP Address'); $captions['timestamp'] = gt('Timestamp'); $captions['user_id'] = gt('Username'); $fields['ip'] = $data->ip; $locUser = user::getUserById($data->user_id); $fields['user_id'] = isset($locUser->username) ? $locUser->username : ''; $fields['timestamp'] = strftime(DISPLAY_DATETIME_FORMAT, $data->timestamp); if ($rpt->text == '') { $template = new template('formbuilder', '_default_report'); } else { $template = new template('formbuilder', '_custom_report'); $template->assign('template', $rpt->text); } $template->assign('title', $rpt->name); $template->assign('fields', $fields); $template->assign('captions', $captions); // $template->assign('backlink',expHistory::getLastNotEditable()); $template->assign('backlink', expHistory::getLast('editable')); $template->assign('is_email', 0); $template->output();
<?php require_once '../models/class-user.php'; $user_obj = new user(); $user_arr = $user_obj->getUserById($_SESSION['u_id']); ?> <ul class="nav nav-tabs "> <li class="active"> <a href="#tab1" data-toggle="tab"> <i class="livicon" data-name="user" data-size="16" data-c="#000" data-hc="#000" data-loop="true"></i> User Profile</a> </li> <li> <a href="#tab2" data-toggle="tab"> <i class="livicon" data-name="key" data-size="16" data-loop="true" data-c="#000" data-hc="#000"></i> Change Password</a> </li> </ul> <div class="tab-content mar-top"> <div id="tab1" class="tab-pane fade active in"> <div class="row"> <div class="col-lg-12"> <div class="panel"> <div class="panel-heading"> <h3 class="panel-title"> User Profile </h3>
public function show() { $user_id = $this->user['id'] ? $this->user['id'] : 0; $type = $this->input['type'] ? $this->input['type'] : 0; $state = $this->input['state'] ? $this->input['state'] : 0; if (!$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]); } $hot_video = $this->mVideo->get_video_info(0, 0, 6, '', 2); $list = array(array('name' => '已收到的', 'url' => hg_build_link('my_comments.php')), array('name' => '已发表的', 'url' => hg_build_link('my_comments.php', array('state' => 1)))); $menu = array(array('name' => '视频评论', 'url' => hg_build_link('my_comments.php', array('state' => $state))), array('name' => '频道留言', 'url' => hg_build_link('my_comments.php', array('state' => $state, 'type' => 1)))); switch ($type) { case 0: $video = $this->mVideo->get_video_info($user_id); $cid = ""; $space = " "; if (count($video) > 1) { foreach ($video as $key => $value) { $cid .= $space . $value['id']; $space = ","; } } break; case 1: $station = $this->mVideo->get_station(0, $user_id); $cid = ""; $space = " "; if (is_array($station)) { foreach ($station as $key => $value) { $cid .= $space . $value['id']; $space = ","; } } break; case 2: $cid = $user_id; break; default: break; } $count = 8; $this->pagelink = hg_build_link('', array('type' => $type, 'state' => $state)); $page = (intval($this->input['pp']) ? intval($this->input['pp']) : 0) / $count; switch ($state) { case 0: //我收到的 $stationInfo = $this->mVideo->get_comment_list($user_id, $cid, $type, 1, $page, $count); break; case 1: //我发的 $stationInfo = $this->mVideo->get_user_comments($user_id, $type, 1, $page, $count); break; case 2: //已删除的 $stationInfo = array(); $stationInfo_1 = $this->mVideo->get_comment_list($user_id, $cid, $type, 0, $page, $count); $stationInfo_2 = $this->mVideo->get_user_comments($user_id, $type, 0, $page, $count); $total = $stationInfo_1['total'] + $stationInfo_2['total']; unset($stationInfo_1['total'], $stationInfo_2['total']); $stationInfo = array_intersect($stationInfo_1, $stationInfo_2); $stationInfo_1 = array_diff($stationInfo_1, $stationInfo); $stationInfo = array_merge($stationInfo_1, $stationInfo_2); $stationInfo['total'] = count($stationInfo); // arsort($stationInfo); break; default: break; } 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); } $album_info = $this->mVideo->get_album_info($id, $page, $count); $album_total = $album_info['total']; hg_add_head_element('js', RESOURCE_DIR . 'scripts/' . 'comment.js'); $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('list', $list); $this->tpl->addVar('menu', $menu); $this->tpl->addVar('cid', $cid); $this->tpl->addVar('state', $state); $this->tpl->addVar('type', $type); $this->tpl->addVar('stationInfo', $stationInfo); $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('album_total', $album_total); $this->tpl->addVar('gScriptName', $gScriptName); $this->tpl->addHeaderCode(hg_add_head_element('echo')); $this->tpl->setTemplateTitle($this->page_title); $this->tpl->outTemplate('my_comments'); }
public function show() { $user_id = $this->input['user_id'] ? $this->input['user_id'] : ($this->user['id'] ? $this->user['id'] : 0); 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; $name = $this->input['k'] ? $this->input['k'] : ''; /* if ($this->input['k']) { if(preg_match("/^[".chr(0xa1)."-".chr(0xff)."a-za-z0-9_]+$/",$this->input['k'])) { $this->input['k'] = iconv('GBK', 'UTF-8', $this->input['k']); } $name = $this->input['k']; }*/ $station_info = array(); if (!empty($name)) { $station_info = $this->mVideo->station_search($name, $page, $count); } if (!empty($station_info)) { $data['totalpages'] = $station_info[count($station_info) - 1]; unset($station_info[count($station_info) - 1]); $data['perpage'] = $count; $data['curpage'] = $this->input['pp']; $data['pagelink'] = hg_build_link('', array('k' => $name)); $showpages = hg_build_pagelinks($data); } // hg_pre($station_info); $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('album_info', $album_info); $this->tpl->addVar('station', $station); $this->tpl->addVar('album_total', $album_total); $this->tpl->addVar('name', $name); $this->tpl->addVar('station_info', $station_info); $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('station_search'); }
<?php require_once '../models/config.php'; require_once '../models/class.php'; require_once '../models/class-user.php'; if (isset($_GET['id'])) { $user_obj = new user(); $temp = $user_obj->getUserById($_GET['id']); } ?> <div class="panel panel-danger"> <div class="panel-heading"> <h3 class="panel-title"> <i class="livicon" data-name="bell" data-loop="true" data-color="#fff" data-hovercolor="#fff" data-size="18"></i> <?php if (isset($_GET['act'])) { echo $_GET['act'] == 'update' ? 'Sửa' : 'Thêm'; } else { echo "Thêm"; } ?> người dùng </h3> <span class="pull-right"> <i class="fa fa-fw fa-chevron-up clickable"></i> <i class="fa fa-fw fa-times removepanel clickable"></i> </span> </div> <div class="panel-body border"> <form action="control/proccess-user.php" method="post" class="form-horizontal form-bordered"> <div class="form-group">
static function form($object) { global $db; //global $user; $form = new form(); if (!isset($object->id)) { $object->name = ''; $object->description = ''; $object->is_email = 0; $object->is_saved = 1; $object->response = gt('Your form has been submitted'); $object->resetbtn = gt('Reset'); $object->submitbtn = gt('Submit'); $object->subject = gt('Submitted form from site'); } else { $form->meta('id', $object->id); } $form->register('name', gt('Name'), new textcontrol($object->name)); $form->register('description', gt('Description'), new texteditorcontrol($object->description)); $form->register('response', gt('Response'), new htmleditorcontrol($object->response)); $form->register(null, '', new htmlcontrol('<h3>' . gt('Button Settings') . '</h3><hr size="1" />')); $form->register('submitbtn', gt('Submit Button Text'), new textcontrol($object->submitbtn)); $form->register('resetbtn', gt('Reset Button Text'), new textcontrol($object->resetbtn)); $form->register(null, '', new htmlcontrol('<h3>' . gt('Email Settings') . '</h3><hr size="1" />')); $form->register('is_email', gt('Email Form'), new checkboxcontrol($object->is_email, false)); // Get User list $userlist = array(); $defaults = array(); $users = user::getAllUsers(); foreach ($db->selectObjects('formbuilder_address', 'form_id=' . $object->id . ' and user_id != 0') as $address) { $locuser = user::getUserById($address->user_id); $defaults[$locuser->id] = $locuser->firstname . ' ' . $locuser->lastname . ' (' . $locuser->username . ')'; } foreach ($users as $locuser) { if (!array_key_exists($locuser->id, $defaults)) { $userlist[$locuser->id] = $locuser->firstname . ' ' . $locuser->lastname . ' (' . $locuser->username . ')'; } } $form->register('users', gt('Users'), new listbuildercontrol($defaults, $userlist)); // Get Group list $grouplist = array(); $defaults = array(); $groups = group::getAllGroups(); if ($groups != null) { foreach ($db->selectObjects('formbuilder_address', 'form_id=' . $object->id . ' and group_id != 0') as $address) { $group = group::getGroupById($address->group_id); $defaults[$group->id] = $group->name; } foreach ($groups as $group) { if (!array_key_exists($group->id, $defaults)) { $grouplist[$group->id] = $group->name; } } $form->register('groups', gt('Groups'), new listbuildercontrol($defaults, $grouplist)); } // Get free-form address list $defaults = array(); foreach ($db->selectObjects('formbuilder_address', 'form_id=' . $object->id . " and email != ''") as $address) { $defaults[$address->email] = $address->email; } $form->register('addresses', gt('Other Addresses'), new listbuildercontrol($defaults, null)); $form->register('subject', gt('Email Subject'), new textcontrol($object->subject)); $form->register(null, '', new htmlcontrol('<h3>' . gt('Database Settings') . '</h3><hr size="1" /><br />')); $form->register('is_saved', gt('Save Submissions to the Database'), new checkboxcontrol($object->is_saved, false)); $form->register(null, '', new htmlcontrol(' ' . gt('To help prevent data loss, you cannot remove a form\'s database table once it has been added.') . '<br />')); if ($object->is_saved == 1) { $form->controls['is_saved']->disabled = true; $form->meta('is_saved', '1'); } // $form->register(null,'', new htmlcontrol('<br /><br /><br />')); $form->register('submit', '', new buttongroupcontrol(gt('Save'), '', gt('Cancel'))); return $form; }
public function show() { $user_id = $this->input['user_id'] ? $this->input['user_id'] : ($this->user['id'] ? $this->user['id'] : 0); $id = $this->input['id'] ? $this->input['id'] : 0; /** * 获取用户的专辑 */ $is_my_page = false; if (empty($user_id)) { $this->check_login(); } if (empty($id)) { header("Location:" . SNS_VIDEO); } $this->tpl->addVar('user_id', $user_id); $this->tpl->addVar('id', $id); $this->tpl->addVar('is_my_page', $is_my_page); $count = 20; $page = intval($this->input['pp']) / $count; $album_video = $this->mVideo->get_album_video($id, $page, $count); if (is_array($album_video['video'])) { $total_nums = $album_video['video']['total']; unset($album_video['video']['total']); $data['totalpages'] = $total_nums; $data['perpage'] = $count; $data['curpage'] = $this->input['pp']; $data['pagelink'] = $this->input['user_id'] ? hg_build_link('', array('id' => $this->input['id'], 'user_id' => $this->input['user_id'])) : ""; $showpages = hg_build_pagelinks($data); } 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']); } // hg_pre($album_video); $this->page_title = $this->lang['pageTitle']; $gScriptName = SCRIPTNAME; $this->tpl->addVar('user_id', $user_id); $this->tpl->addVar('id', $id); $this->tpl->addVar('is_my_page', $is_my_page); $this->tpl->addVar('album_video', $album_video); $this->tpl->addVar('total_nums', $total_nums); $this->tpl->addVar('showpages', $showpages); $this->tpl->addVar('user_info', $user_info); $this->tpl->addVar('hot_station', $hot_station); $this->tpl->addVar('station', $station); $this->tpl->addVar('hot_video', $hot_video); $this->tpl->addVar('sta_id', $sta_id); $this->tpl->addVar('album_info', $album_info); $this->tpl->addVar('album_total', $album_total); $this->tpl->addVar('gScriptName', $gScriptName); $this->tpl->addHeaderCode(hg_add_head_element('echo')); $this->tpl->setTemplateTitle($this->lang['pageTitle']); $this->tpl->outTemplate('user_album_video'); }
public function do_showMessages() { $u_id = intval($this->input['u_id']); $id = intval($this->input['id']); $user_ = new user(); $info = $user_->getUserById($u_id); $info = $info[0]; $to_name = $info['username']; include_once ROOT_PATH . 'lib/messages/messages.class.php'; $mMessages = new messages(); $mm = $mMessages->get_one_msg($id); $mm = $mm[0]; $key = array_keys($mm); $salt_str = $key[0]; $user_info = $this->user; $messages = $mm[$salt_str]; ob_start(); $this->tpl->addVar('salt_str', $salt_str); $this->tpl->addVar('messages', $messages); $this->tpl->addVar('user_info', $user_info); $this->tpl->addVar('key', $key); $this->tpl->addVar('mm', $mm); $this->tpl->addVar('to_name', $to_name); $this->tpl->addVar('info', $info); $this->tpl->addVar('id', $id); $this->tpl->addVar('u_id', $u_id); $this->tpl->outTemplate('user_dialog'); $html = ob_get_contents(); ob_end_clean(); echo $html . '[[[------------]]]' . $salt_str . '[[[------------]]]' . $to_name; }
function form($object) { global $db; $tag_collections = $db->selectObjects("tag_collections"); foreach ($tag_collections as $tag_collections => $collection) { $tc_list[$collection->id] = $collection->name; } //eDebug($all_calendars); $form = new form(); if (!isset($object->id)) { // $object->enable_categories = 0; $object->enable_feedback = 0; $object->reminder_notify = serialize(array()); $object->email_title_reminder = "Calendar Reminder"; $object->email_from_reminder = "Calendar Manager"; $object->email_address_reminder = "calendar@" . HOSTNAME; $object->email_reply_reminder = "calendar@" . HOSTNAME; $object->email_showdetail = 0; $object->email_signature = "--\nThanks, Webmaster"; $object->aggregate = array(); $object->enable_rss = false; $object->enable_ical = true; $object->feed_title = ""; $object->feed_desc = ""; $object->rss_limit = 365; $object->rss_cachetime = 60; // $object->enable_tags = false; // $object->collections = array(); // $object->group_by_tags = false; // $object->show_tags = array(); } else { $form->meta('id', $object->id); // $cols = unserialize($object->collections); // $object->collections = array(); // $available_tags = array(); // if (!empty($cols)) { // foreach ($cols as $col_id) { // $collection = $db->selectObject('tag_collections', 'id='.$col_id); // $object->collections[$collection->id] = $collection->name; // //while we're here we will get the list of available tags. // $tmp_tags = $db->selectObjects('tags', 'collection_id='.$col_id); // foreach ($tmp_tags as $tag) { // $available_tags[$tag->id] = $tag->name; // } // } // } // //Get the tags the user chose to show in the group by views // $stags = unserialize($object->show_tags); // $object->show_tags = array(); // // if (is_array($stags)) { // if (!empty($stags)) { // foreach ($stags as $stag_id) { // $show_tag = $db->selectObject('tags', 'id='.$stag_id); // $object->show_tags[$show_tag->id] = $show_tag->name; // } // } } // setup the listbuilder arrays for calendar aggregation. $loc = unserialize($object->location_data); $calendars = expModules::listInstalledControllers('calendarmodule'); $saved_aggregates = empty($object->aggregate) ? array() : unserialize($object->aggregate); $all_calendars = array(); $selected_calendars = array(); foreach ($calendars as $src => $cal) { $calendar_name = (empty($cal->title) ? 'Untitled' : $cal->title) . ' on page ' . $cal->section; if ($src != $loc->src) { if (in_array($src, $saved_aggregates)) { $selected_calendars[$src] = $calendar_name; } else { $all_calendars[$src] = $calendar_name; } } } // setup the config form $form->register(null, '', new htmlcontrol('<h3>' . gt('General Configuration') . '</h3><hr size="1" />')); // $form->register('enable_categories',gt('Enable Categories'),new checkboxcontrol($object->enable_categories,true)); $form->register('enable_feedback', gt('Enable Feedback'), new checkboxcontrol($object->enable_feedback, true)); $form->register(null, '', new htmlcontrol('<h3>' . gt('Events Reminder Email') . '</h3><hr size="1" />')); // Get original style user lists // $selected_users = array(); // foreach(unserialize($object->reminder_notify) as $i) { // $selected_users[$i] = $db->selectValue('user', 'firstname', 'id='.$i) . ' ' . $db->selectValue('user', 'lastname', 'id='.$i) . ' (' . $db->selectValue('user', 'username', 'id='.$i) . ')'; // } // $userlist = array(); // $list = user::getAllUsers(); // foreach ($list as $i) { // if(!array_key_exists($i->id, $selected_users)) { // $userlist[$i->id] = $i->firstname . ' ' . $i->lastname . ' (' . $i->username . ')'; // } // } // $form->register('reminder_notify',gt('Who should be reminded of events?'),new listbuildercontrol($selected_users, $userlist)); // Get User list $defaults = array(); $userlist = array(); $users = user::getAllUsers(); foreach ($db->selectObjects('calendar_reminder_address', 'calendar_id=' . $object->id . ' and user_id != 0') as $address) { $locuser = user::getUserById($address->user_id); $defaults[$locuser->id] = $locuser->firstname . ' ' . $locuser->lastname . ' (' . $locuser->username . ')'; } foreach ($users as $locuser) { if (!array_key_exists($locuser->id, $defaults)) { $userlist[$locuser->id] = $locuser->firstname . ' ' . $locuser->lastname . ' (' . $locuser->username . ')'; } } $form->register('users', gt('Users'), new listbuildercontrol($defaults, $userlist)); // Get Group list $defaults = array(); $grouplist = array(); $groups = group::getAllGroups(); if ($groups != null) { foreach ($db->selectObjects('calendar_reminder_address', 'calendar_id=' . $object->id . ' and group_id != 0') as $address) { $group = group::getGroupById($address->group_id); $defaults[$group->id] = $group->name; } foreach ($groups as $group) { if (!array_key_exists($group->id, $defaults)) { $grouplist[$group->id] = $group->name; } } $form->register('groups', gt('Groups'), new listbuildercontrol($defaults, $grouplist)); } // Get Freeform list $defaults = array(); foreach ($db->selectObjects('calendar_reminder_address', 'calendar_id=' . $object->id . " and email != ''") as $address) { $defaults[$address->email] = $address->email; } $form->register('addresses', gt('Other Addresses'), new listbuildercontrol($defaults, null)); $form->register('email_title_reminder', gt('Message Subject Prefix'), new textcontrol($object->email_title_reminder, 45)); $form->register('email_from_reminder', gt('From (Display)'), new textcontrol($object->email_from_reminder, 45)); $form->register('email_address_reminder', gt('From (Email)'), new textcontrol($object->email_address_reminder, 45)); $form->register('email_reply_reminder', gt('Reply-to'), new textcontrol($object->email_reply_reminder, 45)); $form->register('email_showdetail', gt('Show detail in message?'), new checkboxcontrol($object->email_showdetail)); $form->register('email_signature', gt('Email Signature'), new texteditorcontrol($object->email_signature, 5, 30)); $form->register(null, '', new htmlcontrol('<h3>' . gt('Merge Calendars') . '</h3><hr size="1" />')); $form->register('aggregate', gt('Pull Events from These Other Calendars'), new listbuildercontrol($selected_calendars, $all_calendars)); $form->register(null, '', new htmlcontrol('<h3>' . gt('RSS/iCalendar Configuration') . '</h3><hr size="1" />')); $form->register('enable_rss', gt('Enable RSS'), new checkboxcontrol($object->enable_rss)); $form->register('enable_ical', gt('Enable iCalendar'), new checkboxcontrol($object->enable_ical)); $form->register('feed_title', gt('Title for this RSS feed'), new textcontrol($object->feed_title, 35, false, 75)); $form->register('feed_desc', gt('Description for this RSS feed'), new texteditorcontrol($object->feed_desc)); $form->register('rss_cachetime', gt('Recommended RSS/iCal feed update interval in minutes (1440 = 1 day)'), new textcontrol($object->rss_cachetime)); $form->register('rss_limit', gt('Maximum days of RSS/iCal items to publish (0 = all)'), new textcontrol($object->rss_limit)); // $form->register(null,'',new htmlcontrol('<h3>'.gt('Tagging').'</h3><hr size="1" />')); // $form->register('enable_tags',gt('Enable Tags'), new checkboxcontrol($object->enable_tags)); // $form->register('collections',gt('Tag Collections'),new listbuildercontrol($object->collections,$tc_list)); // $form->register('group_by_tags',gt('Filter events by tags'), new checkboxcontrol($object->group_by_tags)); // $form->register(null,'',new htmlcontrol(gt('Tags to show'))); // $form->register('show_tags','',new listbuildercontrol($object->show_tags,$available_tags)); $form->register('submit', '', new buttongroupcontrol(gt('Save'), '', gt('Cancel'))); return $form; }
// } // format and send email $subject = $config->email_title_reminder . " - {$title}"; $from_addr = $config->email_address_reminder; $headers = array("From" => $from = $config->email_from_reminder, "Reply-to" => $reply = $config->email_reply_reminder); // set up the html message $template->assign("showdetail", $config->email_showdetail); $htmlmsg = $template->render(); // now the same thing for the text message $msg = chop(strip_tags(str_replace(array("<br />", "<br>", "br/>"), "\n", $htmlmsg))); // Saved. do notifs $notifs = unserialize($config->reminder_notify); $emails = array(); foreach ($db->selectObjects('calendar_reminder_address', "calendar_id='" . $config->id . "'") as $c) { if ($c->user_id != 0) { $u = user::getUserById($c->user_id); $emails[] = $u->email; } else { if ($c->group_id != 0) { $grpusers = group::getUsersInGroup($c->group_id); foreach ($grpusers as $u) { $emails[] = $u->email; } } else { if ($c->email != '') { $emails[] = $c->email; } } } } if (empty($emails)) {
public function do_showMessages() { $u_id = intval($this->input['u_id']); $id = intval($this->input['id']); $user_ = new user(); $info = $user_->getUserById($u_id); $info = $info[0]; $to_name = $info['username']; include_once ROOT_PATH . 'lib/messages/messages.class.php'; $mMessages = new messages(); $mm = $mMessages->get_one_msg($id); $mm = $mm[0]; $key = array_keys($mm); $salt_str = $key[0]; $user_info = $this->user; $messages = $mm[$salt_str]; ob_start(); include hg_load_template("user_dialog"); $html = ob_get_contents(); ob_end_clean(); echo $html . '[[[------------]]]' . $salt_str . '[[[------------]]]' . $to_name; }
function onrec_info() { if ($this->user['admin'] == 1) { include ROOT_PATH . 'lib/class/status.class.php'; include ROOT_PATH . 'lib/user/user.class.php'; include_once ROOT_PATH . 'lib/func/functions.php'; $id = getgpc('id', 'P'); $r = getgpc('r', 'P'); if ($r == 0) { //如果为再次请求cms,不要获取 ini_set("soap.wsdl_cache_enabled", "0"); $objSoapClient = new SoapClient($this->gSoapConfig['wsdl_url']); $columns = $objSoapClient->fetch_column_data($this->gSoapConfig['u'], $this->gSoapConfig['p']); //取栏目 $xml = simplexml_load_string($columns, 'SimpleXMLElement', LIBXML_NOCDATA); //print_r($xml); $arr = $xml->node; $xmlArr = array(); $str = ''; $j = 0; foreach ($arr as $key => $value) { $find[intval($value->columnid)] = $j++; if ($value->fatherid == -1) { $xmlArr[0][(string) $value->columnid] = (string) $value->columnname; } else { $pre = ''; for ($i = 0; $i < intval($value->depth); $i++) { $pre .= ' -'; } if ($pre) { $pre .= ' '; } $ffs = explode(',', (string) $value->colparents); if (count($ffs) == 2) { $ffid = $value->fatherid; } else { $combination = array((string) $value->columnid, (string) $value->fatherid); $diff = array_diff($ffs, $combination); $ffid = $diff[2]; } $xmlArr[1][(string) $ffid]['a' . (string) $value->columnid] = $pre . (string) $value->columnname; } } $return['soap'] = $xmlArr; } //获得用户信息 $user = new user(); $userInfo = $user->getUserById($id); $userInfo = $userInfo[0]; $return['username'] = $userInfo['username']; $return['id'] = $userInfo['id']; $return['avatar'] = $userInfo['middle_avatar']; $return['img'] = $userInfo['larger_avatar']; $status = new status(); //获得用户最后一条微博的信息 $blog = $status->show($userInfo['last_status_id']); $blog = $blog[0]; $return['blog'] = $blog['text']; echo json_encode($return); } else { echo "没有权限"; } }