本文整理汇总了PHP中access::name方法的典型用法代码示例。如果您正苦于以下问题:PHP access::name方法的具体用法?PHP access::name怎么用?PHP access::name使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类access
的用法示例。
在下文中一共展示了access::name方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: access_name
/**
* Hente ut navn for tilgangsnivå
* Sjekker først i lokal array
* @param string $access_level tilgangsnavn (f.eks. admin)
* @return string tilgangstittel (f.eks. Administrator)
*/
public static function access_name($access_level)
{
// forsøk å hente fra denne klassen
if (isset(self::$access_levels_name[$access_level])) {
return self::$access_levels_name[$access_level];
}
// hent fra game klassen
return access::name($access_level);
}
示例2: 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];
} elseif ($pengeplassering <= 5) {
示例3: getAccessName
public function getAccessName()
{
return \access::name(\access::type(\login::$user->player->data['up_access_level']));
}
示例4: page_crew
//.........这里部分代码省略.........
<div class="bg1 crewlog">
' . implode('
', $items) . '
</div>
</div>';
}
echo '
<p class="c">' . $pagei->pagenumbers() . '</p>';
}
echo '
</div>';
} elseif ($subpage2 == "addlog" && access::has("forum_mod")) {
// legge til?
if (isset($_POST['notat'])) {
$notat = trim(postval("notat"));
$notat_bb = trim(game::bb_to_html($notat));
if (empty($notat_bb)) {
ess::$b->page->add_message("Notatet kan ikke være tomt.", "error");
} else {
// legg til i crewloggen
crewlog::log("user_add_note", page_min_side::$active_player->id, $notat);
ess::$b->page->add_message("Notatet ble registrert.");
redirect::handle(page_min_side::addr());
}
}
ess::$b->page->add_title("Nytt notat");
ess::$b->page->add_js_domready('$("notat_felt").focus();');
echo '
<div class="bg1_c">
<h1 class="bg1">Legg til notat i crewloggen<span class="left2"></span><span class="right2"></span></h1>
<div class="bg1">
<p>Notat: (Vil bli lagt til som vanlig logg i <a href="' . htmlspecialchars(page_min_side::addr(NULL)) . '">Crewloggen</a>.)</p>
<form action="" method="post">
<p><textarea name="notat" id="notat_felt" rows="10" cols="30" style="width: 98%; overflow: auto">' . htmlspecialchars(postval("notat")) . '</textarea></p>
<p>' . show_sbutton("Legg til notat") . '</p>
</form>
</div>
</div>';
} elseif ($subpage2 == "blokk") {
ess::$b->page->add_title("Blokkeringer");
$type = false;
if (isset($_GET['t'])) {
// kontroller type
$type_id = intval($_GET['t']);
// fant ikke?
if (!isset(blokkeringer::$types[$type_id])) {
ess::$b->page->add_message("Ugyldig type '.{$type_id}.'.", "error");
} else {
$type = blokkeringer::$types[$type_id];
// har vi tilgang til å gjøre noe med denne blokkeringen?
if (!access::has($type['access'])) {
ess::$b->page->add_message('Du har ikke tilgang til denne typen blokkering. (' . htmlspecialchars($type['title']) . ')', "error");
$type = false;
}
}
}
// vise en type blokkering?
if ($type) {
redirect::store(page_min_side::addr(NULL, "b=blokk&t={$type_id}"));
// sjekk om det er en aktiv blokkering for denne typen
$active = blokkeringer::check($type_id, page_min_side::$active_user->id);
if ($active) {
// hent informasjon om blokkeringen
$info = blokkeringer::get_info($active['ub_id']);
}
// handling: legg til blokkering
示例5: while
<tr>
<th>Type</th>
<th>Innsender</th>
<th>Tidspunkt</th>' . ($all ? '
<th>Resultat</th>' : '') . '
</tr>
</thead>
<tbody>';
$i = 0;
while ($row = $result->fetch()) {
$type = soknader::get_type($row['ds_type']);
$link = htmlspecialchars($type['title']);
if (access::has($type['access'])) {
$link = '<a href="soknader?ds_id=' . $row['ds_id'] . '" title="Vis søknad">' . $link . '</a>';
} else {
$link .= ' (' . access::name($type['access']) . ')';
}
echo '
<tr' . (++$i % 2 == 0 ? ' class="color"' : '') . '>
<td>' . $link . '</td>
<td><user id="' . $row['ds_up_id'] . '" /></td>
<td>' . $_base->date->get($row['ds_time'])->format() . '</td>' . ($all ? '
<td>' . ($row['ds_reply_decision'] == 1 ? 'Innvilget' : ($row['ds_reply_decision'] == -1 ? 'Avslått' : 'Under behandling')) . '</td>' : '') . '
</tr>';
}
echo '
</tbody>
</table>';
if ($pagei->pages > 1) {
echo '
<p class="c">' . $pagei->pagenumbers() . '</p>';