本文整理匯總了PHP中UserModel::userInfo方法的典型用法代碼示例。如果您正苦於以下問題:PHP UserModel::userInfo方法的具體用法?PHP UserModel::userInfo怎麽用?PHP UserModel::userInfo使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類UserModel
的用法示例。
在下文中一共展示了UserModel::userInfo方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: index
public function index()
{
$msg = new MsgModel();
$str = "";
$p = isset($_GET['p']) ? $_GET['p'] : 1;
$pageSize = 12;
$curPage = ($p - 1) * $pageSize;
$limit = $curPage . ',' . $pageSize;
$message = $msg->getMsg($limit);
if (isset($_SESSION['user'])) {
$mark = 1;
$user = new UserModel();
$uerinfo = $user->userInfo($_SESSION['user']);
$this->assign('info', $uerinfo);
} else {
$mark = 0;
}
$counts = $msg->msgCount();
if ($counts > $pageSize) {
$page = new Page($counts, $p, $pageSize);
$str = $page->show('themeuk.php');
}
$this->assign('page', $str);
$this->assign('msg', $message);
$this->assign('mark', $mark);
$this->display();
}
示例2: checkStatus
protected function checkStatus()
{
if (isset($_SESSION['user'])) {
$mark = 1;
$user = new UserModel();
$uerinfo = $user->userInfo($_SESSION['user']);
$this->assign('info', $uerinfo);
} else {
$mark = 0;
}
$this->assign('mark', $mark);
}
示例3: __construct
public function __construct($pathinfo, $controller)
{
$this->sitename = "OurCoders (我們程序員)";
$this->short_sitename = "OurCoders";
$this->pathinfo = $pathinfo;
parent::__construct($pathinfo, $controller);
$this->begintime = microtime(true);
$this->_layout = "index";
$this->cas[] = array('name' => 'index', 'title' => '首頁');
$this->cas[] = array('name' => 'app', 'title' => '應用列表');
$this->cas[] = array('name' => 'user', 'title' => '用戶');
$this->cas[] = array('name' => 'group', 'title' => '群組');
$mainMenu = $this->createMainMenu();
$title = $this->findTitle();
$this->_view->assign("sitename", $this->sitename);
$this->_view->assign("short_sitename", $this->short_sitename);
if ($title) {
$this->title = "{$title} - {$this->sitename}";
} else {
$this->title = "{$this->sitename}";
}
$controller = $this->_controller['name'];
if ($controller == 'index') {
$this->breadCrumb = '';
} else {
$this->breadCrumb = "<a href='/'>首頁</a>-><a href='/{$controller}/'>{$title}</a>";
}
$this->_view->assign('mainMenu', $mainMenu);
$this->_view->assign('title', $this->title);
$this->_view->assign('breadCrumb', $this->breadCrumb);
$controller = ucwords($this->_controller['name']);
$action = $this->_controller['action'];
$mainContentFile = "{$controller}/{$action}.html";
if (file_exists($this->_pathinfo['views'] . '/' . $mainContentFile)) {
$this->viewFile = $mainContentFile;
}
$this->_mainContent->assign("retUrl", $_SERVER['REQUEST_URI']);
$this->_view->assign("retUrl", $_SERVER['REQUEST_URI']);
$this->_view->assign("navsel", $controller);
$userModel = new UserModel();
$this->userid = $userModel->checklogin();
if ($this->userid) {
$this->username = $userModel->username($this->userid);
$this->isEmailValidated = $userModel->isEmailValidated($this->userid);
$userinfo = $userModel->userInfo($this->userid);
}
$toplinkadsModel = new ToplinkadsModel();
$toplink = $toplinkadsModel->toplink();
if ($toplink) {
$alerttype = array();
$alerttype[] = "alert-info";
$alerttype[] = "alert-success";
$alerttype[] = "";
$toplink["alert"] = $alerttype[rand(0, 2)];
}
$this->_view->assign("toplink", $toplink);
$this->_view->assign("userid", $this->userid);
$this->_view->assign("username", $this->username);
if (isset($this->isEmailValidated)) {
$this->_view->assign("isEmailValidated", $this->isEmailValidated);
}
if (isset($userinfo)) {
$this->_view->assign("userinfo", $userinfo);
}
$iPhone = ToolModel::is_iPhone();
$this->_view->assign("iPhone", $iPhone);
$this->_mainContent->assign("userid", $this->userid);
$this->_mainContent->assign("iPhone", $iPhone);
}
示例4: emailsettingAction
public function emailsettingAction()
{
if ($this->userid == 0) {
header("location: /user/login/");
die;
}
$userModel = new UserModel();
if ($_POST) {
if ($_POST["atnotify"] == 1) {
$emailatnotification = 1;
} else {
$emailatnotification = 0;
}
if ($_POST["dailynews"] == 1) {
$emaildailynotification = 1;
} else {
$emaildailynotification = 0;
}
if ($_POST["weeklynews"] == 1) {
$emailweeklynotification = 1;
} else {
$emailweeklynotification = 0;
}
$userModel->updateEmailSetting($this->userid, $emailatnotification, $emaildailynotification, $emailweeklynotification);
$this->_mainContent->assign("warnning", "設置成功更新");
}
$userInfo = $userModel->userInfo($this->userid);
$this->_mainContent->assign("emailatnotification", $userInfo["emailatnotification"]);
$this->_mainContent->assign("emaildailynotification", $userInfo["emaildailynotification"]);
$this->_mainContent->assign("emailweeklynotification", $userInfo["emailweeklynotification"]);
$this->display();
}
示例5: banuserAction
public function banuserAction()
{
$userModel = new UserModel();
$threadModel = new ThreadModel();
if ($_POST) {
$userid = $_POST["userid"];
if ($userid <= 0 || $userid == 2) {
header('HTTP/1.1 301 Moved Permanently');
header("location:/home/");
die;
}
$userModel->banUser($userid);
if ($_POST["delallthread"]) {
$threadModel->delUserAllThread($userid);
}
if ($_POST["delallreply"]) {
$threadModel->delUserAllReply($userid);
}
header('HTTP/1.1 301 Moved Permanently');
header("location:/user/show/{$userid}/");
die;
}
$id = $this->intVal(3);
if ($id == 0 || $id == 2 || $this->userid != 2) {
header('HTTP/1.1 301 Moved Permanently');
header("location:/home/");
}
$userinfo = $userModel->userInfo($id);
$userinfo["image"] = DiscuzModel::get_avatar($id, "middle");
$userinfo["threadscreate"] = $threadModel->threadsByUserid($id, 5);
$this->_mainContent->assign("user", $userinfo);
$this->display();
}
示例6: voteAction
public function voteAction()
{
if ($this->userid == 0) {
die("no_login");
}
$userModel = new UserModel();
$userInfo = $userModel->userInfo($this->userid);
$reputation = $userInfo["reputation"];
if ($reputation < 20) {
die("reputation_too_low");
}
$threadid = $_POST["threadid"];
$vote = $_POST["vote"];
$threadModel = new ThreadModel();
$result = $threadModel->vote($threadid, $this->userid, $vote);
echo json_encode($result);
}
示例7: replyNotify
public function replyNotify($data, $own = 1)
{
if ($own == 1) {
$thread = $this->threadById($data["threadid"]);
$userid = $thread["createbyid"];
if ($userid == $data["userid"]) {
return;
}
$userModel = new UserModel();
$user = $userModel->userInfo($userid);
$this->replyNotifyMailToOwner($user["username"], $user["email"], $data["name"], $data["content"], $thread["title"], $data["threadid"]);
} else {
$users = $this->getThreadUsers($data["threadid"]);
if (($key = array_search($data["userid"], $users)) !== false) {
unset($users[$key]);
}
if (count($users) == 0) {
return;
}
$usersStr = join(",", $users);
$sql = "SELECT `username`,`email` FROM `cocoabbs_uc_members` WHERE `uid` in ({$usersStr});";
$result = $this->fetchArray($sql);
$thread = $this->threadById($data["threadid"]);
foreach ($result as $user) {
$this->replyNotifyMail($user["username"], $user["email"], $data["name"], $data["content"], $thread["title"], $data["threadid"]);
}
}
}