本文整理汇总了PHP中access::type方法的典型用法代码示例。如果您正苦于以下问题:PHP access::type方法的具体用法?PHP access::type怎么用?PHP access::type使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类access
的用法示例。
在下文中一共展示了access::type方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: time
}
// hent siste besøkende
$expire = time() - 604800;
// 1 uke
$last_visitors_limit = 7;
$last_visitors = \Kofradia\DB::get()->query("\n\tSELECT up_id, up_name, up_access_level, time\n\tFROM users_views JOIN users_players ON up_id = uv_visitor_up_id\n\tWHERE uv_up_id = {$player->id} AND time > {$expire}\n\tORDER BY time DESC LIMIT {$last_visitors_limit}");
$last_visitor_anon = $player->data['up_profile_anon_time'] && $player->data['up_profile_anon_time'] > $expire ? $player->data['up_profile_anon_time'] : false;
// sett opp navnet
$name = htmlspecialchars($player->data['up_name']);
// drept?
if ($player->data['up_access_level'] == 0 && $player->data['up_deactivated_dead'] != 0) {
$name .= ' <span class="c_deactivated">[Død]</span>';
} else {
$types = access::types($player->data['up_access_level']);
if (!in_array("none", $types)) {
$type = access::type($player->data['up_access_level']);
$type_name = access::name($type);
$class = access::html_class($type);
$name .= ' <span class="' . $class . '">[' . htmlspecialchars($type_name) . ']</span>';
}
}
// finn ut rankplassering denne timen
$result = \Kofradia\DB::get()->query("\n\tSELECT COUNT(ref.uhi_up_id)+1, SUM(users_hits.uhi_points)\n\tFROM users_hits LEFT JOIN users_hits ref ON ref.uhi_points > users_hits.uhi_points AND ref.uhi_secs_hour = users_hits.uhi_secs_hour\n\tWHERE users_hits.uhi_secs_hour = " . login::get_secs_hour() . " AND users_hits.uhi_up_id = {$player->id}\n\tGROUP BY users_hits.uhi_secs_hour, users_hits.uhi_up_id");
$row = $result->fetch(\PDO::FETCH_NUM);
$rank_hour_pos = $row ? $row[1] == 0 ? 'Ingen' : '#' . game::format_number($row[0]) : 'Ingen';
// pengerank
$result = \Kofradia\DB::get()->query("SELECT COUNT(up_id)+1 FROM users_players WHERE up_cash+up_bank > CAST({$player->data['up_cash']} AS UNSIGNED)+CAST({$player->data['up_bank']} AS UNSIGNED) AND up_access_level < {$_game['access_noplay']} AND up_access_level != 0");
$pengeplassering = $result->fetchColumn(0);
$pengerank = "Ubetydelig";
if ($pengeplassering == 1) {
$pengerank = $_game['cash_ranks'][0];
示例2: main
public static function main()
{
echo '
<p class="minside_toplinks sublinks">
' . page_min_side::link('<img src="' . STATIC_LINK . '/icon/information.png" alt="" />Info', "") . '
' . page_min_side::link('<img src="' . STATIC_LINK . '/icon/money.png" alt="" />Pluss-tjenester', "pluss") . '
' . page_min_side::link('<img src="' . STATIC_LINK . '/icon/group.png" alt="" />Vervede', "vervede") . (page_min_side::$active_own || access::has("mod") ? '
' . page_min_side::link('<img src="' . STATIC_LINK . '/icon/computer.png" alt="" />Økter', "ses") . '
' . page_min_side::link('<img src="' . STATIC_LINK . '/icon/asterisk_orange.png" alt="" />Innstillinger', "set") : '');
if (page_min_side::$active_user->active && (page_min_side::$active_own || access::has("mod"))) {
echo '
' . page_min_side::link('<img src="' . STATIC_LINK . '/icon/delete.png" alt="" />Deaktiver', "deact");
}
if (access::has("crewet")) {
echo '
' . page_min_side::link('<img src="' . STATIC_LINK . '/icon/key.png" alt="" />Crew', "crew");
}
// spesielle tilganger?
$access = "";
if (page_min_side::$active_user->data['u_access_level'] != 0 && page_min_side::$active_user->data['u_access_level'] != 1) {
$type = access::type(page_min_side::$active_user->data['u_access_level']);
$type_name = access::name($type);
if (!empty($type_name)) {
$class = access::html_class($type);
$access .= '<span class="' . $class . '">' . htmlspecialchars($type_name) . '</span>';
}
}
ess::$b->page->add_css('
.minside_access {
text-align: center;
font-size: 15px;
margin: 1em 0;
}
');
echo '
</p>
<div id="page_user_info" class="user">' . (page_min_side::$active_own ? '' : '
<h1>' . htmlspecialchars(page_min_side::$active_user->data['u_email']) . ' (#' . page_min_side::$active_user->id . ')' . (page_min_side::$active_user->data['u_access_level'] != 0 ? '' : '<br />(deaktivert ' . ess::$b->date->get(page_min_side::$active_user->data['u_deactivated_time'])->format(date::FORMAT_NOTIME) . ')') . '<br />
' . page_min_side::$active_player->profile_link() . ' (#' . page_min_side::$active_player->id . ')</h1>') . ($access != "" ? '
<div class="minside_access">' . $access . '</div>' : '');
// informasjon
if (page_min_side::$subpage == "") {
self::page_default();
} elseif (page_min_side::$subpage == "pluss") {
self::page_pluss();
} elseif (page_min_side::$subpage == "vervede") {
self::page_vervede();
} elseif (page_min_side::$subpage == "ses" && (page_min_side::$active_own || access::has("mod"))) {
self::page_ses();
} elseif (page_min_side::$subpage == "set" && (page_min_side::$active_own || access::has("mod"))) {
self::page_set();
} elseif (page_min_side::$subpage == "crewlog" && access::has("crewet", NULL, NULL, "login")) {
self::page_crewlog();
} elseif (page_min_side::$subpage == "deact" && access::has("mod")) {
self::page_deact_mod();
} elseif (page_min_side::$subpage == "cdeact" && access::has("mod")) {
self::page_cdeact();
} elseif (page_min_side::$subpage == "deact" && page_min_side::$active_own) {
self::page_deact();
} elseif (page_min_side::$subpage == "activate" && access::has("mod")) {
self::page_activate();
} elseif (page_min_side::$subpage == "crew" && access::has("crewet", NULL, NULL, "login")) {
self::page_crew();
} elseif (page_min_side::$subpage == "up" && (page_min_side::$active_own || access::is_nostat())) {
self::page_up();
} else {
redirect::handle(page_min_side::addr(""));
}
echo '
</div>';
}
示例3: while
<th>Brukernivå</th>
<th>Spillernivå</th>
<th>Sist pålogget</th>
</tr>
</thead>
<tbody>';
while ($row = $result->fetch()) {
// spesielle tilganger?
$u_access = "Ukjent";
$type = access::type($row['u_access_level']);
$type_name = access::name($type);
if (!empty($type_name)) {
$u_access = htmlspecialchars($type_name);
}
$up_access = "Ukjent";
$type = access::type($row['up_access_level']);
$type_name = access::name($type);
if (!empty($type_name)) {
$up_access = htmlspecialchars($type_name);
}
echo '
<tr' . ($admin ? ' class="box_handle"' : '') . '>
<td>' . ($admin ? '<input type="radio" name="up_id" value="' . $row['up_id'] . '" />' : '') . $row['u_id'] . '</td>
<td>' . $row['up_id'] . '</td>
<td>' . game::profile_link($row['up_id'], $row['up_name'], $row['up_access_level']) . '</td>
<td>' . $row['u_access_level'] . ' (' . $u_access . ')</td>
<td>' . $row['up_access_level'] . ' (' . $up_access . ')</td>
<td>' . ess::$b->date->get($row['up_last_online'])->format() . '</td>
</tr>';
}
echo '
示例4: htmlspecialchars
$ff[] = $row;
}
// profilbildet
$profile_image = player::get_profile_image_static($player['up_profile_image_url']);
// ranken
$rank = game::rank_info($player['up_points'], $player['upr_rank_pos'], $player['up_access_level']);
#$rank_name = $rank['name'];
// statusen
$status = "";
// drept?
if ($player['up_access_level'] == 0 && $player['up_deactivated_dead'] != 0) {
$status = '<span class="c_deactivated">[Død]</span>';
} else {
$types = access::types($player['up_access_level']);
if (!in_array("none", $types)) {
$type = access::type($player['up_access_level']);
$type_name = access::name($type);
$class = access::html_class($type);
$status = '<span class="' . $class . '">[' . htmlspecialchars($type_name) . ']</span>';
}
// nostat?
if ($player['up_access_level'] >= ess::$g['access_noplay'] && $player['up_access_level'] != ess::$g['access']['nostat'][0]) {
if ($status != "") {
$status .= " ";
}
$status .= '[nostat]';
}
}
// kontakt og blokkering
$is_contact = -1;
$is_block = -1;
示例5: profile_link
public static function profile_link($up_id = false, $name = "", $access_level = 1, $link = true, $linkurl = NULL)
{
global $__server;
if ($name === "") {
if (!login::$logged_in) {
return "anonym";
}
$up_id = login::$user->player->id;
$name = login::$user->player->data['up_name'];
$access_level = login::$user->player->data['up_access_level'];
}
$at = access::type($access_level);
$color_class = access::html_class($at);
$name_f = ($format = access::html_format($at)) ? str_replace("%user", htmlspecialchars($name), $format) : htmlspecialchars($name);
$icons = '';
$icons_right = '';
$contacts = login::$logged_in ? login::$info['contacts'] : false;
if ($contacts) {
if ($up_id == login::$user->player->id) {
$icons .= '<img src="' . STATIC_LINK . '/other/myself_contact_small.gif" alt="(meg selv)" title="Deg selv" />';
} elseif (isset($contacts[1][$up_id])) {
$icons .= '<img src="' . STATIC_LINK . '/other/user_small.gif" alt="(kontakt)" title="Din kontakt" />';
}
if (isset($contacts[2][$up_id])) {
$icons .= '<img src="' . STATIC_LINK . '/other/block.png" alt="(blokkert)" title="Blokkert" />';
}
}
// deaktivert?
if ($access_level == 0) {
$icons_right .= '<img src="' . STATIC_LINK . '/other/kors_lite.png" alt="(deaktivert)" title="Deaktivert" class="deactivated" />';
}
// link
if ($link) {
$p = "";
if (!$linkurl) {
$linkurl = $__server['relative_path'] . '/p/' . rawurlencode($name) . '/' . $up_id;
$p = ' title="Vis profil"';
}
return '<a href="' . $linkurl . '"' . $p . ' rel="' . $up_id . '" class="profile_link' . ($color_class ? ' ' . $color_class : '') . '">' . $icons . '<span>' . $name_f . '</span>' . $icons_right . '</a>';
}
// tekst
return '<span rel="' . $up_id . '" class="profile_link' . ($color_class ? ' ' . $color_class : '') . '">' . $icons . '<span>' . $name_f . '</span>' . $icons_right . '</span>';
}
示例6: getAccessName
public function getAccessName()
{
return \access::name(\access::type(\login::$user->player->data['up_access_level']));
}
示例7: parse_html
$result = \Kofradia\DB::get()->query("\n\tSELECT\n\t\tusers_players.*,\n\t\tupr_rank_pos,\n\t\tusers.*,\n\t\tup_cash + up_bank AS money\n\tFROM\n\t\tusers_players\n\t\tLEFT JOIN users_players_rank ON upr_up_id = up_id,\n\t\tusers\n\tWHERE up_id = " . login::$user->player->id . " AND up_u_id = u_id\n\tGROUP BY up_id");
// fant ikke?
if ($result->rowCount() == 0) {
ajax::text("ERROR:NO-USER", ajax::TYPE_404);
}
// les info
$user = $result->fetch();
// profilbilde
$profile_image = parse_html(player::get_profile_image_static($user['up_profile_image_url']));
// ranken
$rank = game::rank_info($user['up_points'], $user['upr_rank_pos'], $user['up_access_level']);
// statusen
$status = "";
$types = access::types($user['up_access_level']);
if (!in_array("none", $types)) {
$type = access::type($user['up_access_level']);
$type_name = access::name($type);
$class = access::html_class($type);
$status = '<span class="' . $class . '">[' . htmlspecialchars($type_name) . ']</span>';
}
// bydel
$bydel = game::$bydeler[$user['up_b_id']];
$health = $user['up_health'] / $user['up_health_max'] * 100;
$energy = $user['up_energy'] / $user['up_energy_max'] * 100;
// xml
ajax::xml('<userinfo u_id="' . $user['u_id'] . '">
<u_id>' . $user['u_id'] . '</u_id>
<u_reg_time_abs>' . htmlspecialchars($_base->date->get($user['u_created_time'])->format(date::FORMAT_SEC)) . '</u_reg_time_abs>
<u_reg_time_rel>' . htmlspecialchars(game::timespan($user['u_created_time'], game::TIME_ABS)) . '</u_reg_time_rel>
<u_last_online_abs>' . htmlspecialchars($_base->date->get($user['u_online_time'])->format(date::FORMAT_SEC)) . '</u_last_online_abs>
<u_last_online_rel>' . htmlspecialchars(game::timespan($user['u_online_time'], game::TIME_ABS)) . '</u_last_online_rel>
示例8: c_crewstatus
/** Hent når crewmedlemmene sist var logget inn */
public function c_crewstatus()
{
global $_game;
$result = \Kofradia\DB::get()->query("SELECT up_id, up_name, up_access_level, up_last_online FROM users_players WHERE up_access_level != 0 AND up_access_level != 1 ORDER BY up_last_online DESC");
$this->send_output("Sist pålogget for Crewet:");
while ($row = $result->fetch()) {
if ($row['up_name'] == "SYSTEM" || $row['up_name'] == "beta") {
continue;
}
$type = access::type($row['up_access_level']);
$name = isset($_game['access_names'][$type]) ? '%c14 (' . $_game['access_names'][$type] . ')' : '';
$this->send_output("%c7%b%b{$row['up_name']}:%c6 " . game::timespan($row['up_last_online'], game::TIME_NOBOLD | game::TIME_ABS) . $name);
}
}