本文整理汇总了PHP中Account::Load方法的典型用法代码示例。如果您正苦于以下问题:PHP Account::Load方法的具体用法?PHP Account::Load怎么用?PHP Account::Load使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Account
的用法示例。
在下文中一共展示了Account::Load方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct($row)
{
global $__server_time;
$this->id = (int) $row['id'];
$this->account_id = (int) $row['account_id'];
$this->account = Account::Load((int) $this->account_id);
$this->nickname = $row['nickname'];
$this->character = $row['character'];
$this->content = $row['content'];
$this->blog = (int) $row['blog'];
$this->timestamp = $row['timestamp'];
$this->override = (int) $row['override'];
$this->reply_to = (int) $row['reply_to'];
$this->reply_count = (int) $row['reply_count'];
$this->seconds_since = $__server_time - $this->timestamp;
$this->using_face = $row['using_face'];
$this->ParseContent();
}
示例2: elseif
$q = $__database->query("\nSELECT\n\taccount_id, content\nFROM\n\tsocial_statuses\nWHERE\n\tid = " . $statusid);
if ($q->num_rows == 0) {
?>
<center>
<p class="lead">Sorry, but this status is gone.</p>
</center>
<?php
} elseif (!$_loggedin) {
?>
<center>
<p class="lead">Sorry! You must be logged in to report this!</p>
</center>
<?php
} else {
$reportedstatus = $q->fetch_assoc();
$account = Account::Load(intval($reportedstatus['account_id']));
if ($_SERVER['REQUEST_METHOD'] == 'POST' && isset($_POST['status_report'])) {
$reporterusername = $_loginaccount->GetUsername();
$reportedusername = $account->GetUsername();
$to = 'support@mapler.me';
// subject
$subject = '[Report] Status (#' . $statusid . ') by @' . $reportedusername . '';
// message
$message = 'Hello Mapler.me Staff, the following status has been reported by the mapler @' . $reporterusername . '<br /><br />
' . $reportedstatus['content'] . '<br /><br/>Manage this report by <a href="http://mapler.me/report/status/' . $statusid . '">clicking here</a>.';
// To send HTML mail, the Content-type header must be set
$headers = 'MIME-Version: 1.0' . "\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\n";
$headers .= 'From: ' . $reporterusername . ' <report@mapler.me>' . "\n";
// Mail it
mail($to, $subject, $message, $headers);
示例3: NOW
<?php
$q = $__database->query("\r\nSELECT\r\n\t*,\r\n\tTIMESTAMPDIFF(SECOND, added_on, NOW()) AS `added_on_secs`,\r\n\tTIMESTAMPDIFF(SECOND, accepted_on, NOW()) AS `accepted_on_secs`\r\nFROM\r\n\tfriend_list\r\nWHERE\r\n\tfriend_id = " . $_loginaccount->GetId() . "\r\n\tAND\r\n\taccepted_on IS NULL\r\n\r\nORDER BY\r\n\tadded_on DESC\r\n");
if ($q->num_rows == 0) {
?>
<p class="lead alert-info alert">There are no friend requests pending.</p>
<?php
} else {
while ($row = $q->fetch_assoc()) {
$account = Account::Load($row['account_id']);
$main_char = $account->GetMainCharacterName();
if ($main_char === null) {
$image_url = '//' . $domain . '/inc/img/no-character.gif';
} else {
$image_url = '//' . $main_char['locale'] . '.' . $domain . '/ignavatar/' . $main_char['name'];
}
?>
<div class="status">
<div class="pull-left">
<img src="<?php
echo $image_url;
?>
" />
</div>
<h3 style="margin-top: 10px;"><a href="//<?php
echo $account->GetUsername();
?>
.<?php
echo $domain;
?>
/"><?php
示例4: Logging
if ($id != NULL) {
$account = Account::Load($id);
$account->SetAccountRank(RANK_BANNED);
$account->Save();
Logging('admin', $_loginaccount->GetUsername(), 'account_ban', 'Banned ' . $name . '.');
?>
<p class="alert-info alert fademeout">Successfully banned @<?php
echo $name;
?>
.<p>
<?php
}
} elseif (isset($_GET['ipban'])) {
$name = $_GET['ipban'];
$id = GetAccountID($name);
if ($id != NULL) {
$account = Account::Load($id);
$__database->query("\r\n\t\tINSERT IGNORE INTO\r\n\t\t\t`ip_ban`\r\n\t\tVALUES\r\n\t\t(\r\n\t\t\t'" . $account->GetLastIP() . "'\r\n\t\t)");
if ($__database->affected_rows == 1) {
// Send mail?
Logging('admin', $_loginaccount->GetUsername(), 'account_ipban', 'IP Banned ' . $name . '.');
?>
<p class="alert-info alert fademeout">Successfully IP banned @<?php
echo $name;
?>
.<p>
<?php
}
}
}
}
示例5: SetMaplerCookie
$row = $query->fetch_row();
if (!isset($_SESSION['username'])) {
$_SESSION['username'] = $row[0];
}
} else {
// Session expired.
SetMaplerCookie('login_session', '', -100);
}
$query->free();
}
// Initialize Login Data
$_loggedin = false;
if (strpos($_SERVER['REQUEST_URI'], '/logoff') === FALSE && isset($_SESSION['username'])) {
$username = $_SESSION['username'];
$_loggedin = true;
$_loginaccount = Account::Load($username);
if ($_loginaccount->GetAccountRank() >= RANK_DEVELOPER) {
error_reporting(E_ALL);
ini_set('display_errors', 1);
}
if (GetMaplerCookie('login_session') === null) {
$query = $__database->query("\r\nSELECT \r\n\tat.`code`\r\nFROM \r\n\taccount_tokens at\r\nWHERE\r\n\tat.account_id = " . $_loginaccount->GetID() . "\r\n\tAND\r\n\tat.type = 'login_token'\r\n\tAND \r\n\tat.till > NOW()\r\n");
$code = '';
if ($query->num_rows == 0) {
// Create new
$code = md5(time() . ' -- -- -- -- - ' . $_loginaccount->GetID() . ' - ' . $_loginaccount->GetUsername());
$__database->query("\r\nINSERT INTO \r\n\taccount_tokens \r\nVALUES \r\n\t(" . $_loginaccount->GetID() . ", 'login_token', '" . $code . "', DATE_ADD(NOW(), INTERVAL 10 YEAR))\r\nON DUPLICATE KEY UPDATE\r\n\t`code` = VALUES(`code`),\r\n\t`till` = VALUES(`till`)\r\n");
} else {
// Use old one
$row = $query->fetch_row();
$code = $row[0];
示例6: elseif
die;
} elseif ($status == 2 && !$_loggedin) {
// displays the same error as not found to not tell if exists or not.
?>
<center>
<img src="//<?php
echo $locale_domain;
?>
/inc/img/no-character.gif" />
<p>Character not found! The character may have been removed or hidden.</p>
</center>
<?php
require_once __DIR__ . '/../inc/footer.php';
die;
} else {
$account = Account::Load($character_info['account_id']);
$internal_id = $character_info['internal_id'];
$stat_addition = GetCorrectStat($internal_id, CURRENT_LOCALE);
$__is_viewing_self = $friend_status == 'FOREVER_ALONE';
$channelid = $character_info['channel_id'];
if ($channelid == -1) {
$channelid = 'Unknown';
} else {
$channelid++;
}
// 1 = 0
$__hidden_objects = array();
function IsHiddenObject($optionName, $no_override = false)
{
global $__char_db, $internal_id, $__hidden_objects, $_loggedin, $_loginaccount;
if ($_loggedin && !$no_override && $_loginaccount->IsRankOrHigher(RANK_MODERATOR)) {
示例7: foreach
from {
opacity:0;
}
to {
opacity: 1;
}
}
</style>
<center><h2>Our Team</h2></center>
<div class="row">
<?php
foreach ($cache as $row) {
$account = Account::Load($row['id']);
?>
<div class="character-brick clickable-brick span4 x" onclick="document.location = '//<?php
echo $row['name'];
?>
.<?php
echo $domain;
?>
'">
<center>
<br />
<img src="//mapler.me/avatar/<?php
echo $row['character'];
?>
"/><br/>
示例8: GetCharacterStatus
function GetCharacterStatus($id, $locale, $account = NULL)
{
global $__database;
$accountLoaded = $account !== NULL;
if (!$accountLoaded) {
$account = Account::Load(intval(GetCharacterAccountId($id, $locale)));
}
$name = GetCharacterName($id, $locale);
$value = $account->GetCharacterDisplayValue($name);
if (!$accountLoaded) {
// Clear data
unset($account);
}
return $value;
}