本文整理汇总了PHP中redirect::store方法的典型用法代码示例。如果您正苦于以下问题:PHP redirect::store方法的具体用法?PHP redirect::store怎么用?PHP redirect::store使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类redirect
的用法示例。
在下文中一共展示了redirect::store方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct()
{
ess::$b->page->add_title("Meldinger");
// finn meldingstråden
$this->thread = inbox_thread::get(getval("id"));
if (!$this->thread) {
ess::$b->page->add_message("Fant ikke meldingstråden.", "error");
redirect::handle("innboks");
}
$this->thread->check_rel();
$this->thread->get_receivers();
$this->can_reply = $this->thread->can_reply_access && $this->thread->can_reply_receivers;
redirect::store("innboks_les?id={$this->thread->id}");
$this->check_actions();
// oppdater stats og teller
$this->thread->stats_view_update();
$this->thread->counter_new_reset();
// finn ut hvor mange meldinger vi kan se
$this->num_messages = $this->thread->num_messages();
// sett opp sidenummer
$this->set_page_info();
// antall nye meldinger
$this->new = $this->thread->data_rel ? $this->thread->data_rel['ir_unread'] : 0;
// skrive svar?
if (isset($_GET['reply']) && $this->can_reply) {
ess::$b->page->add_js_domready('
$("textContent").focus();
$("default_main").goto();');
}
// vis meldingen
$this->show();
}
示例2: __construct
/**
* Construct
*/
public function __construct()
{
$this->ff = ff::get_ff();
$this->ff->needaccess(2);
redirect::store("medlemmer?ff_id={$this->ff->id}");
$this->page_handle();
$this->ff->load_page();
}
示例3: __construct
/**
* Construct
*/
public function __construct()
{
$this->ff = ff::get_ff();
$this->ff->needtype("bank");
$this->ff->needaccess(3);
redirect::store("bank?ff_id={$this->ff->id}");
ess::$b->page->add_title("Bankkontroll");
$this->page_handle();
$this->ff->load_page();
}
示例4: __construct
/**
* Construct
*/
public function __construct()
{
access::no_guest();
ess::$b->page->add_title("Anti-bot sjekk");
// hvilken side vi skal sendes til
$this->redirect_url = getval("ret");
if (!$this->redirect_url) {
$this->redirect_url = ess::$s['relative_path'] . "/";
}
// sjekk etter anti-bot
$name = getval("name");
$this->antibot = antibot::get($name);
if (!$this->antibot->data) {
ess::$b->page->add_message("Anti-bot oppføringen er ikke opprettet.", "error");
$this->redirect();
}
// kuler?
if ($name == "kuler") {
// gjennomfør pre-check
if (!$this->antibot->kuler_precheck()) {
$this->redirect();
}
// sett lave ventetider
$this->update_delay = 2;
$this->retry_delay = 2;
}
redirect::store("sjekk?name=" . urlencode($this->antibot->name) . '&ret=' . urlencode($this->redirect_url));
// sjekk om anti-boten ikke krever sjekk
if (!$this->antibot->is_check_required()) {
$this->redirect();
}
// sjekk for ventetid
$this->check_wait();
// hent bildene
$this->load_images();
$this->form = \Kofradia\Form::getByDomain("anti-bot", login::$user);
// utføre sjekk?
if (isset($_POST['valider']) && isset($this->images) && !$this->wait) {
$this->check();
}
// nye bilder?
if (isset($_POST['new'])) {
$this->new_imgs();
}
// vis anti-boten
$this->show();
}
示例5: page_handle
/**
* Behandle forespørsel
*/
protected function page_handle()
{
redirect::store("/banken", redirect::ROOT);
// hent inn bankinfo
$this->bank = page_banken_bank::get($this->up->data['up_bank_ff_id']);
// må vi velge en bankkonto?
if (!$this->bank) {
$this->bank_set();
}
// har vi ikke noe bankpassord?
if (!$this->up->user->data['u_bank_auth']) {
$this->auth_create();
}
// kontroller at vi er logget inn i banken
$this->auth_verify();
// logge ut?
if (isset($_GET['logout']) && !isset(login::$extended_access['authed'])) {
login::data_set("banken_last_view", 0);
ess::$b->page->add_message("Du er nå logget ut av banken.");
redirect::handle();
}
// endre bankpassord?
if (isset($_GET['authc'])) {
$this->auth_change();
}
// bytte bankkonto?
if (isset($_POST['switch'])) {
$this->bank_set(true);
}
// sette inn penger?
if (isset($_POST['sett_inn'])) {
$this->sett_inn();
}
// ta ut penger?
if (isset($_POST['ta_ut'])) {
$this->ta_ut();
}
// overføre penger?
if (isset($_POST['mottaker']) && !isset($_POST['abort'])) {
$this->overfor();
}
// vis banken
$this->show();
}
示例6: load_user
protected function load_user()
{
$user = login::$user;
// vise en spesiell bruker?
if (isset($_GET['u_id']) && access::has("admin")) {
// hent bruker
$user = user::get((int) $_GET['u_id']);
// fant ikke?
if (!$user) {
echo '
<h1>Meldinger</h1>
<p>Fant ingen bruker med ID <b>' . htmlspecialchars($_GET['u_id']) . '</b>.</p>';
$this->load_page();
}
$this->show_deleted = true;
}
$this->inbox = new user_innboks($user);
// logg visning av innboks
putlog("PROFILVIS", "%c5%bVIS-MELDINGER:%b%c %u" . login::$user->player->data['up_name'] . "%u ({$_SERVER['REQUEST_URI']})");
// lagre redirect adresse
redirect::store($this->addr());
}
示例7: __construct
/**
* Construct
*/
public function __construct()
{
$this->ff = ff::get_ff();
if ($this->ff->type['type'] != "familie" || $this->ff->data['ff_is_crew']) {
$this->ff->needtype("bomberom");
}
$this->ff->needaccess(true);
$this->fam = $this->ff->type['type'] == "familie";
// konkurrerende broderskap har ikke bomberom
if ($this->ff->competition) {
ess::$b->page->add_message("Broderskapet er i konkurransemodus og har derfor ikke et aktivt bomberom.", "error");
$this->ff->redirect();
}
redirect::store("bomberom?ff_id={$this->ff->id}");
ess::$b->page->add_title("Bomberommet");
// sjekk om vi kan kaste ut nå
$this->check_kick_hour();
$this->kick_access = $this->ff->access($this->ff->type['type'] == "familie" ? 2 : true);
// behandle forespørselen
$this->page_handle();
// last inn siden
$this->ff->load_page();
}
示例8: page_crew
/**
* Crewside
*/
protected static function page_crew()
{
global $__server, $_lang;
ess::$b->page->add_title("Crew");
$subpage2 = getval("b");
redirect::store(page_min_side::addr(NULL, $subpage2 != "" ? "b=" . $subpage2 : ''));
ess::$b->page->add_css('
.minside_crew_links .active { color: #CCFF00 }');
$links = array();
$links[] = '<a href="' . htmlspecialchars(page_min_side::addr(NULL, "", "player")) . '">Min spiller</a>';
$links[] = '<a href="' . htmlspecialchars(page_min_side::addr(NULL, "")) . '"' . ($subpage2 == "" ? ' class="active"' : '') . '>Oversikt / logg</a>';
if (access::has("forum_mod")) {
$links[] = '<a href="' . htmlspecialchars(page_min_side::addr(NULL, "b=addlog")) . '"' . ($subpage2 == "addlog" ? ' class="active"' : '') . '>Nytt notat</a>';
}
$links[] = '<a href="' . htmlspecialchars(page_min_side::addr(NULL, "b=blokk")) . '"' . ($subpage2 == "blokk" ? ' class="active"' : '') . '>Blokkeringer</a>';
if (access::has("mod")) {
$links[] = '<a href="' . htmlspecialchars(page_min_side::addr(NULL, "b=banka")) . '"' . ($subpage2 == "banka" ? ' class="active"' : '') . '>Bankpassord</a>';
}
if (access::has("mod")) {
$links[] = '<a href="' . htmlspecialchars(page_min_side::addr(NULL, "b=birth")) . '"' . ($subpage2 == "birth" ? ' class="active"' : '') . '>Fødselsdato</a>';
}
if (access::has("mod")) {
$links[] = '<a href="' . htmlspecialchars(page_min_side::addr("set", "b=pass")) . '">Passord</a>';
}
if (access::has("admin")) {
$links[] = '<a href="' . htmlspecialchars(page_min_side::addr(NULL, "b=level")) . '"' . ($subpage2 == "level" ? ' class="active"' : '') . '>Tilgangsnivå</a>';
}
$links[] = '<a href="' . htmlspecialchars(page_min_side::addr(NULL, "b=send_email")) . '"' . ($subpage2 == "send_email" ? ' class="active"' : '') . '>Send e-post</a>';
$links[] = '<a href="' . htmlspecialchars(page_min_side::addr(NULL, "b=warning")) . '"' . ($subpage2 == "warning" ? ' class="active"' : '') . '>Gi advarsel</a>';
echo '
<p class="c minside_crew_links">' . implode(" | ", $links) . '</p>';
if ($subpage2 == "") {
// javascript for rapporteringer
ess::$b->page->add_js_domready('
var w = $("minside_reports");
var xhr = new Request({
url: relative_path + "/ajax/minside_report",
data: { u_id: ' . page_min_side::$active_user->id . ' },
evalScripts: function(script)
{
ajax.js += script;
}
});
xhr.addEvent("success", function(text)
{
w.set("html", text);
w.getElements(".pagenumbers").each(function(elm)
{
elm.addEvent("set_page", function(s) { load(null, s, true); });
});
ajax.refresh();
});
xhr.addEvent("failure", function(x)
{
var p = new Element("p", {html: "Feil: " + x}).inject(w.empty());
});
function load(a, s, goto)
{
if (a !== null) xhr.options.data.a = a;
if (s) xhr.options.data.s = s;
if (goto) w.getParent().goto(-10);
w.set("html", "<p>Laster inn data..</p>");
xhr.send();
}
$("minside_reports_from").addEvent("click", function() { load("from", 1, true); });
$("minside_reports_to").addEvent("click", function() { load("to", 1, true); });
$("minside_reports_all").addEvent("click", function() { load("", 1, true); });
load();');
// css for rapporteringer
ess::$b->page->add_css('
.rap_wrap {
margin: 1em 0;
background-color: #222222;
position: relative;
overflow: auto;
}
.rap_time {
position: absolute;
top: 8px;
right: 5px;
margin: 0;
color: #777777;
}
.rap_time span {
color: #EEEEEE;
}
.rap_w {
margin: 0;
padding: 5px;
background-color: #282828;
}
.rap_u {
font-size: 14px;
}
.rap_wrap .col2_w { margin: 0 }
.rap_wrap .col_w.left { width: 40% }
//.........这里部分代码省略.........
示例9: getval
// bruker ID
if (isset($_GET['u_id']) && access::has("admin")) {
// hent info
$u_id = (int) getval("u_id");
$user = user::get($u_id);
if (!$user) {
echo '
<h1>Meldinger</h1>
<p>Fant ingen bruker med ID <b>' . $u_id . '</b>.</p>';
$_base->page->load();
}
$show_deleted = true;
echo '
<h1 class="scroll_here">Meldinger Admin</h1>
<p>Du viser meldingene som tilhører ' . game::profile_link($user->player->data['up_id'], $user->player->data['up_name'], $user->player->data['up_access_level']) . '</p>';
redirect::store("innboks_sok?u_id={$u_id}");
}
// logg visning av innboks
putlog("PROFILVIS", "%c5%bVIS-MELDINGER-SOK:%b%c %u" . login::$user->player->data['up_name'] . "%u ({$_SERVER['REQUEST_URI']})");
// hvem som skal ha kunnet skrevet det man søker på
$search_from = array(1 => array("Alle", ""), array("Meg selv", " AND im_up_id = up_ref.up_id"), array("Andre", " AND im_up_id != up_ref.up_id"), array('Spesifiser', NULL, array()));
$id = requestval("f");
$search_from_id = isset($search_from[$id]) ? $id : 1;
// fant ikke brukeren?
if ($search_from_id == 4) {
$name = trim(postval("u"));
// sett opp brukernavnene
$names = explode(",", $name);
foreach ($names as $name) {
$name = trim($name);
if (empty($name)) {
示例10: page_crew
/**
* Crewside
*/
protected static function page_crew()
{
if (!isset(login::$extended_access['authed'])) {
echo '
<p class="c">Du må logge inn for utvidede tilganger.</p>';
} else {
$subpage2 = getval("b");
redirect::store(page_min_side::addr(NULL, $subpage2 != "" ? "b=" . $subpage2 : ''));
ess::$b->page->add_title("Crew");
ess::$b->page->add_css('
.minside_links .active { color: #CCFF00 }');
$links = array();
$links[] = '<a href="' . htmlspecialchars(page_min_side::addr("crew", "", "user")) . '">Min bruker</a>';
$links[] = '<a href="' . htmlspecialchars(page_min_side::addr(NULL, "")) . '"' . ($subpage2 == "" ? ' class="active"' : '') . '>Oversikt</a>';
if (access::has("seniormod")) {
$links[] = '<a href="' . htmlspecialchars(page_min_side::addr(NULL, "b=rank")) . '"' . ($subpage2 == "rank" ? ' class="active"' : '') . '>Juster rank</a>';
}
if (access::has("mod")) {
$links[] = '<a href="' . htmlspecialchars(page_min_side::addr(NULL, "b=name")) . '"' . ($subpage2 == "name" ? ' class="active"' : '') . '>Endre spillernavn</a>';
}
echo '
<p class="c minside_links">' . implode(" | ", $links) . '</p>';
if ($subpage2 == "") {
echo '
<div class="col2_w">
<div class="col_w left">
<div class="col">
<div class="bg1_c">
<h1 class="bg1">Oversikt<span class="left2"></span><span class="right2"></span></h1>
<div class="bg1">' . (access::has("mod") ? '
<ul>' . (access::has("admin") && KOFRADIA_DEBUG ? '
<li><a href="innboks?u_id=' . page_min_side::$active_user->id . '">Vis innboksen</a></li>
<li><a href="innboks_sok?u_id=' . page_min_side::$active_user->id . '">Søk i innboksen</a></li>' : '') . '
<li><a href="poker?up_id=' . page_min_side::$active_player->id . '&stats">Vis pokerhistorien</a></li>
<li><a href="admin/brukere/bankoverforinger?u1=' . page_min_side::$active_player->id . '">Vis bankoverføringer</a></li>
<li><a href="drap?up_id=' . page_min_side::$active_player->id . '">Vis angrep utført av spilleren</a></li>
<li><a href="drap?offer_up_id=' . page_min_side::$active_player->id . '">Vis angrep utført mot spilleren</a></li>
</ul>' : '') . '
<p>Trykk på <a href="' . htmlspecialchars(page_min_side::addr(NULL, "", "user")) . '">min bruker</a> for å vise informasjon om brukeren.</p>
</div>
</div>
</div>
</div>
<div class="col_w right">
<div class="col">
<div class="bg1_c">
<h1 class="bg1">Crewnotat for brukeren<span class="left2"></span><span class="right2"></span></h1>
<p class="h_right"><a href="' . htmlspecialchars(page_min_side::addr(NULL, "b=enote", "user")) . '">rediger</a></p>
<div class="bg1">
<p>Her kan hvem som helst i crewet legge til eller endre et notat for denne brukeren for å memorere ting som har med <u>brukeren</u> å gjøre.</p>' . (empty(page_min_side::$active_user->data['u_note_crew']) ? '
<p>Ingen notat er registrert.</p>' : '
<div class="p">' . game::bb_to_html(page_min_side::$active_user->data['u_note_crew']) . '</div>') . '
</div>
</div>
<div class="bg1_c">
<h1 class="bg1">Crewnotat for spilleren<span class="left2"></span><span class="right2"></span></h1>
<p class="h_right"><a href="' . htmlspecialchars(page_min_side::addr(NULL, "b=enote")) . '">rediger</a></p>
<div class="bg1">
<p>Her kan hvem som helst i crewet legge til eller endre et notat for denne spilleren for å memorere ting som har med <u>spilleren</u> å gjøre.</p>' . (empty(page_min_side::$active_player->data['up_note_crew']) ? '
<p>Ingen notat er registrert.</p>' : '
<div class="p">' . game::bb_to_html(page_min_side::$active_player->data['up_note_crew']) . '</div>') . '
</div>
</div>
</div>
</div>
</div>
<p class="c">Loggoppføringer for denne spilleren - <a href="' . htmlspecialchars(page_min_side::addr(NULL, "", "user")) . '">se komplett logg for brukeren</a></p>';
// hent loggene for denne spilleren
$pagei = new pagei(pagei::ACTIVE_GET, "side", pagei::PER_PAGE, 50);
$result = $pagei->query("SELECT lc_id, lc_up_id, lc_time, lc_lca_id, lc_a_up_id, lc_log FROM log_crew WHERE lc_a_up_id = " . page_min_side::$active_player->id . " ORDER BY lc_time DESC");
// ingen handlinger?
if ($result->rowCount() == 0) {
echo '
<p class="c">Ingen oppføringer eksisterer.</p>';
} else {
$rows = array();
while ($row = $result->fetch()) {
$rows[$row['lc_id']] = $row;
}
$data = crewlog::load_summary_data($rows);
$logs = array();
foreach ($data as $row) {
// hent sammendrag
$summary = crewlog::make_summary($row, NULL, $row['lc_a_up_id'] != page_min_side::$active_player->id);
$day = ess::$b->date->get($row['lc_time'])->format(date::FORMAT_NOTIME);
$logs[$day][] = '<p><span class="time">' . ess::$b->date->get($row['lc_time'])->format("H:i") . ':</span> ' . $summary . '</p>';
}
ess::$b->page->add_css('.crewlog .time { color: #888888; padding-right: 5px }');
foreach ($logs as $day => $items) {
echo '
<div class="bg1_c">
<h1 class="bg1">' . $day . '<span class="left2"></span><span class="right2"></span></h1>
<div class="bg1 crewlog">
' . implode('
', $items) . '
</div>
</div>';
//.........这里部分代码省略.........
示例11: intval
if (isset($pages[2]) && preg_match("/^\\d+\$/Du", $pages[2])) {
// hent avstemningen
$result = \Kofradia\DB::get()->query("SELECT p_id, p_title, p_text, p_ft_id, p_params, p_active, p_time_start, p_time_end, p_votes FROM polls WHERE p_id = " . intval($pages[2]));
if ($result->rowCount() == 0) {
$_base->page->add_message("Fant ikke avstemningen.", "error");
redirect::handle();
}
$poll = $result->fetch();
$_base->page->add_title($poll['p_title']);
// hent alternativene
$poll['options'] = array();
$result = \Kofradia\DB::get()->query("SELECT po_id, po_text, po_votes FROM polls_options WHERE po_p_id = {$poll['p_id']}");
while ($row = $result->fetch()) {
$poll['options'][$row['po_id']] = $row;
}
redirect::store("/polls/admin/{$poll['p_id']}");
// TODO: slette stemmer
// rediger avstemning?
if (isset($pages[3]) && $pages[3] == "edit") {
// lagre endringer?
if (isset($_POST['title']) && verify_sid()) {
$title = trim(postval("title"));
$text = trim(postval("text"));
$time_start = trim(postval("time_start"));
$time_end = trim(postval("time_end"));
$error = false;
if (mb_strlen($title) < 3) {
$_base->page->add_message("Tittelen må inneholde minst 3 tegn.", "error");
$error = true;
}
if (!$error && $time_start != "") {
示例12: putlog
// samme som bankpassordet?
if (password::verify_hash($_POST['password'], login::$user->data['u_bank_auth'], "bank_auth")) {
$_base->page->add_message("Passordet kan ikke være det samme som passordet til banken.", "error");
redirect::handle();
}
// er passordene like?
if ($_POST['password'] != $_POST['password_repeat']) {
$_base->page->add_message("Passordene må være like.", "error");
redirect::handle();
}
// lagre passord
$hash = password::hash($_POST['password']);
login::$user->params->update("extended_access_passkey", $hash, true);
putlog("NOTICE", "CREWAUTH: " . login::$user->player->data['up_name'] . " endret sitt passord for utvidede tilganger");
$_base->page->add_message("Du har nå oppdatert ditt passord for crewauth.");
redirect::store("extended_access");
}
echo '
<h1>Endre passord for crewauth</h1>
<p class="h_right"><a href="extended_access">Tilbake</a></p>
<form action="extended_access?change" method="post">
<dl class="dd_right w300">
<dt>Nåværende passord</dt>
<dd><input type="password" class="styled w100" name="password_current" /></dd>
<dt>Ønsket passord</dt>
<dd><input type="password" class="styled w100" name="password" /></dd>
<dt>Gjenta passord</dt>
<dd><input type="password" class="styled w100" name="password_repeat" /></dd>
<dd><input type="submit" value="Endre passord" class="button" /></dd>
</dl>
<p>Ønsket passord må oppfylle kravet til password::LEVEL_STRONG.</p>
示例13: getval
<?php
require "base.php";
// TODO: lenke fra min side må endres
$up = login::$user->player;
if (isset($_GET['up_id']) && (access::has("mod") && isset($_GET['stats']) || access::has("sadmin") && KOFRADIA_DEBUG)) {
// forsøk å finn spilleren
$up = player::get((int) getval("up_id"));
if (!$up) {
ess::$b->page->add_message("Fant ingen spiller med ID <u>" . htmlspecialchars($_GET['up_id']) . "</u>.", "error");
ess::$b->page->load();
}
redirect::store("poker?up_id={$up->id}");
echo '
<p class="c">Du viser pokersiden som tilhører ' . $up->profile_link() . '.' . (!isset($_GET['stats']) ? '<br /><b>Viktig:</b> Utfordringer du gjør her vil bli gjort som denne spilleren, og ikke din egen.' : '') . '</p>';
}
$poker = new page_poker($up);
示例14: __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}");
//.........这里部分代码省略.........
示例15: main
//.........这里部分代码省略.........
<dd>' . htmlspecialchars($parent_title) . '</dd>
<dt>Plassering</dt>
<dd>' . $priority_num . '</dd>
<dt>Tittel</dt>
<dd><input type="text" name="title" class="styled w100" value="' . htmlspecialchars(postval("title")) . '" /></dd>
<dt>Type</dt>
<dd>
<select name="type">';
$selected = postval("type");
if (!isset(nodes::$types[$selected])) {
$selected = false;
}
foreach (nodes::$types as $key => $value) {
echo '
<option value="' . htmlspecialchars($key) . '"' . ($selected == $key ? ' selected="selected"' : '') . '>' . htmlspecialchars($value) . '</option>';
}
echo '
</select>
</dd>
</dl>
<p>' . show_sbutton("Opprett side") . ' ' . show_sbutton("Avbryt", 'name="abort"') . '</p>
</form>';
page_node::load_page();
}
$node = false;
if (isset($_GET['node_id'])) {
$result = nodes::load_node($_GET['node_id'], false);
if (!$result) {
ess::$b->page->add_message("Fant ikke enheten.");
redirect::handle();
}
$node = true;
#ess::$b->page->add_title(nodes::$node_info['node_title']);
redirect::store("node/a?node_id=" . nodes::$node_id, redirect::ROOT);
if (isset($_POST['abort'])) {
ess::$b->page->add_message("Handlingen ble avbrutt.");
redirect::handle();
}
// flytt
if (isset($_GET['move'])) {
// hent tree
$root = array(0 => array("number" => 0, "prefix" => "", "prefix_node" => "", "data" => array("node_id" => 0, "node_parent_node_id" => 0, "node_title" => "Innhold (toppnivå)", "node_type" => NULL, "node_params" => NULL, "node_show_menu" => NULL, "node_expand_menu" => NULL, "node_enabled" => true, "node_priority" => 0)));
$tree = new tree(nodes::$nodes_sub);
$data = $tree->generate(0, $root, nodes::$nodes);
// sett opp data og finn ut hvor ting kan plasseres
$number_last = 1;
$disabled = 0;
$list = array(0 => 0);
foreach ($data as &$row) {
if ($disabled != 0 && $row['number'] <= $disabled) {
$disabled = 0;
}
$number_last = $row['number'];
$row['inside'] = $disabled == 0 && nodes::$node_id != $row['data']['node_id'];
$row['under'] = $disabled == 0 && nodes::$node_id != $row['data']['node_id'];
if (nodes::$node_id == $row['data']['node_id']) {
if (isset($list[$row['number']])) {
$active = array("under", $list[$row['number']]);
} else {
$active = array("inside", $list[$row['number'] - 1]);
}
$disabled = $row['number'];
}
$list[$row['number']] = $row['data']['node_id'];
}
unset($row);