php Error404类(方法)实例源码

下面列出了php Error404 类(方法)源码代码实例,从而了解它的用法。

作者:ItsHade    项目:epicLanBootstra   
protected static function load_nickname($id = null)
 {
     if (!$id) {
         $id = $_GET['id'];
     }
     $nickname = BadNickname::find_by_id($id);
     if ($nickname) {
         return $nickname;
     } else {
         Error404();
     }
 }

作者:ItsHade    项目:epicLanBootstra   
protected static function load_slideshow($id = null)
 {
     if (!$id) {
         $id = $_GET['id'];
     }
     $slideshow = Slideshow::find_by_id($id);
     if ($slideshow) {
         return $slideshow;
     } else {
         Error404();
     }
 }

作者:ItsHade    项目:epicLanBootstra   
protected static function load_group($id = null)
 {
     if (isset($_GET['id'])) {
         $id = $_GET['id'];
     }
     $id = mysql_real_escape_string($id);
     $group = Group::find_by_id($id);
     if ($group) {
         return $group;
     }
     Error404();
 }

作者:ItsHade    项目:epicLanBootstra   
protected function load_gameserver($id = null)
 {
     if (!$id) {
         $id = $_GET['id'];
     }
     $id = mysql_real_escape_string($id);
     $server = GameServer::find_by_id($id);
     if ($server && $server->online) {
         return $server;
     }
     Error404();
 }

作者:ItsHade    项目:epicLanBootstra   
protected static function load_content($permalink = null, $external_only = false)
 {
     if (!$permalink) {
         $permalink = $_GET['permalink'];
     }
     $content = Content::find_by_permalink($permalink, $external_only);
     if ($content) {
         return $content;
     } else {
         Error404();
     }
 }

作者:ItsHade    项目:epicLanBootstra   
protected static function load_game($id = null)
 {
     if (!$id) {
         $id = mysql_real_escape_string($_GET['game_id']);
     }
     $game = Game::find_by_id($id);
     if ($game) {
         return $game;
     } else {
         Error404();
     }
 }

作者:ItsHade    项目:epicLanBootstra   
protected static function load_event($permalink = null)
 {
     if (!$permalink) {
         $permalink = $_GET['permalink'];
     }
     $event = Event::find_by_permalink($permalink);
     if ($event) {
         return $event;
     } else {
         Error404();
     }
 }

作者:ItsHade    项目:epicLanBootstra   
protected static function load_gameserver($id = null)
 {
     if (!$id) {
         $id = $_GET['id'];
     }
     $server = GameServer::find_by_id($id);
     if ($server) {
         return $server;
     } else {
         Error404();
     }
 }

作者:ItsHade    项目:epicLanBootstra   
protected function load_user($nickname = null)
 {
     if (!$nickname) {
         $nickname = $this->GetData('nickname');
     }
     $user = User::find_by_nickname($nickname);
     if ($user) {
         return $user;
     } else {
         Error404();
     }
 }

作者:ItsHade    项目:epicLanBootstra   
protected static function load_tag($tagname = null)
 {
     if (!$tagname) {
         $tagname = $_GET['tag'];
     }
     $tag = Tag::find_by_permalink($tagname);
     if ($tag) {
         return $tag;
     } else {
         Error404();
     }
 }

作者:agnyrussi    项目:linkorcms_mod_forms_file_suppor   
/**
 * Инициализация ЧПУ и разбор текущего адреса страницы.
 * @since 1.4.1
 */
function UfuInit()
{
    if (System::config('general/ufu')) {
        if (isset($_GET['ufu'])) {
            $Path = trim($_GET['ufu']);
            if ($Path != '') {
                $_GET = UfuRewrite($_GET['ufu']);
                if ($_GET === false) {
                    Error404();
                }
            }
        }
    }
}

作者:ItsHade    项目:epicLanBootstra   
protected static function load_event($permalink = null)
 {
     if (!$permalink) {
         $permalink = $_GET['permalink'];
     }
     $event = Event::find_by_permalink($permalink);
     if ($event) {
         if (!$event->visible && !$event->advertised) {
             //self::restrict("admin");
             throw new Error404();
         }
         if (!$event->check_user(Site::CurrentUser())) {
             Error404();
         }
         return $event;
     } else {
         Error404();
     }
 }

作者:ItsHade    项目:epicLanBootstra   
public function show($id = null)
 {
     if (isset($_GET['id'])) {
         $id = $_GET['id'];
     }
     $script = Script::find_by_id($id);
     if (!$script) {
         Error404();
     }
     $page = 1;
     if (isset($_GET['page'])) {
         $page = $_GET['page'];
     }
     $id = mysql_real_escape_string($script->id);
     $paginate = ScriptLog::paginate("scripts.id = '{$id}'", "scriptlogs.created_at DESC, scriptlogs.id DESC", $page, 50);
     $this->assign("page", $paginate);
     $this->assign("script", $script);
     $this->title = "Scheduled Scripts :: {$script->name} :: Logs";
     $this->render("scriptlog/show.tpl");
 }

作者:ItsHade    项目:epicLanBootstra   
public function show($id = null)
 {
     if (isset($_GET['id'])) {
         $id = $_GET['id'];
     }
     if (!$id) {
         Error404();
     }
     $payment = PaymentTransaction::find_by_id($id);
     if (!$payment) {
         Error404();
     }
     $cart = Cart::find_by_id($payment->cart_id);
     if ($cart) {
         $user = User::find_by_id($cart->user_id);
         $this->assign("user", $user);
         $this->assign("cart", $cart);
     }
     $this->assign("payment", $payment);
     $this->title = "Payment {$payment->id}";
     $this->render("paymenttransaction/show.tpl");
 }

作者:ItsHade    项目:epicLanBootstra   
public function process($id = null)
 {
     if ($_GET['key'] == md5("winbarmint")) {
         if (!$id) {
             $id = mysql_real_escape_string($_GET['id']);
         }
         $topup = Topup::find_by_id($id);
         if ($topup) {
             $topup->processed = true;
             if ($topup->save()) {
                 echo "OK";
             } else {
                 echo "Fail";
             }
             die;
         } else {
             Error404();
         }
     } else {
         Error403();
     }
 }

作者:ItsHade    项目:epicLanBootstra   
protected static function load_option($question, $id = null)
 {
     if (!$id) {
         $id = $_GET['id'];
     }
     $object = SurveyQuestionOption::find_by_id($id);
     if ($object and $object->survey_question_id == $question->id) {
         return $object;
     } else {
         Error404();
     }
 }

作者:ItsHade    项目:epicLanBootstra   
protected static function load_page($article, $id = null)
 {
     if (!$id) {
         $id = $_GET['id'];
     }
     $object = ArticlePage::find_by_id($id);
     if ($object && $object->article_id == $article->id) {
         return $object;
     } else {
         Error404();
     }
 }

作者:ItsHade    项目:epicLanBootstra   
protected function load_content($event, $permalink = null, $external_only = false)
 {
     if (!$permalink) {
         $permalink = $this->GetData('permalink');
     }
     $content = EventContent::find_by_permalink($event, $permalink, $external_only);
     if ($content) {
         return $content;
     } else {
         Error404();
     }
 }

作者:ItsHade    项目:epicLanBootstra   
protected static function load_ticket($event, $id = null)
 {
     if (!$id) {
         $id = $_GET['id'];
     }
     $id = mysql_real_escape_string($id);
     $event_id = mysql_real_escape_string($event->id);
     $ticket = EventTicket::find("event_tickets.event_id = '{$event_id}' AND event_tickets.id = '{$id}'");
     if ($ticket) {
         return $ticket;
     } else {
         Error404();
     }
 }

作者:ItsHade    项目:epicLanBootstra   
<?php

$dir = getcwd();
chdir("../");
require_once "interface.php";
$layout = EpicInterface::init();
Error404();


问题


面经


文章

微信
公众号

扫码关注公众号