本文整理汇总了PHP中session::Read方法的典型用法代码示例。如果您正苦于以下问题:PHP session::Read方法的具体用法?PHP session::Read怎么用?PHP session::Read使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类session
的用法示例。
在下文中一共展示了session::Read方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: GetRights
public static function GetRights()
{
$Rights = array();
$Group = mysql::FetchObject(mysql::Select('users', 'GroupID', 'ID="' . session::Read('userid') . '"'))->GroupID;
$Rights = mysql::FetchArray(mysql::Select('groups', '*', 'ID="' . $group . '"'));
return $Rights;
}
示例2: DisplayTopics
public static function DisplayTopics($TopicID)
{
mysql::Select('topics', '*', 'ID=' . $TopicID);
$views = mysql::FetchObject();
$newviews = $views->Views + 1;
$updates = array('Views' => $newviews);
mysql::Update('topics', $updates, 'ID = ' . $TopicID);
mysql::Select('posts', '*', 'TopicID=' . $TopicID, 'Date ASC');
$Objects = mysql::GetObjects();
$Return = '';
$i = 1;
foreach ($Objects as $Object) {
$Post = new template('post');
$Post->Assign(array('UserID' => $Object->UserID, 'UserName' => user::GetUsername($Object->UserID), 'Avatar' => new avatar(user::GetEmail($Object->UserID), '150'), 'ID' => $Object->ID, 'Text' => $Object->Text, 'Title' => $Object->PostTitle, 'PostNum' => $i, 'TopicID' => $TopicID));
if ($Object->UserID == session::Read('userid')) {
$Post->Assign(array('Edit' => '<a href="?page=Topic&TopicID=' . $TopicID . '">Edit this Post</a>'));
}
$Return .= $Post->Display(true);
$i++;
}
// Übergeordnetes Forum auslesen
mysql::Select('topics', 'ForumID, TopicTitle', 'ID=' . $TopicID, NULL, 1);
$Topic = mysql::FetchObject();
// Foren rückwärs bis zur höchsten Ebene auslesen und Crumbs erzeugen
self::GetCrumbs($Topic->ForumID);
// Neuen Crumb mit Titel und Link des Topics erzeugen
crumb::Add($Topic->TopicTitle, '?page=Topic&TopicID=' . $TopicID);
return $Return;
}
示例3: __construct
public function __construct()
{
$this->Infos['Title'] = Language::Get('com.sbb.page.login');
// If logged in, redirect to start page
if (isset($_COOKIE['sbb_Token']) || session::Read('UserID')) {
header("Location: index.php");
}
$Message = '';
if (isset($_POST['Login'])) {
if (Login::Check($_POST)) {
SBB::SQL()->Select('users', 'ID', 'Username = \'' . mysql_real_escape_string($_POST['Username']) . '\'', '', 1);
$UserID = SBB::SQL()->FetchObject()->ID;
User::Login($UserID, $_POST['StayLoggedIn']);
$Message = Language::Get('com.sbb.login.success');
header('Location: index.php');
} else {
$Message = '<b>' . Language::Get('com.sbb.error') . ':</b><ul><li>' . implode('</li><li>', Login::GetError()) . '</li></ul>';
}
}
SBB::Template()->Assign(array('Page' => 'Login', 'Message' => $Message));
}