本文整理汇总了PHP中game::cash_name方法的典型用法代码示例。如果您正苦于以下问题:PHP game::cash_name方法的具体用法?PHP game::cash_name怎么用?PHP game::cash_name使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类game
的用法示例。
在下文中一共展示了game::cash_name方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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);
//.........这里部分代码省略.........
示例2: fwords
<div class="psa2">' . ($player->data['up_last_online'] ? game::timespan($player->data['up_last_online'], game::TIME_ABS | game::TIME_FULL) : 'Aldri') . '</div>
</dd>
<dt>Rank</dt>
<dd>' . $player->getRank()->getName() . '</dd>
<dt>Prestasjonspoeng</dt>
<dd>' . game::format_num($player->data['up_achievements_points']) . '</dd>' . ($attacks == 0 ? '' : '
<dt>Utført <b>' . $attacks . '</b> angrep, hvorav ' . fwords("<b>%d</b> spiller", "<b>%d</b> spillere", $player->data['up_attack_killed_num'] + $player->data['up_attack_bleed_num']) . ' har blitt drept og ' . fwords("<b>%d</b> spiller", "<b>%d</b> spillere", $player->data['up_attack_damaged_num'] - $player->data['up_attack_bleed_num']) . ' har blitt skadet.</dt>') . '
</dl>
</div>
<div id="profileinfo_right">
<dl class="dd_right">
<dt>Pengenivå</dt>
<dd><a href="' . ess::$s['rpath'] . '/node/27">' . game::cash_name($player->data['up_cash'] + $player->data['up_bank']) . '</a></dd>
<dt>Pengerank</dt>
<dd><a href="' . ess::$s['rpath'] . '/node/27">' . $pengerank . '</a></dd>
<dd> </dd>
<dt>Wanted nivå</dt>
<dd>' . game::format_number($player->data['up_wanted_level'] / 10, 1) . ' %</dd>
<dd> </dd>
<dt>Plassering</dt>
<dd>' . game::format_number($player->data['upr_rank_pos']) . '. plass</dd>
<dt>Plassering denne timen</dt>
示例3: htmlspecialchars
<up_name_display>' . htmlspecialchars(game::profile_link($user['up_id'], $user['up_name'], $user['up_access_level'])) . '</up_name_display>
<up_reg_time_abs>' . htmlspecialchars($_base->date->get($user['up_created_time'])->format(date::FORMAT_SEC)) . '</up_reg_time_abs>
<up_reg_time_rel>' . htmlspecialchars(game::timespan($user['up_created_time'], game::TIME_ABS)) . '</up_reg_time_rel>
<up_status>' . htmlspecialchars($status) . '</up_status>
<up_last_online_abs>' . htmlspecialchars($_base->date->get($user['up_last_online'])->format(date::FORMAT_SEC)) . '</up_last_online_abs>
<up_last_online_rel>' . htmlspecialchars(game::timespan($user['up_last_online'], game::TIME_ABS)) . '</up_last_online_rel>
<up_activated>' . htmlspecialchars($user['up_access_level'] == 0 ? 0 : 1) . '</up_activated>
<up_profile_image>' . htmlspecialchars($profile_image) . '</up_profile_image>
<up_log_new>' . ($user['up_log_new'] + $user['up_log_ff_new']) . '</up_log_new>
<up_rank_name>' . htmlspecialchars($rank['name'] . ($rank['orig'] ? ' (' . $rank['orig'] . ')' : '')) . '</up_rank_name>
<up_rank_position>' . $user['upr_rank_pos'] . '</up_rank_position>
<up_hits>' . $user['up_hits'] . '</up_hits>
<up_cash>' . game::format_cash($user['up_cash']) . '</up_cash>
<up_bank>' . game::format_cash($user['up_bank']) . '</up_bank>
<up_money>' . game::format_cash($user['money']) . '</up_money>
<up_money_title>' . game::cash_name($user['money']) . '</up_money_title>
<up_last_interest>' . game::format_cash($user['up_interest_last']) . '</up_last_interest>
<up_bydel_latitude>' . htmlspecialchars($bydel['latitude']) . '</up_bydel_latitude>
<up_bydel_longitude>' . htmlspecialchars($bydel['longitude']) . '</up_bydel_longitude>
<up_bydel_id>' . htmlspecialchars($bydel['id']) . '</up_bydel_id>
<up_bydel_name>' . htmlspecialchars($bydel['name']) . '</up_bydel_name>
<up_health>' . ($health == 100 ? '100' : sprintf("%.2f", $health)) . '</up_health>
<up_energy>' . ($energy == 100 ? '100' : sprintf("%.2f", $energy)) . '</up_energy>
<up_protection>' . (!$user['up_protection_id'] ? 'null' : ($user['up_protection_state'] == 1 ? '100' : sprintf("%.2f", $user['up_protection_state'] * 100))) . '</up_protection>
<up_rank>' . sprintf("%.3f", login::$user->player->rank['need_points'] == 0 ? $user['up_points'] / login::$user->player->rank['points'] * 100 : ($user['up_points'] - login::$user->player->rank['points']) / login::$user->player->rank['need_points'] * 100) . ':' . $user['up_points'] . '</up_rank>
<up_wanted>' . ($user['up_wanted_level'] == 0 ? '0' : sprintf("%.1f", $user['up_wanted_level'] / 10, 1)) . '</up_wanted>
</player>
<game>
<poker_active>' . cache::fetch("poker_active", 0) . '</poker_active>
<auksjoner_active>' . game::auksjoner_active_count() . '</auksjoner_active>
<fengsel_count>' . game::fengsel_count() . '</fengsel_count>