当前位置: 首页>>代码示例>>PHP>>正文


PHP game::address方法代码示例

本文整理汇总了PHP中game::address方法的典型用法代码示例。如果您正苦于以下问题:PHP game::address方法的具体用法?PHP game::address怎么用?PHP game::address使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在game的用法示例。


在下文中一共展示了game::address方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: addr

 /**
  * Generer adresse
  */
 protected function addr($exclude = null, $add = null, $path = null, $get = null)
 {
     $get_default = $path ? array() : $_GET;
     if ($this->show_deleted) {
         $get['u_id'] = $this->inbox->u->id;
     }
     return game::address($path ?: "innboks", $get ?: $get_default, $exclude ?: array(), $add ?: array());
 }
开发者ID:Kuzat,项目名称:kofradia,代码行数:11,代码来源:innboks.php

示例2: show_link

 function show_link()
 {
     $ret = array();
     for ($i = 0; $i < func_num_args(); $i++) {
         $arg = func_get_arg($i);
         if (!$this->exists($arg)) {
             trigger_error("Fant ikke elementet med ID {$arg}!", E_USER_ERROR);
         }
         $type = $this->types[$this->elms[$arg]['type']];
         // aktiv?
         $active = $this->active == $arg ? 1 : 0;
         $ret[] = '<a href="' . htmlspecialchars(game::address($this->address, $_GET, array($this->sort_name), array($this->sort_name => $arg))) . '" class="op50"><img src="' . $type[$active] . '" alt="' . htmlspecialchars($this->elms[$arg]['title']) . '" /></a>';
         #if ($active == 1) return end($ret);
     }
     return implode("", $ret);
 }
开发者ID:Kuzat,项目名称:kofradia,代码行数:16,代码来源:class.sorts.php

示例3: while

					<th>Når</th>
					<th>Plassering</th>
					<th>Premie</th>
					<th>Vinnerlodd</th>
					<th>Solgte lodd</th>
					<th>Spillere</th>
				</tr>
			</thead>
			<tbody>';
    $i = 0;
    while ($row = $result->fetch()) {
        $end = ceil(($row['time'] - 900) / 1800) * 1800 + 900;
        echo '
				<tr' . (++$i % 2 == 0 ? ' class="color"' : '') . '>
					<td class="c">' . $_base->date->get($end)->format() . '<br /><span style="color: #888888">(' . $_base->date->get($row['time'])->format() . ')</a></td>
					<td class="r">' . ($row['type'] == 1 ? '<b>' . $row['type'] . '. plass</b>' : $row['type'] . '. plass') . '</td>
					<td class="r">' . game::format_cash($row['won']) . '</td>
					<td class="c">' . game::format_number($row['l_id']) . '</td>
					<td class="c">' . game::format_number($row['total_lodd']) . '</td>
					<td class="c">' . game::format_number($row['total_users']) . '</td>
				</tr>';
    }
    echo '
			</tbody>
		</table>
		<p class="c">' . $pagei->pagenumbers(game::address("lotto_vinn", $_GET, array("side")) . "#lotto_vinn", game::address("lotto_vinn", $_GET, array("side"), array("side" => "_pageid_")) . "#lotto_vinn") . '</p>';
}
echo '
	</div>
</div>';
$_base->page->load();
开发者ID:Kuzat,项目名称:kofradia,代码行数:31,代码来源:lotto_vinn.php

示例4: elseif

        $player = player::get($row['up_id']);
    }
} elseif (isset($_GET['id'])) {
    $up_id = (int) $_GET['id'];
    $result = \Kofradia\DB::get()->query("SELECT up_id, up_name FROM users_players WHERE up_id = {$up_id}");
    $row = $result->fetch();
    if (!$row) {
        ess::$b->page->add_message("Fant ikke spilleren.", "error");
        redirect::handle("finn_spiller", redirect::ROOT);
    }
    // send til korrekt side
    $address = game::address("/p/" . rawurlencode($row['up_name']) . "/{$row['up_id']}", $_GET, array("id"));
    redirect::handle($address, redirect::ROOT);
} elseif (isset($_GET['user'])) {
    // send til korrekt side
    $address = game::address("/p/" . rawurlencode($_GET['user']), $_GET, array("user"));
    redirect::handle($address, redirect::ROOT);
} else {
    ess::$b->page->add_message("Manglet brukeridentifikasjon.", "error");
    redirect::handle("finn_spiller", redirect::ROOT);
}
ess::$b->page->add_title($player->data['up_name']);
// moderasjon
if (access::has("crewet", NULL, NULL, true)) {
    // javascript
    ess::$b->page->add_js_domready('
	new KeySequence("esc,M,esc", function()
	{
		navigateTo(relative_path+"/min_side?up_id=' . $player->id . '&a=crew");
	});');
}
开发者ID:Kuzat,项目名称:kofradia,代码行数:31,代码来源:profil.php

示例5: show

    /**
     * Vis fengsel
     */
    protected function show()
    {
        // er vi i fengsel nå?
        if ($wait = $this->up->fengsel_wait()) {
            ess::$b->page->add_js_domready('$("fengsel_dusor").focus();');
            echo '
<div class="bg1_c xsmall">
	<h1 class="bg1">Du er i fengsel<span class="left"></span><span class="right"></span></h1>
	<p class="h_right"><a href="node/16">Hjelp</a></p>
	<div class="bg1">
		<p>Du befinner deg for øyeblikket i fengsel og slipper ut om ' . game::counter($wait, true) . '.</p>' . (!$this->up->is_nostat() ? '
		<form action="" method="post">
			<input type="hidden" name="sid" value="' . login::$info['ses_id'] . '" />
			<input type="hidden" name="expire" value="' . $this->up->data['up_fengsel_time'] . '" />
			<dl class="dd_right">
				<dt>Dusør for å bryte deg ut</dt>
				<dd><input type="text" class="styled w80" name="amount" id="fengsel_dusor" value="' . game::format_cash($this->up->data['up_fengsel_dusor']) . '" /></dd>
			</dl>
			<p class="c">' . show_sbutton($this->up->data['up_fengsel_dusor'] > 0 ? "Endre dusør" : "Sett dusør", 'name="dusor"') . '</p>
			<p class="c">Spilleren som bryter ut mottar kun ' . self::DUSOR_PROFIT * 100 . ' % av dusøren.</p>
		</form>' : '') . '
	</div>
</div>';
        }
        // sortering
        $sort = new sorts("sort");
        $sort->append("asc", "Spiller", "up_name");
        $sort->append("desc", "Spiller", "up_name DESC");
        $sort->append("asc", "Wanted nivå", "up_wanted_level, up_fengsel_time DESC");
        $sort->append("desc", "Wanted nivå", "up_wanted_level DESC, up_fengsel_time DESC");
        $sort->append("asc", "Tid igjen", "up_fengsel_time");
        $sort->append("desc", "Tid igjen", "up_fengsel_time DESC");
        $sort->set_active(requestval("sort"), 5);
        // hent folk i fengsel
        $sort_info = $sort->active();
        $pagei = new pagei(pagei::ACTIVE_GET, "side", pagei::PER_PAGE, 15);
        $result = $pagei->query("\n\t\t\tSELECT up_id, up_name, up_access_level, up_fengsel_time, up_fengsel_num, up_fengsel_dusor, ROUND(up_fengsel_dusor * " . self::DUSOR_PROFIT . ") up_fengsel_dusor_get, up_wanted_level\n\t\t\tFROM users_players\n\t\t\tWHERE up_fengsel_time > " . time() . " AND up_access_level != 0\n\t\t\tORDER BY {$sort_info['params']}");
        $num = $result->rowCount();
        echo '
<div class="bg1_c ' . ($num == 0 ? 'xsmall' : 'xlarge') . '">
	<h1 class="bg1">Fengsel<span class="left"></span><span class="right"></span></h1>
	<p class="h_right"><a href="node/16">Hjelp</a></p>
	<div class="bg1">
		<form action="" method="post">
			<p class="c dark">Ditt wanted nivå er på ' . game::format_number($this->up->data['up_wanted_level'] / 10, 1) . ' %.</p>';
        if ($num == 0) {
            echo '
			<p class="c dark">Ingen er i fengselet for øyeblikket.</p>
			<p class="c"><a href="' . htmlspecialchars(game::address("fengsel", $_GET)) . '" class="button">Oppdater</a></p>';
        } else {
            echo '
			<table class="table center" width="100%">
				<thead>
					<tr>
						<th>Spiller ' . $sort->show_link(0, 1) . '</th>
						<th>Wanted<br />nivå ' . $sort->show_link(2, 3) . '</th>
						<th>Utbrytning<br />sannsynlighet</th>
						<th>Ca. poeng</th>
						<th>Dusør</th>
						<th>Tid igjen ' . $sort->show_link(4, 5) . '</th>
					</tr>
				</thead>
				<tbody>';
            $i = 0;
            while ($row = $result->fetch()) {
                $prefix = "";
                $attr = new attr("class");
                if (++$i % 2 == 0) {
                    $attr->add("color");
                }
                if (!$this->up->fengsel_check()) {
                    $attr->add("box_handle");
                    $prefix = '<input type="radio" name="up_id" value="' . $row['up_id'] . '_' . $row['up_fengsel_time'] . '_' . $row['up_fengsel_dusor'] . '" /> ';
                }
                $time = $row['up_fengsel_time'] - time();
                $prob = self::calc_prob($time, $row['up_wanted_level'] / 10);
                $points = self::calc_points($prob);
                echo '
					<tr' . $attr->build() . '>
						<td>' . $prefix . game::profile_link($row['up_id'], $row['up_name'], $row['up_access_level']) . '</td>
						<td class="c">' . game::format_number($row['up_wanted_level'] / 10, 1) . ' %</td>
						<td class="c">' . game::format_number($prob, 1) . ' %</td>
						<td class="c">' . game::format_num($points) . '</td>
						<td class="r nowrap">' . game::format_cash($row['up_fengsel_dusor_get']) . '</td>
						<td class="r">' . game::counter($time) . '</td>
					</tr>';
            }
            echo '
				</tbody>
			</table>
			<p class="c">' . (($wait = $this->up->fengsel_wait()) == 0 ? '
				' . show_sbutton("Bryt ut", 'name="brytut"') : '
				Du er i fengsel og slipper ut om ' . game::counter($wait, true) . '.
			</p>
			<p class="c">') . '
				<a href="' . htmlspecialchars(game::address("fengsel", $_GET)) . '" class="button">Oppdater</a>
			</p>';
//.........这里部分代码省略.........
开发者ID:Kuzat,项目名称:kofradia,代码行数:101,代码来源:fengsel.php

示例6: sorts

// sortering
$sort = new sorts("sort");
$sort->append("asc", "Avsender", "up_name, im_time DESC");
$sort->append("desc", "Avsender", "up_name DESC, im_time DESC");
$sort->append("asc", "Emne", "it_title, im_time DESC");
$sort->append("desc", "Emne", "it_title DESC, im_time DESC");
$sort->append("asc", "Innhold", "id_text");
$sort->append("desc", "Innhold", "id_text DESC");
$sort->append("asc", "Dato", "im_time");
$sort->append("desc", "Dato", "im_time DESC");
$sort->set_active(postval("sort"), 7);
// søkeform
echo '
<h1>Søk - Meldinger</h1>
<p class="h_right"><a href="' . htmlspecialchars(game::address("innboks", $_GET)) . '">Tilbake</a></p>
<form action="' . htmlspecialchars(game::address(PHP_SELF, $_GET, array("alle", "innboks", "utboks", "side"))) . '" method="post">
	<div class="section" style="width: 410px; margin-left: auto; margin-right: auto">
		<h2>Søk</h2>
		<dl class="dl_20 dl_2x">
			<dt>Tittel</dt>
			<dd><input type="text" name="title" value="' . htmlspecialchars(postval("title")) . '" class="styled w150" /></dd>
			
			<dt>Innhold</dt>
			<dd><input type="text" name="text" value="' . htmlspecialchars(postval("text")) . '" class="styled w300" /></dd>
			
			<dt>Av?</dt>
			<dd>';
$i = 0;
foreach ($search_from as $key => $item) {
    if (++$i == count($search_from)) {
        break;
开发者ID:Kuzat,项目名称:kofradia,代码行数:31,代码来源:innboks_sok.php

示例7: show


//.........这里部分代码省略.........
						<dd><input type="text" name="ta_ut" id="bank_ta_ut" class="styled w100" value="0" /></dd>
					</dl>
					<p class="c">' . show_sbutton("Ta ut") . '</p>
				</form>
			</div>
		</div>
		<div class="clear"></div>
	</div>
</div>

<div class="bg1_c large" style="margin-top: 40px">
	<h1 class="bg1">Oversikt<span class="left"></span><span class="right"></span></h1>
	<div class="bg1" style="padding: 0 15px">
		<!-- sendte penger -->
		<div style="width: 50%; margin-left: -5px; float: left">
			<h2 class="bg1">Sendte penger<span class="left2"></span><span class="right2"></span></h2>
			<div class="bg1">';
        // sideinformasjon - hent sendte overføringer
        $pagei = new pagei(pagei::ACTIVE_GET, "side_sendte", pagei::PER_PAGE, 8, pagei::TOTAL, $this->up->data['up_bank_num_sent']);
        $result = \Kofradia\DB::get()->query("SELECT bl_receiver_up_id, amount, time FROM bank_log WHERE bl_sender_up_id = " . $this->up->id . " ORDER BY time DESC LIMIT {$pagei->start}, {$pagei->per_page}");
        if ($result->rowCount() == 0) {
            echo '
				<p>
					Ingen sendte overføringer.
				</p>';
        } else {
            echo '
				<table class="table tablemt" width="100%">
					<thead>
						<tr>
							<th>Mottaker</th>
							<th>Beløp</th>
							<th>Tidspunkt</th>
						</tr>
					</thead>
					<tbody>';
            $i = 0;
            while ($row = $result->fetch()) {
                $date = ess::$b->date->get($row['time']);
                echo '
						<tr' . (++$i % 2 == 0 ? ' class="color"' : '') . '>
							<td><user id="' . $row['bl_receiver_up_id'] . '" /></td>
							<td class="r">' . game::format_cash($row['amount']) . '</td>
							<td class="c" style="font-size: 10px">' . $date->format(date::FORMAT_NOTIME) . '<br />' . $date->format("H:i:s") . '</td>
						</tr>';
            }
            echo '
					</tbody>
				</table>
				<p class="c">' . $pagei->pagenumbers(game::address("banken", $_GET, array("side_sendte")) . "#sendte", game::address("banken", $_GET, array("side_sendte"), array("side_sendte" => "_pageid_")) . "#sendte") . '</p>';
        }
        echo '
			</div>
		</div>
		
		<!-- mottatte penger -->
		<div style="width: 50%; margin-right: -5px; float: right">
			<h2 class="bg1">Mottatte penger<span class="left2"></span><span class="right2"></span></h2>
			<div class="bg1">';
        // sideinformasjon - hent mottatte overføringer
        $pagei = new pagei(pagei::ACTIVE_GET, "side_mottatte", pagei::PER_PAGE, 8, pagei::TOTAL, $this->up->data['up_bank_num_received']);
        $result = \Kofradia\DB::get()->query("SELECT bl_sender_up_id, amount, time FROM bank_log WHERE bl_receiver_up_id = " . $this->up->id . " ORDER BY time DESC LIMIT {$pagei->start}, {$pagei->per_page}");
        if ($result->rowCount() == 0) {
            echo '
				<p>
					Ingen mottatte overføringer.
				</p>';
        } else {
            echo '
				<table class="table tablemt" width="100%">
					<thead>
						<tr>
							<th>Sender</th>
							<th>Beløp</th>
							<th>Tidspunkt</th>
						</tr>
					</thead>
					<tbody>';
            $i = 0;
            while ($row = $result->fetch()) {
                $date = ess::$b->date->get($row['time']);
                echo '
						<tr' . (++$i % 2 == 0 ? ' class="color"' : '') . '>
							<td><user id="' . $row['bl_sender_up_id'] . '" /></td>
							<td class="r">' . game::format_cash($row['amount']) . '</td>
							<td class="c" style="font-size: 10px">' . $date->format(date::FORMAT_NOTIME) . '<br />' . $date->format("H:i:s") . '</td>
						</tr>';
            }
            echo '
					</tbody>
				</table>
				<p class="c">' . $pagei->pagenumbers(game::address("banken", $_GET, array("side_mottatte")) . "#mottatte", game::address("banken", $_GET, array("side_mottatte"), array("side_mottatte" => "_pageid_")) . "#mottatte") . '</p>';
        }
        echo '
			</div>
		</div>
		<div class="clear"></div>
	</div>
</div>';
    }
开发者ID:Kuzat,项目名称:kofradia,代码行数:101,代码来源:banken.php

示例8: show


//.........这里部分代码省略.........
        echo '
	<p class="c"><a href="banken?ff_id=' . $this->ff->id . '&amp;stats">Vis statistikk over pengeflyt i ' . $this->ff->type['refobj'] . ' &raquo;</a></p>
</div>';
        // kun boss kan ta ut og sette inn penger
        if ($this->ff->access($this->priority_write) && !$this->nostat) {
            echo '
<div style="margin: 0 auto; width: 420px">

<!-- sett inn penger -->
<div style="width: 205px; float: left; margin-right: 10px">
	<div class="section">
		<form action="" method="post">
			<h2>Sett inn penger</h2>
			<dl class="dd_right dl_2x">
				<dt>Beløp</dt>
				<dd><input type="text" name="bank_inn" class="styled w90" value="0" style="margin-right: 3px" />' . show_button("Alt", 'onclick="this.previousSibling.value=\'' . game::format_cash(login::$user->player->data['up_cash']) . '\'"') . '
				
				<dt>Notat</dt>
				<dd><input type="text" name="note" value="" maxlength="50" class="styled w120" /></dd>
			</dl>
			<h4>' . show_sbutton("Sett inn") . '</h4>
		</form>
	</div>
</div>

<!-- ta ut penger -->
<div style="width: 205px; float: left">
	<div class="section">
		<form action="" method="post">
			<h2>Ta ut penger</h2>
			<dl class="dd_right dl_2x">
				<dt>Beløp</dt>
				<dd><input type="text" name="bank_ut" class="styled w90" value="0" style="margin-right: 3px" />' . show_button("Alt", 'onclick="this.previousSibling.value=\'' . game::format_cash($this->ff->data['ff_bank']) . '\'"') . '
				
				<dt>Notat</dt>
				<dd><input type="text" name="note" value="" maxlength="50" class="styled w120" /></dd>
			</dl>
			<h4>' . show_sbutton("Ta ut") . '</h4>
		</form>
	</div>
</div>
<div class="clear"></div>

</div>';
        }
        echo '
<div class="fhr"></div>';
        $ff_reset = $this->ff->data['ff_time_reset'] && !$this->ff->mod ? " AND ffbl_time > {$this->ff->data['ff_time_reset']}" : "";
        // sideinformasjon - hent siste bevegelser
        $pagei = new pagei(pagei::ACTIVE_GET, "side", pagei::PER_PAGE, 15);
        $result = $pagei->query("SELECT ffbl_type, ffbl_amount, ffbl_up_id, ffbl_note, ffbl_time, ffbl_balance FROM ff_bank_log WHERE ffbl_ff_id = {$this->ff->id}{$ff_reset} ORDER BY ffbl_time DESC");
        if ($result->rowCount() == 0) {
            echo '
<p class="c">
	Ingen overføringer er enda registrert.
</p>';
        } else {
            echo '
<h1 id="bevegelser" class="c">Siste bevegelser</h1>
<table class="table center">
	<thead>
		<tr>
			<th>Type</th>
			<th>Person</th>
			<th>Beløp</th>
			<th>Tidspunkt</th>
			<th>Notat</th>
			<th>Balanse</th>
		</tr>
	</thead>
	<tbody class="nowrap">';
            $i = 0;
            $typer = array(1 => "bank_inn", "bank_ut", "bank_doner", "bank_betaling", "bank_tbetaling");
            while ($row = $result->fetch()) {
                $type = isset($typer[$row['ffbl_type']]) ? ff::$bank_ikoner[$typer[$row['ffbl_type']]] : 'Ukjent';
                $type .= " " . (isset(ff::$bank_types[$row['ffbl_type']]) ? ff::$bank_types[$row['ffbl_type']] : 'Ukjent');
                if ($row['ffbl_type'] == 2 || $row['ffbl_type'] == 4) {
                    $row['ffbl_amount'] = "-" . $row['ffbl_amount'];
                }
                $player = $row['ffbl_up_id'] ? '<user id="' . $row['ffbl_up_id'] . '" />' : 'Spillet';
                echo '
		<tr' . (++$i % 2 == 0 ? ' class="color"' : '') . '>
			<td>' . $type . '</td>
			<td>' . $player . '</td>
			<td class="r">' . game::format_cash($row['ffbl_amount']) . '</td>
			<td>' . ess::$b->date->get($row['ffbl_time'])->format(date::FORMAT_SEC) . '</td>
			<td class="wrap">' . (empty($row['ffbl_note']) ? '<span style="color: #AAA">Tomt</span>' : game::bb_to_html($row['ffbl_note'])) . '</td>
			<td class="r">' . game::format_cash($row['ffbl_balance']) . '</td>
		</tr>';
            }
            echo '
	</tbody>
</table>';
            // flere sider?
            if ($pagei->pages > 1) {
                echo '
<p class="c">' . $pagei->pagenumbers(game::address(PHP_SELF, $_GET, array("side")) . "#bevegelser", game::address(PHP_SELF, $_GET, array("side"), array("side" => "_pageid_")) . "#bevegelser") . '</p>';
            }
        }
    }
开发者ID:Kuzat,项目名称:kofradia,代码行数:101,代码来源:banken.php

示例9: __construct

    /**
     * Construct
     */
    public function __construct()
    {
        // endre signatur i forumet
        if (login::$logged_in && (isset($_GET['show_signature']) || isset($_GET['hide_signature']))) {
            if (isset($_GET['show_signature']) && login::$user->data['u_forum_show_signature'] == 0) {
                \Kofradia\DB::get()->exec("UPDATE users SET u_forum_show_signature = 1 WHERE u_id = " . login::$user->id);
            } elseif (isset($_GET['hide_signature']) && login::$user->data['u_forum_show_signature'] == 1) {
                \Kofradia\DB::get()->exec("UPDATE users SET u_forum_show_signature = 0 WHERE u_id = " . login::$user->id);
            }
            redirect::handle(game::address("topic", $_GET, array("show_signature", "hide_signature")));
        }
        // hent forumtråd
        $this->topic = new \Kofradia\Forum\Topic(getval("id"));
        $this->fmod = $this->topic->forum->fmod;
        // sett standard redirect
        redirect::store("topic?id={$this->topic->id}");
        // slette forumtråden?
        if (isset($_POST['delete'])) {
            // forsøk å slette forumtråden
            validate_sid();
            $this->topic->delete();
        }
        // gjenopprette forumtråden?
        if (isset($_POST['restore'])) {
            // forsøk å gjenopprette forumtråden
            validate_sid();
            $this->topic->restore();
        }
        // slette forumsvar?
        if (isset($_GET['delete_reply'])) {
            validate_sid();
            // finn forumsvaret
            if ($reply = $this->topic->get_reply($_GET['delete_reply'])) {
                // forsøk å slett forumsvaret
                $reply->delete();
            } else {
                ess::$b->page->add_message("Fant ikke forumsvaret.", "error");
                redirect::handle();
            }
        }
        // gjenopprette forumsvar?
        if (isset($_GET['restore_reply'])) {
            validate_sid();
            // finn forumsvaret
            if ($reply = $this->topic->get_reply($_GET['restore_reply'])) {
                // forsøk å gjenopprett forumsvaret
                $reply->restore();
            } else {
                ess::$b->page->add_message("Fant ikke forumsvaret.", "error");
                redirect::handle();
            }
        }
        // legge til nytt svar?
        if (isset($_GET['reply']) && isset($_POST['post']) && isset($_POST['text'])) {
            // ikke slå sammen?
            $no_concatenate = isset($_POST['no_concatenate']) && access::has("forum_mod");
            // annonsere?
            $announce = isset($_POST['announce']) && access::has("forum_mod");
            // har vi ingen aktiv spiller?
            if (count(login::$user->lock) == 1 && in_array("player", login::$user->lock)) {
                ess::$b->page->add_message("Du har ingen aktiv spiller.", "error");
                redirect::handle();
            }
            // forsøk å legg til svaret
            $this->topic->add_reply($_POST['text'], $no_concatenate, $announce);
        }
        // den aktuelle siden (sjekk for replyid før vi retter sidetall)
        $pagei = new pagei(pagei::ACTIVE_GET, "p", pagei::PER_PAGE, $this->topic->replies_per_page);
        // sjekk om vi skal vise slettede svar
        if (isset($_GET['show_deleted']) && $this->fmod) {
            $show_deleted = true;
            $deleted = "";
        } else {
            $show_deleted = false;
            $deleted = " AND fr_deleted = 0";
        }
        // skal vi vise status for meldingene?
        $fs_id = 0;
        // skal vi vise et bestemt forumsvar?
        $reply_id = false;
        if (isset($_GET['replyid'])) {
            // hent forumsvaret
            $reply_id = intval($_GET['replyid']);
            $result = \Kofradia\DB::get()->query("SELECT fr_id, fr_deleted FROM forum_replies WHERE fr_ft_id = {$this->topic->id} AND fr_id = {$reply_id}");
            $row = $result->fetch();
            // fant ikke forumsvaret, eller slettet uten tilgang?
            if (!$row || $row['fr_deleted'] != 0 && !$this->fmod) {
                ess::$b->page->add_message("Fant ikke forumsvaret du refererte til.", "error");
                redirect::handle();
            }
            // slettet?
            if ($row['fr_deleted'] != 0 && !$show_deleted) {
                $show_deleted = true;
                $deleted = "";
            }
            // finn ut antall forumsvar før
            $result = \Kofradia\DB::get()->query("SELECT COUNT(fr_id) FROM forum_replies WHERE fr_ft_id = {$this->topic->id} AND fr_id < {$reply_id}{$deleted}");
//.........这里部分代码省略.........
开发者ID:Kuzat,项目名称:kofradia,代码行数:101,代码来源:topic.php

示例10: show


//.........这里部分代码省略.........
                $tilgjengelig[] = $id;
            }
        }
        $i_bruk = $tilgjengelig;
        // filter
        $filter = array();
        $matches = false;
        foreach ($_GET as $name => $val) {
            if (preg_match("/^f([0-9]+)\$/Du", $name, $matches) && in_array($matches[1], $tilgjengelig)) {
                $filter[] = $matches[1];
            }
        }
        if (count($filter) == 0) {
            $filter = false;
        } else {
            $i_bruk = $filter;
            $filter = true;
            ess::$b->page->add_message("Du har aktivert et filter og viser kun bestemte enheter.");
        }
        if ($filter) {
            ess::$b->page->add_css('.filter_inactive { display: none }');
        } else {
            ess::$b->page->add_css('.filter_active { display: none }');
        }
        if (count($tilgjengelig) > 0) {
            echo '
<form action="" method="get">
	<input type="hidden" name="ff_id" value="' . $this->ff->id . '" />
	<div class="section" style="width: 400px" id="filteroptions">
		<h2>Filter</h2>
		<p class="h_right">
			<span class="logg_filters filter_active"><a href="#" class="box_handle_toggle" rel="f[]">Merk alle</a> <a href="javascript:void(0)" onclick="toggle_display(\'.logg_filters\', event)">Skjul filteralternativer</a></span>
			<span class="logg_filters filter_inactive"><a href="#" onclick="toggle_display(\'.logg_filters\', event)">Vis filteralternativer</a></span>
		</p>
		<div class="logg_filters filter_active">
			<table class="table center tablemt" width="100%">
				<tbody>';
            $tbody = new tbody(min(3, count($tilgjengelig)));
            // 3 kolonner
            foreach ($tilgjengelig as $id) {
                $title = ff::$log[ff::$log_id[$id]][1];
                $aktivt = in_array($id, $i_bruk) && $filter;
                $tbody->append('<input type="checkbox" name="f' . $id . '" rel="f[]" value=""' . ($aktivt ? ' checked="checked"' : '') . ' />' . htmlspecialchars($title), 'class="box_handle"');
            }
            $tbody->clean();
            echo '
				</tbody>
			</table>
			<p class="c">' . show_sbutton("Oppdater") . '</p>
		</div>
	</div>
</form>';
        }
        $where = $ff_reset;
        if ($filter) {
            $where .= ' AND ffl_type IN (' . implode(",", $i_bruk) . ')';
        }
        // sideinformasjon - hent radene på denne siden
        $pagei = new pagei(pagei::ACTIVE_GET, "side", pagei::PER_PAGE, 30);
        $result = $pagei->query("SELECT SQL_CALC_FOUND_ROWS ffl_id, ffl_time, ffl_type, ffl_data, ffl_extra FROM ff_log WHERE ffl_ff_id = {$this->ff->id}{$where} ORDER BY ffl_time DESC, ffl_id DESC");
        if ($result->rowCount() == 0) {
            echo '
<p class="c">
	Ingen logg meldinger ble funnet.
</p>';
        } else {
            // css
            ess::$b->page->add_css('
.ffl_time {
	color: #AAA;
}');
            // logg meldingene
            $logs = array();
            while ($row = $result->fetch()) {
                $day = ess::$b->date->get($row['ffl_time'])->format(date::FORMAT_NOTIME);
                $data = $this->ff->format_log($row['ffl_id'], $row['ffl_time'], $row['ffl_type'], $row['ffl_data'], $row['ffl_extra']);
                $logs[$day][] = '<span class="ffl_time">' . ess::$b->date->get($row['ffl_time'])->format("H:i") . ':</span> ' . $data;
            }
            foreach ($logs as $day => $items) {
                echo '
<div class="section" style="width: 400px">
	<h2>' . $day . '</h2>';
                foreach ($items as $item) {
                    echo '
	<p>' . $item . '</p>';
                }
                echo '
</div>';
            }
            echo '
<p class="c">
	Viser ' . $pagei->count_page . ' av ' . $pagei->total . ' logg melding' . ($pagei->total == 1 ? '' : 'er');
            if ($pagei->pages > 1) {
                echo '<br />
	' . $pagei->pagenumbers(game::address("logg", $_GET, array("side")) . "#logg", game::address("logg", $_GET, array("side"), array("side" => "_pageid_")) . "#logg");
            }
            echo '
</p>';
        }
    }
开发者ID:Kuzat,项目名称:kofradia,代码行数:101,代码来源:logg.php

示例11: reply_format

    /**
     * Sett opp HTML for svar
     */
    public function reply_format($row, $num, $highlight, $new)
    {
        global $__server;
        $ret = '
	<div class="thread' . ($highlight ? ' thread_highlight scroll_here' : '') . ($new ? ' thread_ny' : '') . ($num == 1 ? ' first' : '') . ($row['im_deleted'] != 0 ? ' deleted' : '') . '" id="m' . $row['im_id'] . '">
		<div class="title">
			<div class="title_left">#' . $num . ' - Av <user id="' . $row['im_up_id'] . '" />' . ($new ? ' <span class="ny">(Ny!)</span>' : '') . '</div>' . (!$this->restrict ? $row['im_deleted'] == 0 ? '
			<a href="' . game::address($__server['relative_path'] . '/innboks_les', $_GET, array(), array("im_del" => $row['im_id'], "sid" => login::$info['ses_id'])) . '">Slett</a>' : '
			<a href="' . game::address($__server['relative_path'] . '/innboks_les', $_GET, array(), array("im_restore" => $row['im_id'], "sid" => login::$info['ses_id'])) . '">Gjenopprett</a>' : '') . '
			' . ess::$b->date->get($row['im_time'])->format(date::FORMAT_SEC) . '
		</div>
		<div class="text">
			<div class="p">' . game::bb_to_html($row['id_text']) . '</div>
		</div>';
        // rapportering
        if ($row['im_up_id'] != login::$user->player->id) {
            // rapportert?
            if ($row['r_time']) {
                $ret .= '
			<p class="inbox_report_link">Rapportert ' . ess::$b->date->get($row['r_time'])->format() . '</p>';
            } else {
                $ret .= '
			<p class="inbox_report_link"><a href="js" class="report_link" rel="pm,' . $row['im_id'] . ',1">Rapporter melding</a></p>';
            }
        }
        $ret .= '
	</div>';
        return $ret;
    }
开发者ID:Kuzat,项目名称:kofradia,代码行数:32,代码来源:class.inbox_thread.php

示例12: content_build

    /**
     * Sett opp innhold til en enhet i noden
     * @param array $unit
     */
    public static function content_build($unit)
    {
        switch ($unit['ni_type']) {
            case 1:
                // bb
                $content = '
<div class="p">' . game::format_data($unit['nir_content']) . '</div>';
                break;
            case 2:
                // html
            // html
            case 3:
                // htmleditor
                $content = '
' . $unit['nir_content'];
                break;
            case 5:
                // gallery_section
                $content = '
<p>Not implementet.</p>';
                break;
            case 6:
                // gallery_item
                $content = '
<p>Not implementet.</p>';
                break;
            case 7:
                // news
                $params = new params($unit['nir_params']);
                // hvilke tags?
                $tags = new container($params->get("tags"));
                $page_name = "ni_s_{$unit['ni_id']}";
                $pageinfo = new pagei(PAGEI_ACTIVE_GET, $page_name, PAGEI_PER_PAGE, max(1, min(50, $params->get("per_page", 15))));
                // hent nyhetene
                if (count($tags->items) > 0) {
                    $tags_db = array_map(array(ess::$b->db, "quote"), $tags->items);
                    // filter via tags
                    $query = "n_id, n_title, n_content, n_userid, n_time, n_visible, n_type FROM news, news_tags WHERE n_visible > 0 AND n_id = nt_n_id AND nt_tagname IN (" . implode(", ", $tags_db) . ") GROUP BY n_id ORDER BY n_time DESC";
                } else {
                    $query = "n_id, n_title, n_intro, LEFT(n_content, 5) AS n_content, n_userid, n_time, n_visible, n_type FROM news WHERE n_visible > 0 ORDER BY n_time DESC";
                }
                $result = $pageinfo->query($query);
                $content = '';
                if ($result->rowCount() == 0) {
                    $content .= '
<p>Ingen nyheter.</p>';
                } else {
                    while ($row = $result->fetch()) {
                        $content .= '
<h2>' . htmlspecialchars($row['n_title']) . '</h2>
<p class="h_right">' . ess::$b->date->get($row['n_time'])->format() . '</p>
<div class="p">' . game::format_data($row['n_intro']) . '</div>';
                        // mer info?
                        if (mb_strlen($row['n_content']) > 0) {
                            $content .= '
<p><a href="' . game::address(PHP_SELF, $_GET, array(), array("show_n" => $row['n_id'])) . '">Les mer &raquo;</a></p>';
                        }
                    }
                    if (!$params->get("hide_select_page") && $pageinfo->pages > 1) {
                        $content .= '
<p>' . game::pagenumbers(game::address(PHP_SELF, $_GET, array($page_name)), game::address(PHP_SELF, $_GET, array($page_name), array($page_name => true)) . "=", $pageinfo->pages, $pageinfo->active) . '</p>';
                    }
                }
                break;
            case 8:
                // php include
                $content = '
<p>Not implementet.</p>';
                break;
            default:
                // plaintext
                $content = '
<p>' . htmlspecialchars($unit['nir_content']) . '</p>';
        }
        return $content;
    }
开发者ID:Kuzat,项目名称:kofradia,代码行数:80,代码来源:class.nodes.php

示例13: show_stats

    /**
     * Vis pokerhistorikk
     */
    protected function show_stats()
    {
        ess::$b->page->add_title("Historikk");
        ess::$b->page->add_css('
.poker_results tbody td { text-align: center }
.poker_results .vi { color: #F9E600 }
.poker_results .ta { color: #FF0000 }');
        // sideinformasjon - startede runder
        $pagei_s = new pagei(pagei::ACTIVE_GET, "side_s", pagei::PER_PAGE, 15);
        $result_s = $pagei_s->query("\n\t\t\tSELECT poker_id, poker_challenger_up_id, poker_starter_cards, poker_challenger_cards, poker_time_start, poker_time_challenge, poker_cash, poker_state, poker_prize\n\t\t\tFROM poker\n\t\t\tWHERE poker_starter_up_id = {$this->up->id} AND poker_state = 4\n\t\t\tORDER BY poker_time_challenge DESC");
        // sideinformasjon - utfordrede runder
        $pagei_u = new pagei(pagei::ACTIVE_GET, "side_u", pagei::PER_PAGE, 15);
        $result_u = $pagei_u->query("\n\t\t\tSELECT poker_id, poker_starter_up_id, poker_starter_cards, poker_challenger_cards, poker_time_start, poker_time_challenge, poker_cash, poker_state, poker_prize\n\t\t\tFROM poker\n\t\t\tWHERE poker_challenger_up_id = {$this->up->id} AND poker_state = 4\n\t\t\tORDER BY poker_time_challenge DESC");
        // antall totalt
        $total = $pagei_s->total + $pagei_u->total;
        putlog("PROFILVIS", "%c7%bVIS-POKER-HISTORIE:%b%c %u" . login::$user->player->data['up_name'] . "%u viste pokerhistorien ({$_SERVER['REQUEST_URI']})");
        echo '
<div class="bg1_c small">
	<h1 class="bg1">Din pokerhistorie<span class="left"></span><span class="right"></span></h1>
	<p class="h_left"><a href="poker">&laquo; Tilbake</a></p>
	<div class="bg1">
		<p class="c">Pokerstatistikken viser kun pokerrunder ca. 90 dager tilbake i tid.</p>';
        // ingen runder?
        if ($total == 0) {
            echo '
		<p class="c">Ingen pokerrunder er registrert på deg.</p>';
        } else {
            echo '
		<p class="c">Totalt finnes det <b>' . game::format_number($total) . '</b> pokerrunde' . ($total == 1 ? '' : 'r') . '.</p>';
        }
        echo '
	</div>
</div>';
        if ($total > 0) {
            // startede pokerrunder
            echo '
	<div class="bg1_c xlarge">
		<h2 class="bg1" id="startede">Mine startede pokerrunder<span class="left2"></span><span class="right2"></span></h2>
		<div class="bg1">';
            if ($pagei_s->total == 0) {
                echo '
			<p class="c">Du har ikke aldri startet noen pokerrunder.</p>';
            } else {
                echo '
			<p class="c">Du har totalt startet <b>' . game::format_number($pagei_s->total) . '</b> pokerrunde' . ($pagei_s->total == 1 ? '' : 'r') . '.</p>
			<table class="table center poker_results" width="100%">
				<thead>
					<tr>
						<th>Motstander</th>
						<th>Tid</th>
						<th>Din/motstanderens kombinasjon</th>
						<th>Beløp</th>
						<th>Resultat</th>
					</tr>
				</thead>
				<tbody>';
                $i = 0;
                while ($row = $result_s->fetch()) {
                    echo $this->stats_row($row, true, ++$i);
                }
                echo '
				</tbody>
			</table>
			<p class="c">' . $pagei_s->pagenumbers(game::address("poker", $_GET, array("side_s")) . "#startede", game::address("poker", $_GET, array("side_s"), array("side_s" => "_pageid_")) . "#startede") . '</p>';
            }
            echo '
		</div>
	</div>';
            // startede pokerrunder
            echo '
	<div class="bg1_c xlarge">
		<h2 class="bg1" id="utfordrede">Mine utfordrede pokerrunder<span class="left2"></span><span class="right2"></span></h2>
		<div class="bg1">';
            if ($pagei_u->total == 0) {
                echo '
			<p class="c">Du har ikke aldri utfordret noen pokerrunder.</p>';
            } else {
                echo '
			<p class="c">Du har totalt utfordret <b>' . game::format_number($pagei_u->total) . '</b> pokerrunde' . ($pagei_u->total == 1 ? '' : 'r') . '.</p>
			<table class="table center poker_results" width="100%">
				<thead>
					<tr>
						<th>Motstander</th>
						<th>Tid</th>
						<th>Din/motstanderens kombinasjon</th>
						<th>Beløp</th>
						<th>Resultat</th>
					</tr>
				</thead>
				<tbody>';
                $i = 0;
                while ($row = $result_u->fetch()) {
                    echo $this->stats_row($row, false, ++$i);
                }
                echo '
				</tbody>
			</table>
//.........这里部分代码省略.........
开发者ID:Kuzat,项目名称:kofradia,代码行数:101,代码来源:poker.php

示例14: delete_topics

 /**
  * Slette forumtråder
  */
 protected function delete_topics()
 {
     if (!isset($_POST['emne'])) {
         ess::$b->page->add_message("Du merket ingen forumtråder!");
     } elseif (!is_array($_POST['emne'])) {
         ess::$b->page->add_message("Ugyldig forumtråder (ingen array)!", "error");
     } else {
         $ant = 0;
         $slettet = array();
         $time = time();
         $idlist = array();
         foreach ($_POST['emne'] as $id) {
             $idlist[] = intval($id);
         }
         // ingen forumtråder?
         if (count($idlist) == 0) {
             ess::$b->page->add_message("Du må merke noen forumtråder.", "error");
             redirect::handle(game::address("forum", $_GET));
         }
         // hent forumtrådene
         $result = \Kofradia\DB::get()->query("SELECT ft_id, ft_title, ft_up_id FROM forum_topics WHERE ft_deleted = 0 AND ft_fse_id = {$this->forum->id} AND ft_id IN (" . implode(",", $idlist) . ") FOR UPDATE");
         // ingen forumtråder?
         if ($result->rowCount() == 0) {
             ess::$b->page->add_message("Fant ingen av de merkede forumtrådene.", "error");
             redirect::handle(game::address("forum", $_GET));
         }
         // sett opp liste
         $deleted = array();
         $time = time();
         $del_list = array();
         $log_list = array();
         while ($row = $result->fetch()) {
             $log_list[] = "({$row['ft_id']}, 1, " . login::$user->player->id . ", {$time})";
             $del_list[] = $row['ft_id'];
             $deleted[] = "{$row['ft_id']}:{$row['ft_up_id']}:" . urlencode($row['ft_title']);
         }
         // slett forumtrådene
         \Kofradia\DB::get()->exec("UPDATE forum_topics SET ft_deleted = {$time} WHERE ft_id IN (" . implode(",", $del_list) . ")");
         // opprett forumlogg
         \Kofradia\DB::get()->exec("INSERT INTO forum_log (flg_ft_id, flg_action, flg_up_id, flg_time) VALUES " . implode(", ", $log_list));
         // opprett crewlogg
         if (!$this->forum->ff || $this->forum->ff->uinfo->crew) {
             crewlog::log("forum_topics_delete", NULL, count($deleted), array("data" => implode("\n", $deleted)));
         }
         $ant = count($del_list);
         putlog("LOG", "FORUMTRÅDER SLETTET: '" . login::$user->player->data['up_name'] . "' slettet {$ant} forumtråder; ID: " . implode(", ", $del_list));
         ess::$b->page->add_message("<b>" . game::format_number($ant) . "</b> forumtråd" . ($ant == 1 ? '' : 'er') . " ble slettet!");
     }
     redirect::handle(game::address("forum", $_GET));
 }
开发者ID:Kuzat,项目名称:kofradia,代码行数:53,代码来源:forum.php

示例15: unset

global $_lang, $_base, $__server;
$_base->page->add_title("Finn bruker/spiller");
$_base->page->theme_file = "doc";
// gammelt oppsett?
if (isset($_GET['id']) || isset($_GET['user'])) {
    if (isset($_GET['id'])) {
        $_GET['u_id'] = $_GET['id'];
        unset($_GET['id']);
    }
    if (isset($_GET['user'])) {
        $_GET['name'] = $_GET['user'];
        unset($_GET['user']);
    }
    // send til korrekt adresse
    $_base->page->add_message("Adressen du klikket på førte deg til en gammel versjon av denne siden. Du er sendt til korrekt adresse.");
    redirect::handle(game::address("finn", $_GET));
}
// felt man skal kunne vise
$fields = array("ip", "reg", "email", "onlinea", "onliner", "hits", "points", "banko", "cash", "birth");
$fields_name = array("IP-adresse", "Registrert", "E-post adresse", "Sist pålogget (abs)", "Sist pålogget (rel)", "Hits", "Rank", "Bank overføringer", "Penger", "Fødselsdato");
// lagre felt?
if (isset($_POST['fields'])) {
    // hent ajax funksjoner
    require PATH_APP . "/ajax.php";
    // finn ut hvilke felt som skal lagres
    $list = explode(",", $_POST['fields']);
    $show = array();
    foreach ($list as $item) {
        if (isset($fields[$item])) {
            $show[] = $item;
        }
开发者ID:Kuzat,项目名称:kofradia,代码行数:31,代码来源:finn.php


注:本文中的game::address方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。