本文整理汇总了PHP中game::profile_link方法的典型用法代码示例。如果您正苦于以下问题:PHP game::profile_link方法的具体用法?PHP game::profile_link怎么用?PHP game::profile_link使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类game
的用法示例。
在下文中一共展示了game::profile_link方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: action_bestranker
/**
* Hent beste ranker siste 24 timer
*/
public function action_bestranker()
{
$stats = new \Kofradia\Users\Stats();
$players = $stats->getBestRankers();
if (count($players) == 0) {
return \Kofradia\View::forgeTwig('users/login/helpers/best_ranker', array("player" => null));
}
$player = reset($players);
return \Kofradia\View::forgeTwig('users/login/helpers/best_ranker', array("player" => $player, "img" => \player::get_profile_image_static($player['up_profile_image_url']), "rank" => new \Kofradia\Game\Player\Rank($player['up_points'], $player['upr_rank_pos'], $player['up_access_level']), "profile_link" => \game::profile_link($player['up_id'], $player['up_name'], $player['up_access_level'])));
}
示例2: visliste
function visliste($name, $where)
{
global $_base;
$result = \Kofradia\DB::get()->query("SELECT up_id, up_name, up_access_level, up_last_online FROM users_players WHERE {$where} ORDER BY up_name");
// hopp over hvis det ikke finnes noen
if ($result->rowCount() == 0) {
return;
}
echo '
<h2 class="bg1">' . $name . '<span class="left2"></span><span class="right2"></span></h2>
<div class="bg1">
<dl class="dd_right">';
while ($row = $result->fetch()) {
echo '
<dt>' . game::profile_link($row['up_id'], $row['up_name'], $row['up_access_level']) . '</dt>
<dd>' . game::timespan($row['up_last_online'], game::TIME_ABS | game::TIME_NOBOLD) . '</dd>';
}
echo '
</dl>
</div>';
}
示例3: show_stats_users
protected static function show_stats_users($players, $id, &$reply_users, $last_online)
{
if (!isset($players[$id])) {
return '
<tr>
<td colspan="3">Ingen brukere.</td>
</tr>';
}
$i = 0;
$ret = '';
foreach ($players[$id] as $player) {
$ant = array_key_exists($player['up_id'], $reply_users) ? $reply_users[$player['up_id']] : 0;
unset($reply_users[$player['up_id']]);
$ret .= '
<tr' . (++$i % 2 == 0 ? ' class="color"' : '') . '>
<td>' . game::profile_link($player['up_id'], $player['up_name'], $player['up_access_level']) . '</td>
<td class="r">' . game::format_number($ant) . '</td>
<td class="r">' . game::timespan($last_online[$player['up_id']], game::TIME_ABS) . '</td>
</tr>';
}
return $ret;
}
示例4: solve_player
/**
* Behandle ny spiller
*/
protected function solve_player()
{
ess::$b->page->add_title("Ny spiller");
redirect::store($_SERVER['REQUEST_URI']);
// sjekk om vi allerede har en spiller fra før som ikke er den aktive
$result = \Kofradia\DB::get()->query("SELECT up_id, up_name, up_created_time, up_last_online, up_access_level FROM users_players WHERE up_u_id = " . login::$user->id . " AND up_access_level != 0");
if ($result->rowCount() > 0) {
// sett opp liste over spillere
$players = array();
while ($row = $result->fetch()) {
$players[$row['up_id']] = $row;
}
// velge aktiv spiller?
if (isset($_POST['select']) && isset($_POST['up_id']) && validate_sid()) {
$up_id = (int) $_POST['up_id'];
if (!isset($players[$up_id])) {
ess::$b->page->add_message("Fant ikke spillere.", "error");
redirect::handle();
}
// sett som aktiv spiller
\Kofradia\DB::get()->exec("UPDATE users SET u_active_up_id = {$up_id} WHERE u_id = " . login::$user->id);
ess::$b->page->add_message('Du har valgt <user="' . $players[$up_id]['up_name'] . '" /> som din aktive spiller.');
redirect::handle("min_side");
}
echo '
<div class="bg1_c xmedium">
<h1 class="bg1">Ny spiller<span class="left2"></span><span class="right2"></span></h1>
<p class="h_left"><a href="' . htmlspecialchars($this->url) . '">Tilbake</a></p>
<div class="bg1">
<form action="" method="post">
<input type="hidden" name="sid" value="' . login::$info['ses_id'] . '" />
<p>Du har allerede en annen spiller som er i live. Du må enten deaktivere spilleren eller velge å bruke den som din aktive spiller.</p>
<table class="table center">
<thead>
<tr>
<th>ID</th>
<th>Spiller</th>
<th>Opprettet</th>
<th>Sist aktiv</th>
<th>Deaktiver</th>
</tr>
</head>
<tbody>';
foreach ($players as $row) {
echo '
<tr class="box_handle">
<td><input type="radio" name="up_id" value="' . $row['up_id'] . '" />' . $row['up_id'] . '</td>
<td>' . game::profile_link($row['up_id'], $row['up_name'], $row['up_access_level']) . '</td>
<td>' . ess::$b->date->get($row['up_created_time'])->format() . '</td>
<td>' . ess::$b->date->get($row['up_last_online'])->format() . '</td>
<td><a href="min_side?up_id=' . $row['up_id'] . '&a=deact">Deaktiver</a></td>
</tr>';
}
echo '
</tbody>
</table>
<p class="c">' . show_sbutton("Velg som aktiv spiller", 'name="select"') . '</p>
</form>
</div>
</div>';
ess::$b->page->load();
}
// opprette ny spiller?
if (isset($_POST['name']) && !isset($_POST['abort']) && validate_sid()) {
$name = trim($_POST['name']);
$bydel = postval("bydel");
if (!isset(game::$bydeler[$bydel]) || !game::$bydeler[$bydel]['active']) {
$bydel = false;
}
// kontroller navnet
$result1 = \Kofradia\DB::get()->query("SELECT " . \Kofradia\DB::quoteNoNull($name) . " REGEXP regex AS m, error FROM regex_checks WHERE (type = 'reg_user_special' OR type = 'reg_user_strength') HAVING m = 1");
$where = ALLOW_SAME_PLAYERNAME ? " AND (up_u_id != " . login::$user->id . " OR up_access_level != 0)" : "";
$result2 = \Kofradia\DB::get()->query("SELECT up_id FROM users_players WHERE up_name = " . \Kofradia\DB::quote($name) . $where);
$result3 = \Kofradia\DB::get()->query("SELECT id FROM registration WHERE user = " . \Kofradia\DB::quote($name));
// ugyldig navn?
if ($result1->rowCount() > 0) {
$feil = array();
while ($row = $result1->fetch()) {
$feil[] = '<li>' . htmlspecialchars($row['error']) . '</li>';
}
ess::$b->page->add_message("Spillernavnet var ikke gyldig:<ul>" . implode("", $feil) . "</ul>", "error");
} elseif (empty($name)) {
ess::$b->page->add_message("Du må skrive inn et navn du ønsker at din nye spiller skal ha.", "error");
} elseif ($result2->rowCount() > 0) {
ess::$b->page->add_message("Spillernavnet er allerede tatt! Velg et annet.", "error");
} elseif ($result3->rowCount() > 0) {
ess::$b->page->add_message("Noen holder allerede på å registrere seg med dette spillernavnet. Velg et annet.", "error");
} else {
// godkjent?
if (isset($_POST['confirm'])) {
// finne tilfeldig bydel?
if (!$bydel) {
// finn en tilfeldig bydel
$result = \Kofradia\DB::get()->query("SELECT id FROM bydeler WHERE active = 1 ORDER BY RAND()");
$bydel = $result->fetchColumn(0);
}
\Kofradia\DB::get()->beginTransaction();
//.........这里部分代码省略.........
示例5: js
protected function js()
{
// mottakere
$list = array();
foreach ($this->receivers as $row) {
$list[] = array($row['up_id'], $row['up_name'], game::profile_link($row['up_id'], $row['up_name'], $row['up_access_level']));
}
// hent javascript filen til innboksen
ess::$b->page->add_js_file(ess::$s['relative_path'] . "/js/innboks.js");
// javascript
ess::$b->page->add_js_domready('
innboks_ny.receivers = ' . js_encode($list) . ';
innboks_ny.limit = ' . $this->receivers_limit . ';
innboks_ny.init();');
}
示例6: foreach
<?php
$i = 0;
foreach ($contacts as $contact) {
?>
<tr class="box_handle<?php
echo ++$i % 2 == 0 ? ' color' : '';
?>
">
<td><input type="checkbox" name="id[]" rel="id_<?php
echo $type;
?>
" value="<?php
echo $contact->data['uc_id'];
?>
" /><?php
echo \game::profile_link($contact->data['uc_contact_up_id'], $contact->data['up_name'], $contact->data['up_access_level']);
?>
</td>
<td class="r"><?php
echo \game::timespan($contact->data['up_last_online'], game::TIME_ABS);
?>
</td>
<td class="r"><?php
echo \ess::$b->date->get($contact->data['uc_time'])->format(date::FORMAT_NOTIME);
?>
</td>
<td><?php
echo empty($contact->data['uc_info']) ? '<span class="dark">Ingen info</span>' : \game::bb_to_html($contact->data['uc_info']);
?>
</td>
<td><a href="kontakter/edit/<?php
示例7: while
.f_lock { color: #FFFFFF }
.f_u a span { color: #FFFFFF; text-decoration: none }
.f_u a:hover span { text-decoration: underline }
.f_time { color: #AAAAAA }
.f_deld { color: #FFF; font-size: 11px }');
// vis hver topic
$i = 0;
while ($row = $result->fetch()) {
echo '
<tr' . (++$i % 2 == 0 ? ' class="color"' : '') . '>
<td><a href="forum?id=' . $row['ft_fse_id'] . '">' . htmlspecialchars($sections[$row['ft_fse_id']]['name']) . '</a></td>
<td class="l' . ($row['ft_type'] == 3 ? ' f_viktig' : ($row['ft_type'] == 2 ? ' f_sticky' : '')) . '"><a href="topic?id=' . $row['ft_id'] . '">' . htmlspecialchars($row['ft_title']) . '</a>' . ($row['ft_type'] == 3 ? ' <span class="info">(Viktig)</span>' : ($row['ft_type'] == 2 ? ' <span class="info">(Sticky)</span>' : '')) . ($row['ft_locked'] == 1 ? ' <span class="f_lock">(låst)</span>' : '') . ($row['ft_deleted'] != 0 ? ' <span class="f_deld">(Slettet)</span>' : '') . '</td>
<td class="f_u">' . game::profile_link($row['ft_up_id'], $row['up_name'], $row['up_access_level']) . '<br /><span class="f_time">' . $_base->date->get($row['ft_time'])->format() . '</span></td>
<td>' . game::format_number($row['ft_replies']) . '</td>
<td>' . game::format_number($row['ft_views']) . '</td>
<td class="f_u">' . ($row['fr_time'] ? game::profile_link($row['fr_up_id'], $row['r_up_name'], $row['r_up_access_level']) . '<br /><span class="f_time">' . game::timespan($row['fr_time'], game::TIME_ABS) . '</span>' : '<span style="color: #AAA">Ingen</span>') . '</td>
<td>' . ($row['tr_match_type'] == 'subject' ? 'Tittel' : ($row['tr_match_type'] == 'topic' ? 'Hoved' : '<a href="topic?id=' . $row['ft_id'] . '&replyid=' . $row['tr_fr_id'] . '">Svar »</a>')) . '</td>
</tr>';
}
echo '
</tbody>
</table>';
// flere sider?
if ($pagei->pages > 1) {
echo '
<p class="c">' . $pagei->pagenumbers() . '</p>';
}
}
echo '
</div>
</div>';
示例8: parse_html
/**
* Rette på HTML før output.
*
* @param string $content
* @return string
*/
function parse_html($content)
{
global $__server;
// fikse noen <user="" /> ?
$matches = false;
if (preg_match_all("/(<user=\"([0-9a-zA-Z\\-_ ]+)\"( nolink)? \\/>|<user id=\"([0-9]+)\"( nolink)? \\/>)/", $content, $matches)) {
$users = array();
$ids = array();
// sett opp brukernavn liste
foreach ($matches[2] as $user) {
if (!empty($user)) {
if (!in_array($user, $users)) {
$users[] = $user;
}
}
}
// sett opp ID liste
foreach ($matches[4] as $id) {
if (!empty($id)) {
if (!in_array($id, $ids)) {
$ids[] = $id;
}
}
}
// fant gyldige treff
if (count($users) > 0 || count($ids) > 0) {
global $_base;
$q = array();
// brukernavn
if (count($users) > 0) {
$q[] = "\n\t\t\t\t\tSELECT up_id, up_name, up_access_level FROM (\n\t\t\t\t\t\tSELECT up_id, up_name, up_access_level\n\t\t\t\t\t\tFROM users_players\n\t\t\t\t\t\tWHERE up_name IN (" . implode(",", array_map(array($_base->db, "quote"), $users)) . ")\n\t\t\t\t\t\tORDER BY up_access_level = 0, up_last_online DESC\n\t\t\t\t\t) ref\n\t\t\t\t\tGROUP BY up_name";
}
// id
if (count($ids) > 0) {
$q[] = "SELECT up_id, up_name, up_access_level FROM users_players WHERE up_id IN (" . implode(",", array_unique(array_map("intval", $ids))) . ")";
}
// hent info og bytt om
$result = \Kofradia\DB::get()->query(implode(" UNION ", $q));
while ($row = $result->fetch()) {
$content = preg_replace('/(<user="' . preg_quote($row['up_name'], "/") . '" \\/>|<user id="' . $row['up_id'] . '" \\/>)/i', game::profile_link($row['up_id'], $row['up_name'], $row['up_access_level']), $content);
$content = preg_replace('/(<user="' . preg_quote($row['up_name'], "/") . '" nolink \\/>|<user id="' . $row['up_id'] . '" nolink \\/>)/i', game::profile_link($row['up_id'], $row['up_name'], $row['up_access_level'], false), $content);
}
}
// ordne de som ikke ble funnet
$content = preg_replace('~<user="([0-9a-zA-Z\\-_ ]+)"( nolink)? />~i', '<a href="' . $__server['relative_path'] . '/finn_spiller?finn=$1">$1 (ukjent spiller)</a>', $content);
$content = preg_replace('~<user id="([0-9]+)"( nolink)? />~i', '<a href="' . $__server['relative_path'] . '/finn_spiller">#$1 (ukjent spiller)</a>', $content);
}
// fikse noen <ff_link>id</ff_link> ?
$matches = false;
if (preg_match_all("~(<ff_link>([0-9]+)</ff_link>)~", $content, $matches)) {
$ids = array();
// sett opp ID liste
foreach ($matches[2] as $id) {
if (!in_array($id, $ids)) {
$ids[] = (int) $id;
}
}
// fant gyldige treff
if (count($ids) > 0) {
// hent info og bytt om
$result = \Kofradia\DB::get()->query("SELECT ff_id, ff_name, ff_inactive FROM ff WHERE ff_id IN (" . implode(",", $ids) . ")");
while ($row = $result->fetch()) {
$link = $row['ff_inactive'] && !access::has("mod") ? htmlspecialchars($row['ff_name']) : '<a href="' . ess::$s['relative_path'] . '/ff/?ff_id=' . $row['ff_id'] . '">' . htmlspecialchars($row['ff_name']) . '</a>';
$content = preg_replace('~(<ff_link>' . $row['ff_id'] . '</ff_link>)~', $link, $content);
}
}
// ordne de som ikke ble funnet
$content = preg_replace('~<ff_link>([0-9]+)</ff_link>~', '<span class="ff_unknown">ukjent firma/broderskap (#$1)</span>', $content);
}
// fiks entities
$content = str_replace(array("&rpath;", "&spath;", "&path;", "&staticlink;"), array(ess::$s['rpath'], ess::$s['spath'], ess::$s['path'], STATIC_LINK), $content);
return $content;
}
示例9: vis_spillere
/**
* Vis deaktiverte spillere
*/
protected static function vis_spillere()
{
global $__server;
ess::$b->page->add_title("Deaktiverte brukere");
// hente listen over brukere
$pagei = new pagei(pagei::PER_PAGE, 20, pagei::ACTIVE_GET, "side");
$result = $pagei->query("\n\t\t\tSELECT\n\t\t\t\tu_id, u_email, u_access_level, u_deactivated_time, u_deactivated_up_id, u_deactivated_reason, u_deactivated_note,\n\t\t\t\tup_id, up_name, up_access_level, up_deactivated_time, up_deactivated_up_id, up_deactivated_reason, up_deactivated_note\n\t\t\tFROM\n\t\t\t\tusers\n\t\t\t\tJOIN users_players ON u_id = up_u_id\n\t\t\tWHERE\n\t\t\t\tup_access_level = 0 AND (u_access_level != 0 OR u_deactivated_time != up_deactivated_time)\n\t\t\tORDER BY up_deactivated_time DESC");
echo '
<h1>Deaktiverte spillere</h1>
<p>Merk: Denne listen viser ikke spillere som har blitt deaktivert samtidig som brukeren ble deaktivert.</p>';
self::table_header();
while ($row = $result->fetch()) {
if ($row['u_access_level'] == 0) {
echo '
<tr>
<td>' . game::profile_link($row['up_id'], $row['up_name'], $row['up_access_level'], true, $__server['relative_path'] . '/min_side?up_id=' . $row['up_id']) . '</td>
<td class="nowrap r">' . ess::$b->date->get($row['up_deactivated_time'])->format() . '</td>
<td' . ($row['up_deactivated_up_id'] == $row['up_id'] ? ' class="pcd_self">Ja' : ' class="pcd_crew">Nei') . '</td>
<td>' . game::format_data($row['up_deactivated_reason']) . '</td>
</tr>';
}
}
self::table_footer($pagei);
}
示例10: profile_link
/**
* Returner profillenke
*/
public function profile_link($link = true, $linkurl = NULL)
{
return game::profile_link($this->id, $this->data['up_name'], $this->data['up_access_level'], $link, $linkurl);
}
示例11: template_topic_reply_preview
/**
* Lag HTML for forhåndsvisning av et forumsvar
* @param array $data
*
* $data må inneholde:
*
* ft_id
* fr_text
* fr_last_edit [optional]
* fr_last_edit_up_id [optional]
*
* fr_up_id
* up_name
* up_access_level
* up_points
* upr_rank_pos
* up_forum_signature
* up_profile_image_url
*
* fs_new [boolean, optional]
*/
public static function template_topic_reply_preview($data)
{
if (!\login::$logged_in) {
throw new \HSNotLoggedIn();
}
$date = \ess::$b->date->get();
// sett opp ranken
$rank = \game::rank_info($data['up_points'], $data['upr_rank_pos'], $data['up_access_level']);
$rank = $rank['name'];
$player_ff_position = '';
$html = '
<div class="forum_topic">
<h2 class="forum_title"><a href="topic?id=' . $data['ft_id'] . '" class="forum_permlink r4">#XX</a> - ' . $date->format(\date::FORMAT_NOTIME) . ' <b>' . $date->format("H:i:s") . '</b> - Av ' . \game::profile_link($data['fr_up_id'], $data['up_name'], $data['up_access_level']) . $player_ff_position . (isset($data['fs_new']) && $data['fs_new'] ? ' <span class="fs_new">(Ny)</span>' : '') . '</h2>
<p class="h_left"><a href="#default_header_wrap"><img src="' . STATIC_LINK . '/other/up.gif" title="Til toppen" /></a></p>
<p class="h_right" style="text-transform: uppercase; margin: -17px 10px 0 !important; color: #DDD">Forhåndsvisning</p>';
// profilbildet og rank
$img = '
<div class="forum_profile_image"><a href="' . \ess::$s['relative_path'] . '/p/' . $data['up_name'] . '/' . $data['fr_up_id'] . '"><img src="' . htmlspecialchars(\player::get_profile_image_static($data['up_profile_image_url'])) . '" class="profile_image" alt="" /><span class="forum_rank">' . $rank . '</span></a></div>';
// innlegget
$html .= '
<div class="forum_text">' . $img . '
' . \game::format_data($data['fr_text']) . '
</div>';
// signaturen
$signatur = false;
if (\login::$user->data['u_forum_show_signature']) {
$signatur = \game::format_data($data['up_forum_signature']);
}
if (!empty($signatur)) {
$html .= '
<div class="forum_signature">' . $signatur . '</div>';
}
// sist endret
if (!empty($data['fr_last_edit'])) {
$html .= '
<p class="forum_last_edit">Sist redigert av <user id="' . $data['fr_last_edit_up_id'] . '" /> ' . \ess::$b->date->get($data['fr_last_edit'])->format(\date::FORMAT_SEC) . '</p>';
}
$html .= '
</div>';
return $html;
}
示例12: generate_page
protected static function generate_page()
{
/*<div class="default_hidden" id="content"><a href="#top">Til toppen av siden</a></div>
<div class="default_hidden"><a href="#content">Til toppen av innholdet</a></div>*/
$extra_classes = '';
// vise juleheader?
$d = ess::$b->date->get();
if ($d->format("m") == 12) {
$extra_classes .= ' juleheader';
}
echo '<!DOCTYPE html>
<html lang="no">
<head>
<title>' . ess::$b->page->generate_title() . '</title>' . ess::$b->page->generate_head() . '</head>
<body class="' . self::$class_browser . self::$class_crew . (self::$locked ? ' is_lock' : '') . $extra_classes . '" id="default_th">' . ess::$b->page->body_start . '
<!--<div class="default_hidden print" id="top">
<h1><a href="' . ess::$s['absolute_path'] . '">kofradia.no</a></h1>
<p class="default_hidden"><a href="#content">Til innholdet</a></p>
</div>-->
<div id="default_header_wrap">
<div id="default_header_img"></div>
<div id="default_header">';
$boxes = theme_helper::get_extended_access_boxes();
if ($boxes) {
echo '
<div id="cboxes"' . (!access::has("mod") ? ' class="nocus"' : '') . '>';
foreach ($boxes as $box) {
echo '
<p class="box"><a href="' . $box[0] . '">' . $box[1] . '</a></p>';
}
echo '
</div>';
}
echo self::get_extended_access_login();
echo self::get_extended_access_links();
echo self::get_extended_access_search();
echo '
<p id="toplink"><a href="' . ess::$s['path'] . '/" title="Gå til forsiden"></a></p>
<p id="fb_link"><a href="http://www.facebook.com/kofradia" target="_blank"><span>Du finner oss på Facebook</span></a></p>';
//<p id="donate_link"><a href="'.ess::$s['relative_path'].'/donasjon" title="Doner »"><span>Donér »</span></a></p>';
$blog_links = self::get_blog_links();
if ($blog_links) {
echo '
<p id="blog_link">' . implode("<br />", $blog_links) . '</p>';
}
echo '
<ul id="default_topmenu">
<li><a href="' . ess::$s['relative_path'] . '/loggut?sid=' . login::$info['ses_id'] . '" onclick="return confirm(\'Er du sikker på at du vil logge ut?\\n\\nTips! Trykk Esc knappen tre ganger for å logge ut uten å måtte trykke på denne knappen!\')"><b>Logg ut</b></a></li>
<li><a href="' . ess::$s['relative_path'] . '/innboks">Meldinger</a></li>';
if (!self::$locked) {
echo '
<li><a href="' . ess::$s['relative_path'] . '/kontakter">Kontakter</a></li>
<li><a href="' . ess::$s['relative_path'] . '/finn_spiller">Finn spiller</a></li>';
}
echo '
<li><a href="' . ess::$s['relative_path'] . '/min_side?u&a=set">Innstillinger</a></li>';
if (!self::$locked) {
echo '
<li><a href="' . ess::$s['relative_path'] . '/irc/client/" target="_blank">Chat</a></li>';
}
echo '
</ul>
<div id="status_info"></div>
<p id="default_profilbilde">
<span id="default_profilbilde_wrap">
<a href="' . ess::$s['relative_path'] . '/min_side?' . (!login::$user->player->active ? "up_id=" . login::$user->player->id . '&' : '') . 'a=profil&b=profilbilde" class="profile_image_edit"><img src="/static/icon/image.png" /> endre</a>
<a href="' . ess::$s['relative_path'] . '/p/' . login::$user->player->data['up_name'] . '"><img src="' . htmlspecialchars(login::$user->player->get_profile_image()) . '" alt="Ditt profilbilde" class="profile_image" /></a>
</span>
</p>
<p id="default_playername">' . game::profile_link() . '</p>' . self::get_oppdrag_status() . '
</div>
<div id="default_header_subline">
<p id="server_klokka"><span>' . self::$date_now->format(date::FORMAT_WEEKDAY) . ' ' . self::$date_now->format(date::FORMAT_NOTIME) . ' - ' . self::$date_now->format("H:i:s") . '</span></p>
<div id="pm_new">' . (self::$num_pm > 0 ? '<p class="notification_box"><a href="' . ess::$s['relative_path'] . '/innboks"><b>' . self::$num_pm . ' ' . fword("ny</b> melding", "nye</b> meldinger", self::$num_pm) . '</a></p>' : '') . '</div>
<div id="log_new">' . (self::$num_log > 0 ? '<p class="notification_box"><a href="' . ess::$s['relative_path'] . '/min_side?log"><b>' . self::$num_log . ' ' . fword("ny</b> hendelse", "nye</b> hendelser", self::$num_log) . '</a></p>' : '') . '</div>';
if (login::$user->data['u_log_crew_new'] > 0 && isset(login::$extended_access)) {
echo '
<p class="notification_box"><a href="' . ess::$s['relative_path'] . '/min_side?u&a=crewlog"><b>' . login::$user->data['u_log_crew_new'] . '</b> ' . fword("ny hendelse som crew", "nye hendelser som crew", login::$user->data['u_log_crew_new']) . '</a></p>';
}
if (!self::$locked) {
echo '
<div id="def_ui2">
<p>' . login::$user->player->getRank()->getName() . '</p>
<p><span class="farge">Sted: </span> <span id="status_bydel">' . game::$bydeler[login::$user->player->data['up_b_id']]['name'] . '</span></p>
<p><span class="farge">Har ute</span> <span id="status_cash">' . game::format_cash(login::$user->player->data['up_cash']) . '</span></p>
<p><span class="farge">Plassering: </span> nr. <span id="status_rankpos">' . login::$user->player->data['upr_rank_pos'] . '</span></p>
</div>';
}
echo '
</div>
</div>
<div id="default_left">';
if (!login::$user->player->active) {
echo '
<div id="default_info_dead">
<a href="' . ess::$s['relative_path'] . '/lock?f=player">' . (login::$user->player->data['up_deactivated_dead'] == 2 ? '
<span>Din spiller blødde ihjel pga. lite energi.</span>' : (login::$user->player->data['up_deactivated_dead'] ? '
<span>Din spiller har blitt drept.</span>' : '
<span>Din spiller er deaktivert.</span>')) . '
//.........这里部分代码省略.........
示例13: handle_ret
/** Behandle respons */
public function handle_ret($id, $data = NULL)
{
switch ($id) {
case self::RET_INFO_DELETED_OWN:
echo '
<p class="info_box">Du viser en av dine egne meldinger som har blitt slettet.</p>';
break;
case self::RET_INFO_DELETED:
echo '
<p class="info_box">Denne meldingen tilhører ikke deg.</p>';
break;
case self::RET_INFO_REPORTED:
echo '
<p class="info_box">Du har tilgang til denne meldingstråden fordi den er eller har vært rapportert.</p>';
break;
case self::RET_ERROR_404:
ess::$b->page->add_message("Fant ikke meldingstråden.", "error");
redirect::handle("innboks");
break;
case self::RET_ERROR_CANNOT_REPLY:
ess::$b->page->add_message("Du kan ikke svare på denne meldingstråden.", "error");
redirect::handle();
break;
case self::RET_ERROR_NO_RECEIVERS:
ess::$b->page->add_message("Det er ingen mottakere du kan sende svar til.", "error");
redirect::handle();
break;
case self::RET_ERROR_BAN_CREW:
ess::$b->page->add_message("Du er blokkert fra å sende meldinger til andre enn Crewet. Du kan kun ha én mottaker. Blokkeringen varer til " . ess::$b->date->get($data['ub_time_expire'])->format(date::FORMAT_SEC) . ".<br /><b>Begrunnelse:</b> " . game::format_data($data['ub_reason'], "bb-opt", "Ingen begrunnelse gitt."), "error");
break;
case self::RET_ERROR_BAN:
ess::$b->page->add_message("Du er blokkert fra å sende meldinger til andre enn Crewet. Blokkeringen varer til " . ess::$b->date->get($data['ub_time_expire'])->format(date::FORMAT_SEC) . ".<br /><b>Begrunnelse:</b> " . game::format_data($data['ub_reason'], "bb-opt", "Ingen begrunnelse gitt."), "error");
break;
case self::RET_ERROR_BLOCKED:
foreach ($data as &$row) {
$row = game::profile_link($row['up_id'], $row['up_name'], $row['up_access_level']) . (($reason = game::bb_to_html($row['uc_info'])) == "" ? "" : ' - begrunnelse: ' . $reason);
}
ess::$b->page->add_message("Du kan ikke svare på denne meldingstråden fordi følgende brukere har blokkert deg:<ul><li>" . implode("</li><li>", $data) . "</li></ul>", "error");
break;
case self::RET_INFO_BLOCKED:
foreach ($data as &$row) {
$row = game::profile_link($row['up_id'], $row['up_name'], $row['up_access_level']) . (($reason = game::bb_to_html($row['uc_info'])) == "" ? "" : ' - begrunnelse: ' . $reason);
}
ess::$b->page->add_message("Følgende brukere har egentlig blokkert deg:<ul><li>" . implode("</li><li>", $data) . "</li></ul>");
break;
case self::RET_ERROR_WAIT:
global $__server;
ess::$b->page->add_message('Du må vente ' . game::counter($data) . ' før du kan sende en melding!', "error");
putlog("LOG", "%c13%bMELDING FORSØK%b%c: %u" . login::$user->player->data['up_name'] . "%u forsøkte å svare på en melding til it_id {$this->id} (%u{$this->data_thread['it_title']}%u). Må vente {$data} sekunder. {$__server['path']}/innboks_les?id={$this->id}");
break;
case self::RET_ERROR_CONTENT_SHORT:
ess::$b->page->add_message("Meldingen kan ikke inneholde færre enn 3 bokstaver/tall.", "error");
break;
case self::RET_ERROR_MARK_NO_REL:
ess::$b->page->add_message("Du har ikke mulighet til å markere denne meldingstråden da du ikke er en deltaker i den.", "error");
break;
case self::RET_INFO_MARK_ALREADY:
if ($this->data_rel['ir_marked']) {
ess::$b->page->add_message("Meldingstråden er allerede markert som merket.");
} else {
ess::$b->page->add_message("Meldingstråden er ikke merket fra før.");
}
break;
case self::RET_INFO_MARK_TRUE:
ess::$b->page->add_message("Meldingstråden er nå markert for oppfølging.");
break;
case self::RET_INFO_MARK_FALSE:
ess::$b->page->add_message("Meldingstråden er ikke lenger markert for oppfølging.");
break;
default:
throw new HSException("Ukjent behandler.");
}
}
示例14: format_data
public static function format_data($data, $type = "bb", $args = null)
{
global $_base;
switch ($type) {
case "bb":
case "signature":
// bb kode
return game::bb_to_html($data);
// bb-kode eller egendefinert tekst hvis bb-kode er tom
// bb-kode eller egendefinert tekst hvis bb-kode er tom
case "bb-opt":
$bb = trim(game::bb_to_html($data));
if ($bb == "") {
return $args;
}
return $bb;
case "music_pre":
return preg_replace('~\\[music\\](https?://.+?)\\[/music\\]~ieu', 'game::music_add(\'$1\')', $data);
case "music_post":
return game::music_replace($data);
case "profile":
$data = game::format_data($data, "music_pre");
// sett opp ranken
$rank = game::rank_info($args->data['up_points'], $args->data['upr_rank_pos'], $args->data['up_access_level']);
// diverse bb koder
$data = str_replace(array("[counter]", "[visits]", "[visitor]", "[rank]", "[bank]", "[cash]", "[money]", "[renter]", "[pm_ulest]", "[pengerank]"), array('<img src="&rpath;/counter?count=' . $args->data['up_profile_hits'] . '" alt="Antall visninger: ' . $args->data['up_profile_hits'] . '" />', $args->data['up_profile_hits'], game::profile_link(), $rank['orig'] ? $rank['orig'] : $rank['name'], game::format_cash($args->data['up_bank']), game::format_cash($args->data['up_cash']), game::format_cash($args->data['up_cash'] + $args->data['up_bank']), game::format_cash($args->data['up_interest_last']), game::format_number($args->user->data['u_inbox_new']), game::cash_name($args->data['up_cash'] + $args->data['up_bank'])), game::bb_to_html($data));
// rankbar
$type = false;
$match_rank = preg_match("~\\[rank_(neste_tid|neste_dato|tid|dato)\\]~iu", $data);
if (preg_match("~\\[rankbar( type=(1|2))?\\]~iu", $data, $type) || $match_rank) {
// høyeste rank?
if ($rank['need_points'] == 0) {
global $_game;
$prosent = $args->data['up_points'] / game::$ranks['items_number'][count(game::$ranks['items_number'])]['points'] * 100;
$rankbar_total = '
<div class="progressbar">
<div class="progress"><p>' . game::format_num($prosent, 3) . ' %</p></div>
</div>';
$rankbar_total2 = '
<div class="progressbar" style="margin-top: 1em">
<div class="progress"><p>' . game::format_num($prosent, 3) . ' %</p></div>
</div>';
$data = str_replace(array("[rankbar]", "[rankbar type=1]", "[rankbar type=2]", "[rank_tid]", "[rank_dato]", "[rank_neste_tid]", "[rank_neste_dato]"), array($rankbar_total . $rankbar_total2, $rankbar_total, $rankbar_total, "Oppnådd", "Oppnådd", "Oppnådd", "Oppnådd"), $data);
} else {
// i forhold til den høyeste ranken
global $_game;
// antall poeng for den høyeste ranken
$points_max = game::$ranks['items'];
end($points_max);
$points_max = current($points_max);
$points_max = $points_max['points'];
// hvor langt ifra er vi?
$percent_total = round($args->data['up_points'] / $points_max, 2) * 100;
#if ($percent_total > 100) $percent_total = 100;
if ($percent_total == 0) {
$percent_total = 0.01;
}
$rankbar_total = '
<div class="progressbar">
<div class="progress" style="width: ' . floor($percent_total) . '%"><p>' . game::format_num($percent_total, 2) . ' % i forhold til høyeste rank.</p></div>
</div>';
// i forhold til neste rank
$points_rank = $args->data['up_points'] - $rank['points'];
$percent = round($points_rank / $rank['need_points'] * 100, 2);
#if ($percent )
$rankbar_next = '
<div class="progressbar">
<div class="progress" style="width: ' . floor($percent) . '%"><p>' . game::format_num($percent, 2) . ' % i forhold til neste rank</p></div>
</div>';
$rankbar_next2 = '
<div class="progressbar" style="margin-top: 1em">
<div class="progress" style="width: ' . floor($percent) . '%"><p>' . game::format_num($percent, 2) . ' % i forhold til neste rank</p></div>
</div>';
// fiks bb kodene
$data = str_replace(array("[rankbar]", "[rankbar type=1]", "[rankbar type=2]"), array($rankbar_total . $rankbar_next2, $rankbar_total, $rankbar_next), $data);
// beregn antatt tid det tar å nå høyeste rank
if ($match_rank) {
// hent ut aktiviteten de siste X dagene
$expire = ess::$b->date->get();
$expire->modify("-21 days");
$expire = max($args->data['up_created_time'], $expire->format("U"));
// maks tid: siste 21 dager eller siden reg (om registrert innen 30 dager)
$result = \Kofradia\DB::get()->query("SELECT SUM(uhi_points) FROM users_hits WHERE uhi_up_id = {$args->id} AND uhi_secs_hour >= {$expire}");
$points = (int) $result->fetchColumn(0);
if ($points == 0) {
$data = str_replace(array("[rank_tid]", "[rank_dato]", "[rank_neste_tid]", "[rank_neste_dato]"), array("ukjent", "ukjent", "ukjent", "ukjent"), $data);
} else {
// antall sekunder poengene skal fordeles på
$time_elapsed = time() - $expire;
// beregn til neste rank og erstatt BB-kode
$need = $rank['points'] + $rank['need_points'] - $args->data['up_points'];
$time_left = $need / $points * $time_elapsed;
if ($time_left > 63072000) {
$text_left = "over 2 år";
$text_date = "om over 2 år";
} else {
$text_left = game::timespan($time_left);
$text_date = ess::$b->date->get($time_left + time())->format(date::FORMAT_NOTIME);
}
$data = str_replace(array("[rank_neste_tid]", "[rank_neste_dato]"), array($text_left, $text_date), $data);
//.........这里部分代码省略.........
示例15: show_beste_rankere
/**
* Vis beste rankere forrige periode
*/
protected function show_beste_rankere()
{
$d = ess::$b->date->get();
$a = $d->format("H") < 21 ? 2 : 1;
$d->modify("-{$a} day");
$d->setTime(21, 0, 0);
$date_from = $d->format("U");
$d->modify("+1 day");
$date_to = $d->format("U");
// hent statistikk
$result = \Kofradia\DB::get()->query("\n\t\t\tSELECT up_id, up_name, up_access_level, sum_uhi_points, up_points, up_last_online, up_profile_image_url, upr_rank_pos\n\t\t\tFROM\n\t\t\t\t(\n\t\t\t\t\tSELECT uhi_up_id, SUM(uhi_points) sum_uhi_points\n\t\t\t\t\tFROM users_hits\n\t\t\t\t\t\tJOIN users_players ON up_id = uhi_up_id AND (up_access_level != 0 OR up_deactivated_time < {$date_to}) AND up_access_level < " . ess::$g['access_noplay'] . "\n\t\t\t\t\tWHERE uhi_secs_hour >= {$date_from} AND uhi_secs_hour < {$date_to}\n\t\t\t\t\tGROUP BY uhi_up_id\n\t\t\t\t\tHAVING sum_uhi_points > 0\n\t\t\t\t\tORDER BY sum_uhi_points DESC\n\t\t\t\t\tLIMIT 3\n\t\t\t\t) ref,\n\t\t\t\tusers_players\n\t\t\t\tLEFT JOIN users_players_rank ON upr_up_id = up_id\n\t\t\tWHERE uhi_up_id = up_id");
if ($result->rowCount() == 0) {
return;
}
$players = array();
$up_list = array();
while ($row = $result->fetch()) {
$players[] = $row;
$up_list[] = $row['up_id'];
}
// hent familier hvor spilleren er medlem
$result_ff = \Kofradia\DB::get()->query("\n\t\t\tSELECT ffm_up_id, ffm_priority, ff_id, ff_type, ff_name\n\t\t\tFROM\n\t\t\t\tff_members\n\t\t\t\tJOIN ff ON ff_id = ffm_ff_id AND ff_type = 1 AND ff_inactive = 0\n\t\t\tWHERE ffm_up_id IN (" . implode(",", $up_list) . ") AND ffm_status = " . ff_member::STATUS_MEMBER . "\n\t\t\tORDER BY ff_name");
$familier = array();
while ($row = $result_ff->fetch()) {
$pos = ff::$types[$row['ff_type']]['priority'][$row['ffm_priority']];
$text = '<a href="' . ess::$s['relative_path'] . '/ff/?ff_id=' . $row['ff_id'] . '" title="' . htmlspecialchars($pos) . '">' . htmlspecialchars($row['ff_name']) . '</a>';
$familier[$row['ffm_up_id']][] = $text;
}
$data = '
<p>Beste rankere siste periode</p>';
$e = 0;
foreach ($players as $row) {
$e++;
$img = player::get_profile_image_static($row['up_profile_image_url']);
$rank = game::rank_info($row['up_points'], $row['upr_rank_pos'], $row['up_access_level']);
$data .= '
<p class="ranklist_box">
<a href="' . ess::$s['relative_path'] . '/p/' . rawurlencode($row['up_name']) . '" title="Vis profil"><img src="' . htmlspecialchars($img) . '" alt="Profilbilde" class="profile_image" /></a>
<span class="ranklist_pos">#' . $e . '</span>
<span class="ranklist_player">
<span class="rp_up">' . game::profile_link($row['up_id'], $row['up_name'], $row['up_access_level']) . '</span><br />
<span class="rp_rank">' . $rank['name'] . '</span>
</span>
<span class="rp_familie">' . (!isset($familier[$row['up_id']]) ? '<i class="rp_no_familie">Ingen broderskap</i>' : implode(", ", $familier[$row['up_id']])) . '</span>
</p>';
if ($e == 15) {
break;
}
}
$data .= '
<p class="dark">En rankperiode er fra sist klokka var 21:00 og 24 timer før. De beste rankerene <a href="' . ess::$s['rpath'] . '/node/59">mottar bonus</a> for sin innsats.</p>';
$this->put_box($data);
}