コード例 #1
0
ファイル: pilot_detail.php プロジェクト: biow0lf/evedev-kb
 /**
  * Start constructing the page.
  * Prepare all the shared variables such as dates and check alliance ID.
  *
  */
 function start()
 {
     $this->page = new Page();
     $this->plt_id = (int) edkURI::getArg('plt_id');
     if (!$this->plt_id) {
         $this->plt_external_id = (int) edkURI::getArg('plt_ext_id');
         if (!$this->plt_external_id) {
             $id = (int) edkURI::getArg('id', 1);
             // Arbitrary number bigger than we expect to reach locally
             if ($id > 1000000) {
                 $this->plt_external_id = $id;
             } else {
                 $this->plt_id = $id;
             }
         }
     }
     $this->view = preg_replace('/[^a-zA-Z0-9_-]/', '', edkURI::getArg('view', 2));
     if ($this->view) {
         $this->page->addHeader('<meta name="robots" content="noindex, nofollow" />');
     }
     if (!$this->plt_id) {
         if ($this->plt_external_id) {
             $this->pilot = new Pilot(0, $this->plt_external_id);
             $this->plt_id = $this->pilot->getID();
         } else {
             $html = 'That pilot doesn\'t exist.';
             $this->page->generate($html);
             exit;
         }
     } else {
         $this->pilot = Cacheable::factory('Pilot', $this->plt_id);
         $this->plt_external_id = $this->pilot->getExternalID();
     }
     $this->page->setTitle('Pilot details - ' . $this->pilot->getName());
     if (!$this->pilot->exists()) {
         $html = 'That pilot doesn\'t exist.';
         $this->page->setContent($html);
         $this->page->generate();
         exit;
     }
     if ($this->plt_external_id) {
         $this->page->addHeader("<link rel='canonical' href='" . edkURI::page('pilot_detail', $this->plt_external_id, 'plt_ext_id') . "' />");
     } else {
         $this->page->addHeader("<link rel='canonical' href='" . edkURI::page('pilot_detail', $this->plt_id, 'plt_id') . "' />");
     }
     $this->corp = $this->pilot->getCorp();
     $this->alliance = $this->corp->getAlliance();
 }
コード例 #2
0
ファイル: Parser.php プロジェクト: stof/Gitiki
 public function page(Page $page)
 {
     $this->tocBuilder = new TocBuilder();
     $page->setContent(parent::text($page->getContent()));
     $page->setToc($this->tocBuilder->getToc());
     $this->tocBuilder = null;
 }
コード例 #3
0
 public function registerPage($slug, $namespace, $page)
 {
     $page_obj = new Page();
     $content_class = $namespace . '\\Controller\\' . $page;
     $page_obj->setContent(new $content_class());
     $this->_pages[$slug] = $page_obj;
 }
コード例 #4
0
 public function noPage()
 {
     include "core/lib/page.php";
     $p = new Page();
     $p->setupPage();
     $p->setContentTitle("Page Not Found - Error 404");
     $p->setContent(file_get_contents("core/fragments/404.phtml"));
     $p->displayPage();
 }
コード例 #5
0
ファイル: page.ctrl.php プロジェクト: monkeytie/korona
 public function add()
 {
     if (Page::already($_POST['baseUrl'], $_POST['uri'], $_POST['language'])) {
         throw new Exception('PAGE ALREADY EXISTS', 409);
     }
     $page = new Page();
     $page->setBaseUrl($_POST['baseUrl']);
     $page->setUri($_POST['uri']);
     $page->setLanguage($_POST['language']);
     if (array_key_exists('content', $_POST) && !empty($_POST['content'])) {
         $page->setContent($_POST['content']);
     }
     $page->setModele($_POST['modele']);
     $page->setTitle($_POST['title']);
     if (array_key_exists('languageParentId', $_POST)) {
         $page->setLanguageParentId($_POST['languageParentId']);
     }
     if (array_key_exists('ajax', $_POST)) {
         $page->setAjax($_POST['ajax']);
     }
     if (array_key_exists('published', $_POST)) {
         $page->setPublished($_POST['published']);
     }
     if (array_key_exists('metas', $_POST)) {
         $page->setMetas($_POST['metas']);
     }
     if (array_key_exists('css', $_POST)) {
         $page->setCss($_POST['css']);
     }
     if (array_key_exists('js', $_POST)) {
         $page->setJs($_POST['js']);
     }
     if (array_key_exists('action', $_POST)) {
         $page->setAction($_POST['action']);
     }
     if (array_key_exists('method', $_POST)) {
         $page->setMethod($_POST['method']);
     }
     if (array_key_exists('priority', $_POST)) {
         $page->setPriority($_POST['priority']);
     }
     if (array_key_exists('datas', $_POST)) {
         $page->setDatas($_POST['datas']);
     }
     if (!array_key_exists('blockIds', $_POST)) {
         $blkIds = array();
         foreach ($_POST['blockIds'] as $blk) {
             if (array_key_exists('id', $blk) && MongoId::isValid($blk['id'])) {
                 $blkIds[] = $blk['id'];
             }
         }
         $this->page->setBlockIds($blkIds);
     }
     $page->save();
     return array('pageId' => $page->getId());
 }
コード例 #6
0
ファイル: admin.php プロジェクト: biow0lf/evedev-kb
<?php

/**
 * @package EDK
 */
// admin menu now loads all admin pages with options
require_once 'common/admin/admin_menu.php';
$page = new Page();
$page->setAdmin();
if ($_POST) {
    options::handlePost();
}
$page->setContent(options::genOptionsPage());
$page->addContext(options::genAdminMenu());
if (!edkURI::getArg('field', 1) || !edkURI::getArg('sub', 1) || edkURI::getArg('field', 1) == 'Advanced' && edkURI::getArg('sub', 2) == 'Configuration') {
    $page->setTitle('Administration - Board Configuration (Current version: ' . KB_VERSION . ' ' . KB_RELEASE . ')');
}
$page->generate();
コード例 #7
0
    $conn = new DBConnection();
    $value = (double) mysqli_get_server_info($conn->id());
    return $value;
}
$sections['PHP'] = 'PHP';
$phpver = 'PHP version: ' . phpversion();
$html = "{$phpver}  <br />";
if (phpversion() >= "5.1.2") {
    $trouble['PHP'][] = array('passed' => true, 'text' => $html);
} else {
    $trouble['PHP'][] = array('passed' => false, 'text' => $html);
}
$html = 'Checking Magic Quotes Runtime is disabled';
if (get_magic_quotes_runtime()) {
    $trouble['PHP'][] = array('passed' => false, 'text' => $html);
} else {
    $trouble['PHP'][] = array('passed' => true, 'text' => $html);
}
$sections['Server'] = 'Server';
$sqlver = 'MYSQL version: ' . find_SQL_Version();
$html = "  {$sqlver}";
if (find_SQL_Version() >= 5) {
    $trouble['Server'][] = array('passed' => true, 'text' => $html);
} else {
    $html = $trouble['Server'][] = array('passed' => false, 'text' => $html);
}
$smarty->assignByRef('sections', $sections);
$smarty->assignByRef('trouble', $trouble);
$page->setContent($smarty->fetch(get_tpl('admin_troubleshooting')));
$page->addContext($menubox->generate());
$page->generate();
コード例 #8
0
        } else {
            // update
            $id = intval($key);
            $uri = $val["url"];
            $active = isset($val["active"]) ? 1 : 0;
            $lastkill = intval($val["lastkill"]);
            if ($feeds[$id]['active'] != $active) {
                // flags have changed
                $feed_flags = 0;
                if ($active) {
                    $feed_flags |= FEED_ACTIVE;
                }
                $qry->execute("UPDATE kb3_feeds SET feed_flags={$feed_flags} WHERE feed_kbsite = '" . KB_SITE . "' AND feed_id = {$id}");
                $feeds[$id]['active'] = (bool) ($feed_flags & FEED_ACTIVE);
            }
            if ($feeds[$id]['lastkill'] != $lastkill || $feeds[$id]['uri'] != $uri) {
                $qry->execute("UPDATE kb3_feeds SET feed_lastkill={$lastkill}, feed_url='" . $qry->escape($uri) . "' WHERE feed_kbsite = '" . KB_SITE . "' AND feed_id = {$id}");
                $feeds[$id]['lastkill'] = $lastkill;
                $feeds[$id]['uri'] = $uri;
            }
        }
    }
}
// Add an empty feed to the list, or create with one empty feed.
$feeds[] = array('id' => 'new', 'updated' => '', 'active' => '', 'uri' => "", 'lastkill' => 0);
$smarty->assignByRef('rows', $feeds);
$smarty->assign('results', $html);
$smarty->assign('url', edkURI::page("admin_idfeedsyndication"));
$page->addContext($menubox->generate());
$page->setContent($smarty->fetch(get_tpl('admin_idfeed')));
$page->generate();
コード例 #9
0
ファイル: admin.php プロジェクト: ununik/kvhusti
<?php

function __autoload($name)
{
    include_once "modules/classes/{$name}.class.php";
}
session_start();
$profil = new Profil();
$page = new Page();
if (!isset($_SESSION['kvh_login']) || $_SESSION['kvh_login'] == "" || $_SESSION['kvh_login'] == 0 || !$profil->checkIDLogin($_SESSION['kvh_login'])) {
    $page->setTitle("KVH Ústí nad Labem");
    $page->addToDrobeckovaNavigace('<a href="index.php">kvhusti.cz</a>');
    $page->setNavigation(include_once 'views/navigation.php');
    $page->setContent(include_once "controllers/admin/badName.php");
    $page->setAdminLog(include 'controllers/login/form.php');
    print (include_once 'views/page.php');
    return;
}
$page->addScript('<script src="js/ajax.js"></script>');
$page->addScript('<script src="js/admin.js"></script>');
$page->addScript('<script src="js/jquery-ui-1.8.18.custom.min.js"></script>');
if (isset($_GET['page'])) {
    $getPage = $_GET['page'];
} else {
    $getPage = "home";
}
$page->setTitle("KVH Ústí nad Labem");
$page->addToDrobeckovaNavigace('<a href="admin.php">kvhusti.cz</a>');
$page->setNavigation(include_once 'views/admin/navigation.php');
$page->setContent(include_once "controllers/admin/{$getPage}.php");
if ($page->getContent() == "") {
コード例 #10
0
ファイル: fixture.php プロジェクト: jeffreycai/ct21
    $page = new Page();
    $page->setController('site/form/contact');
    $page->setUri('contact');
    $page->setTitle('Contact');
    $page->setReserved(1);
    $page->setContent('
<h3>' . $settings['sitename'] . '</h3>
          <p>Our headquarter is located in Sydney CBD with easy access by public transportation. We open Monday to Friday from 9AM to 5PM, Saturday to Sunday from 9AM to 1PM. We are present on all business hours on phone. You can also reach us by email or filling up the contact form below.</p>
');
    $page->save();
    // student service
    $page = new Page();
    $page->setUri('services/student');
    $page->setTitle('Student service');
    $page->setReserved(0);
    $page->setContent('
<h3>We help you to apply for educational institution</h3>
          <p>Some content goes here.</p>
');
    $page->save();
    // immigration service
    $page = new Page();
    $page->setUri('services/immigration');
    $page->setTitle('Immigration service');
    $page->setReserved(0);
    $page->setContent('
<h3>We help you to Immigrate</h3>
          <p>Some content goes here.</p>
');
    $page->save();
}
コード例 #11
0
ファイル: study.php プロジェクト: sandrain/hangee
<?php

// index.php
require $_SERVER['DOCUMENT_ROOT'] . '/hangee/m/lib/__core.php';
$page = new Page();
$page->setTitle('HanGEE::Study');
$page->setMaster('m');
$page->setScript('/hangee/m/study.js');
ob_start();
?>


<?php 
$page->setContent(ob_get_contents());
ob_clean();
$page->render();
コード例 #12
0
ファイル: register.php プロジェクト: biow0lf/evedev-kb
    $error = false;
    if (config::get('user_regpass')) {
        if ($_POST['regpass'] != config::get('user_regpass')) {
            $smarty->assign('error', 'Registration password does not match.');
            $error = true;
        }
    }
    if (!$_POST['usrlogin']) {
        $smarty->assign('error', 'You missed to specify a login.');
        $error = true;
    }
    if (!$_POST['usrpass']) {
        $smarty->assign('error', 'You missed to specify a password.');
        $error = true;
    }
    if (strlen($_POST['usrpass']) < 3) {
        $smarty->assign('error', 'Your password needs to have at least 4 chars.');
        $error = true;
    }
    if (!$error) {
        $pilot = null;
        $id = null;
        user::register(slashfix($_POST['usrlogin']), slashfix($_POST['usrpass']), $pilot, $id);
        $page->setContent('Account registered.');
        $page->generate();
        return;
    }
}
$smarty->assign('actionURL', edkURI::page('register'));
$page->setContent($smarty->fetch(get_tpl('user_register')));
$page->generate();
コード例 #13
0
ファイル: kostiumy.php プロジェクト: skonina/maskarada_jekyll
<?php

error_reporting(E_ALL);
ini_set('display_errors', 'On');
function __autoload($class)
{
    include "classes/{$class}.class.php";
}
include "config.php";
$Page = new Page();
$Page->setContent(new ContentKostiumy());
$Page->display();
?>

<!--<a href="kostiumy.php" class="button2">Powrót</a>-->
<!--<h2><?php 
echo $this->group["group"];
?>
</h2>-->

<!--<ul class="lista-kostiumow">-->
<!--<?php 
foreach ($this->photos as $photo) {
    ?>
-->

<!--<li><a href="costumes/large/<?php 
    echo $photo["id"];
    ?>
.jpg" rel="group">-->
<!--	<img src="costumes/thumb/<?php 
コード例 #14
0
ファイル: admin_roles.php プロジェクト: biow0lf/evedev-kb
$page = new Page();
$page->setAdmin();
$page->setTitle('Administration - Role Management');
if ($_POST['action'] == 'search') {
    $hitlist = array();
    $search = slashfix($_POST['search']);
    $qry = DBFactory::getDBQuery();
    $qry->execute('select usr_login from kb3_user where usr_login like ' . "'%" . $search . "%'");
    while ($row = $qry->getRow()) {
        $hitlist[] = $row['usr_login'];
    }
    $smarty->assignByRef('role', $_POST['role']);
    $smarty->assignByRef('user', $hitlist);
    $smarty->assign('url', edkURI::page("admin_roles"));
    $page->addContext($menubox->generate());
    $page->setContent($smarty->fetch(get_tpl('admin_roles_assign')));
    $page->generate();
} elseif ($_POST['action'] == 'assign') {
    $qry = DBFactory::getDBQuery();
    $tmp = role::_get($_POST['role']);
    var_dump($tmp);
    #$qry->execute('select usr_login from kb3_user where usr_login like '."'%".$search."%'");
} elseif ($_POST['action'] == 'create') {
    $page->addContext($menubox->generate());
    $page->setContent('to be done');
    $page->generate();
} else {
    $hardcoded =& role::get(true);
    $softcoded =& role::get();
    $smarty->assignByRef('hroles', $hardcoded);
    $smarty->assignByRef('sroles', $softcoded);
コード例 #15
0
ファイル: alliance_detail.php プロジェクト: biow0lf/evedev-kb
 /**
  * Start constructing the page.
  * Prepare all the shared variables such as dates and check alliance ID.
  */
 function start()
 {
     $this->page = new Page();
     $this->all_id = (int) edkURI::getArg('all_id');
     $this->all_external_id = (int) edkURI::getArg('all_ext_id');
     if (!$this->all_id && !$this->all_external_id) {
         $this->all_id = (int) edkURI::getArg('id', 1);
         // And now a bit of magic to test if this is an external ID
         if ($this->all_id > 500000 && $this->all_id < 500021 || $this->all_id > 1000000) {
             $this->all_external_id = $this->all_id;
             $this->all_id = 0;
         }
     }
     $this->view = preg_replace('/[^a-zA-Z0-9_-]/', '', edkURI::getArg('view', 2));
     // Search engines should only index the main view.
     if ($this->view) {
         $this->page->addHeader('<meta name="robots" content="noindex, nofollow" />');
     }
     if (!$this->all_id && !$this->all_external_id) {
         $html = 'No valid alliance id specified.';
         $this->page->setContent($html);
         $this->page->generate();
         exit;
     }
     if (!$this->all_id && $this->all_external_id) {
         $this->alliance = new Alliance($this->all_external_id, true);
         $this->all_id = $this->alliance->getID();
         if (!$this->all_id) {
             echo 'No valid alliance id specified.';
             exit;
         }
     } else {
         $this->alliance = Cacheable::factory('Alliance', $this->all_id);
         $this->all_external_id = $this->alliance->getExternalID();
     }
     $this->page->addHeader("<link rel='canonical' href='" . $this->alliance->getDetailsURL() . "' />");
     if ($this->view) {
         $this->year = (int) edkURI::getArg('y', 3);
         $this->month = (int) edkURI::getArg('m', 4);
     } else {
         $this->year = (int) edkURI::getArg('y', 2);
         $this->month = (int) edkURI::getArg('m', 3);
     }
     if (!$this->month) {
         $this->month = kbdate('m');
     }
     if (!$this->year) {
         $this->year = kbdate('Y');
     }
     if ($this->month == 12) {
         $this->nmonth = 1;
         $this->nyear = $this->year + 1;
     } else {
         $this->nmonth = $this->month + 1;
         $this->nyear = $this->year;
     }
     if ($this->month == 1) {
         $this->pmonth = 12;
         $this->pyear = $this->year - 1;
     } else {
         $this->pmonth = $this->month - 1;
         $this->pyear = $this->year;
     }
     $this->monthname = kbdate("F", strtotime("2000-" . $this->month . "-2"));
     global $smarty;
     $smarty->assign('monthname', $this->monthname);
     $smarty->assign('year', $this->year);
     $smarty->assign('pmonth', $this->pmonth);
     $smarty->assign('pyear', $this->pyear);
     $smarty->assign('nmonth', $this->nmonth);
     $smarty->assign('nyear', $this->nyear);
     if ($this->alliance->isFaction()) {
         $this->page->setTitle(Language::get('page_faction_det') . ' - ' . $this->alliance->getName());
     } else {
         $this->page->setTitle(Language::get('page_all_det') . ' - ' . $this->alliance->getName());
     }
     $smarty->assign('all_name', $this->alliance->getName());
     $smarty->assign('all_id', $this->alliance->getID());
 }
コード例 #16
0
/**
 * @package EDK
 */
if (isset($_GET['c_id'])) {
    $_GET['c_id'] = intval($_GET['c_id']);
} else {
    $_GET['c_id'] = 0;
}
$page = new Page("Administration - Deletion of Comment ID \"" . $_GET['c_id'] . "\"");
$page->setAdmin();
if ($_POST['confirm']) {
    $qry = DBFactory::getDBQuery();
    $qry->execute("DELETE FROM kb3_comments WHERE id='" . $_GET['c_id'] . "'");
    $smarty->assign('deleted', true);
    $smarty->assign('id', $_GET['c_id']);
} else {
    $qry = DBFactory::getDBQuery();
    $qry->execute("SELECT id, name, comment FROM kb3_comments WHERE `id`='" . $_GET['c_id'] . "'");
    if ($qry->recordCount() == 0) {
        // no commment
        $smarty->assign('id', false);
    } else {
        if ($data = $qry->getRow()) {
            $smarty->assign('id', $data['id']);
            $smarty->assign('name', $data['name']);
            $smarty->assign('comment', $data['comment']);
        }
    }
}
$page->setContent($smarty->fetch(get_tpl('admin_comment_delete')));
$page->generate();
コード例 #17
0
ファイル: post.php プロジェクト: biow0lf/evedev-kb
    } else {
        $html = "Mail lock has been removed.";
    }
} else {
    if (isset($_POST['killmail'])) {
        $html = post();
    }
}
if (isset($html)) {
    $smarty->assign('error', $html);
}
$smarty->assign('isadmin', $page->isAdmin());
$smarty->assign('post_forbid', config::get('post_forbid'));
$smarty->assign('post_oog_forbid', config::get('post_oog_forbid'));
$smarty->assign('actionURL', edkURI::page("post"));
$page->setContent($smarty->fetch(get_tpl('post')));
$page->generate();
function post()
{
    global $page;
    if (config::get("post_password") == '' || crypt($_POST['password'], config::get("post_password")) == config::get("post_password") || $page->isAdmin()) {
        $parser = new Parser($_POST['killmail']);
        // Filtering
        if (config::get('filter_apply')) {
            $filterdate = config::get('filter_date');
            $year = substr($_POST['killmail'], 0, 4);
            $month = substr($_POST['killmail'], 5, 2);
            $day = substr($_POST['killmail'], 8, 2);
            $killstamp = mktime(0, 0, 0, $month, $day, $year);
            if ($killstamp < $filterdate) {
                $killid = -3;
コード例 #18
0
ファイル: index.php プロジェクト: skonina/maskarada_jekyll
error_reporting(E_ALL);
ini_set('display_errors', 'On');
function __autoload($class)
{
    if (file_exists("classes/{$class}.class.php")) {
        include "classes/{$class}.class.php";
    } else {
        include "../classes/{$class}.class.php";
    }
}
include "../config.php";
if (!isset($_SERVER['PHP_AUTH_USER']) || !($_SERVER['PHP_AUTH_USER'] == ADMIN_USER && $_SERVER['PHP_AUTH_PW'] == ADMIN_PASS)) {
    header('WWW-Authenticate: Basic realm="Logowanie"');
    header('HTTP/1.0 401 Unauthorized');
    echo 'Dostep ograniczony';
    exit;
}
$Page = new Page();
$cmd = @$_REQUEST["cmd"];
switch ($cmd) {
    default:
    case "kostiumy":
        $Page->setContent(new AdminKostiumy());
        break;
    case "grupy":
        $Page->setContent(new AdminGrupy());
        break;
}
include "tpl/header.php";
$Page->display();
include "tpl/footer.php";
コード例 #19
0
ファイル: page_create.php プロジェクト: jeffreycai/ct21
    }
    // validation for $content
    $content = isset($_POST["content"]) ? $_POST["content"] : null;
    if (empty($content)) {
        Message::register(new Message(Message::DANGER, i18n(array("en" => "content is required.", "zh" => "请填写content"))));
        $error_flag = true;
    }
    // validation for $published
    $published = isset($_POST["published"]) ? 1 : 0;
    /// proceed submission
    // proceed for $uri
    $object->setUri($uri);
    // proceed for $title
    $object->setTitle($title);
    // proceed for $content
    $object->setContent($content);
    // proceed for $published
    $object->setPublished($published);
    if ($error_flag == false) {
        if ($object->save()) {
            Message::register(new Message(Message::SUCCESS, i18n(array("en" => "Record saved", "zh" => "记录保存成功"))));
            HTML::forwardBackToReferer();
        } else {
            Message::register(new Message(Message::DANGER, i18n(array("en" => "Record failed to save", "zh" => "记录保存失败"))));
        }
    }
}
$html = new HTML();
$html->renderOut('core/backend/html_header', array('title' => i18n(array('en' => 'Create Page', 'zh' => 'Create 基本页面'))));
$html->output('<div id="wrapper">');
$html->renderOut('core/backend/header');
コード例 #20
0
ファイル: sig_list.php プロジェクト: biow0lf/evedev-kb
<?php

/**
 * @package EDK
 */
$page = new Page('Signature Listing');
$signatures = array();
$dir = opendir(dirname(__FILE__) . '/signatures');
while ($line = readdir($dir)) {
    if (file_exists(dirname(__FILE__) . '/signatures/' . $line . '/' . $line . '.php')) {
        $signatures[] = $line;
    }
}
$smarty->assign('signatures', $signatures);
$smarty->assign('kb_host', KB_HOST);
if (intval($_GET['ext'])) {
    $pilot = new Pilot(0, $_GET['ext']);
    $smarty->assign('pilot', intval($pilot->getID()));
} else {
    $smarty->assign('pilot', intval($_GET['i']));
}
$page->setContent($smarty->fetch('file:' . dirname(__FILE__) . '/sig_list.tpl'));
$page->generate();
コード例 #21
0
ファイル: admin_postperm.php プロジェクト: biow0lf/evedev-kb
            if ($typ == 'p') {
                $pilot = new Pilot($id);
                $text = $pilot->getName();
                $link = KB_HOST . '/?a=admin_postperm&amp;del=' . $typ . $id . '&amp;akey=' . session::makeKey();
                $permt[$typ][] = array('text' => $text, 'link' => $link);
            }
            if ($typ == 'c') {
                $corp = new Corporation($id);
                $text = $corp->getName();
                $link = KB_HOST . '/?a=admin_postperm&amp;del=' . $typ . $id . '&amp;akey=' . session::makeKey();
                $permt[$typ][] = array('text' => $text, 'link' => $link);
            }
        }
    }
    $perm = array();
    if ($permt['a']) {
        $perm[] = array('name' => 'Alliances', 'list' => $permt['a']);
    }
    if ($permt['p']) {
        $perm[] = array('name' => 'Pilots', 'list' => $permt['p']);
    }
    if ($permt['c']) {
        $perm[] = array('name' => 'Corporations', 'list' => $permt['c']);
    }
    $smarty->assignByRef('permissions', $perm);
}
$smarty->assign('akey', session::makeKey());
$html = $smarty->fetch(get_tpl('admin_postperm'));
$page->addContext($menubox->generate());
$page->setContent($html);
$page->generate();
コード例 #22
0
ファイル: admin.php プロジェクト: ununik/stmpl
$title = null;
function __autoload($name)
{
    include "methods/{$name}.class.php";
}
include_once "methods/functions.php";
$data = new Page();
if (isset($_GET['page']) && $_GET['page']) {
    $getPage = $_GET['page'];
} else {
    $getPage = "home";
}
$data->setNavigation(include_once "controllers/admin/navigation.php");
if ($getPage == "home") {
    $data->setHeader("<div id='header_home'><div><h1>Biatlon v srdci České Kanady</h1></div></div><div id='headerbox'>\n                      <h1>Klub biatlonu<br>Staré Město pod Landštejnem</h1>\n                      <h2>klub ze srdce České Kanady</h2>\n                      <div id='photoBoxAll'></div>\n                      </div>");
} else {
    $data->setHeader("<div id='header_all'>Staré Město pod Landštejnem</div>");
}
if (!isset($_SESSION['StMpL']) || $_SESSION['StMpL'] !== md5('StMpL2015')) {
    $data->setContent(include_once "controllers/admin/login.php");
} else {
    if (!file_exists("controllers/admin/{$getPage}.php")) {
        $data->setContent(include_once "controllers/noPage.php");
    } else {
        $data->setContent(include_once "controllers/admin/{$getPage}.php");
    }
}
$data->setTitle($title);
$data->setFooter(include_once "views/footer.php");
$page = (include_once "views/admin/page.php");
print $page;
コード例 #23
0
$where = join(' AND ', $where);
// And make it alphabetical
$sql .= $where . " ORDER BY itm.typeName";
$qry = DBFactory::getDBQuery();
$qry->execute($sql);
while ($row = $qry->getRow()) {
    $results[] = array('id' => $row['typeID'], 'name' => $row['typeName'], 'value' => $row['price']);
}
$smarty->assignByRef('results', $results);
// Stuff we don't want to display.
// There's a lot more than this, but the item DB has quite a few items and I haven't filtered it all out yet.
$bad_ids = array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 19, 23, 24, 32, 94, 95, 186, 190, 226, 227, 332);
$bad_ids = join(',', $bad_ids);
$bad_likes = array('itt_name not like "asteroid%"', 'itt_name not like "mission%"', 'itt_name not like "deadspace%"', 'itt_name not like "concord%"', 'itt_name not like "corvet%"');
$bad_likes = join(' AND ', $bad_likes);
// Query for the item types to fill in the top dropdown
$query_types = "SELECT itt_id, itt_name FROM kb3_item_types WHERE itt_id not in ({$bad_ids}) AND {$bad_likes} ORDER BY itt_name";
$qry->execute($query_types);
while ($row = $qry->getRow()) {
    $types[$row['itt_id']] = $row['itt_name'];
}
// Chuck it all at smarty
$smarty->assignByRef('item_types', $types);
$smarty->assign('mod', 'value_editor');
$smarty->assign('eve_central_exists', $eve_central_exists);
$smarty->assign('type', $type);
$smarty->assign('akey', session::makeKey());
$page->addContext($menubox->generate());
// override the smarty path, get the mod template, set it back.
$page->setContent($smarty->fetch(get_tpl('value_editor')));
$page->generate();
コード例 #24
0
ファイル: admin_upgrade.php プロジェクト: biow0lf/evedev-kb
                $lastPart = explode('/', $hostFileName);
                $codeList[$i]['short_name'] = $lastPart[count($lastPart) - 1];
                $cacheFileName = KB_CACHEDIR . "/update/" . $lastPart[count($lastPart) - 1];
                if (!file_exists($cacheFileName)) {
                    $codeList[$i]['cached'] = false;
                } else {
                    $codeList[$i]['cached'] = true;
                    if ($piece['hash'] == md5_file($cacheFileName)) {
                        $codeList[$i]['hash_match'] = true;
                    }
                }
                $i++;
            }
        }
    }
}
$time = Config::get('upd_cacheTime') + 86400;
// add a day
$update_time = date("Y-m-d G:i:s", $time);
$smarty->assign('update_time', $update_time);
$smarty->assign('dbList', $dbList);
$smarty->assign('codeList', $codeList);
$smarty->assign('page_error', $page_error);
$smarty->assign('DBmessage', $parser->getLatestDBMessage());
$smarty->assign('codemessage', $parser->getLatestCodeMessage());
$smarty->assign('dbversion', Config::get('upd_dbVersion'));
$smarty->assign('codeversion', KB_VERSION);
$smarty->assign('akey', session::makeKey());
$page->addContext($menubox->generate());
$page->setContent($smarty->fetch(get_tpl('admin_upgrade')));
$page->generate();
コード例 #25
0
     $content .= "</table>";
     $app->render('page.twig', array('content' => $content));
 })->name('list-pages');
 # Add routes for all pages.
 $app->map('/add-page/', function () use($app, $entityManager) {
     $content = array();
     if ($app->request->isPost()) {
         $content['name'] = $_POST['name'];
         $content['slug'] = $_POST['slug'];
         $content['content'] = $_POST['content'];
         $content['excerpt'] = $_POST['excerpt'];
         if (functions\CSRF::check($_POST['csrf'])) {
             $page = new Page();
             $page->setName($content['name']);
             $page->setSlug($content['slug'], $entityManager);
             $page->setContent($content['content']);
             $page->setExcerpt($content['excerpt']);
             $entityManager->persist($page);
             $entityManager->flush();
             $app->flash('message', 'Page Added Successfully!');
             $app->redirect($app->urlFor('message'));
         }
     }
     $app->render('pages/page-form.twig', array('content' => $content, 'csrf' => functions\CSRF::generate()));
 })->via('GET', 'POST')->name('add-page');
 $app->map('/pages/edit/:id/', function ($id) use($app, $entityManager) {
     $page = $entityManager->find('Page', $id);
     $content = array('name' => $page->getName(), 'slug' => $page->getSlug(), 'content' => $page->getContent(), 'excerpt' => $page->getExcerpt(), 'id' => $page->getId());
     if ($app->request->isPost()) {
         $content['name'] = $_POST['name'];
         $content['slug'] = $_POST['slug'];
コード例 #26
0
ファイル: action_Edit.php プロジェクト: JacoRuit/orongocms
     try {
         $page = new Page($id);
     } catch (Exception $e) {
         if ($e->getCode() == PAGE_NOT_EXIST) {
             header("Location: " . orongoURL("orongo-admin/manage.php?msg=0&obj=pages"));
             exit;
         } else {
             header("Location: " . orongoURL("orongo-admin/index.php?msg=2"));
             exit;
         }
     }
     if (!empty($_POST['title'])) {
         $page->setTitle($_POST['title']);
     }
     if (!empty($_POST['content'])) {
         $page->setContent($_POST['content']);
     }
     header("Location: " . orongoURL("orongo-admin/view.php?msg=1&obj=page&id=" . $page->getID()));
     exit;
     break;
 case "user":
     if (getUser()->getRank() < RANK_ADMIN && getUser()->getID() != $id) {
         header("Location: " . orongoURL("orongo-admin/index.php?msg=0"));
         exit;
     }
     if (!isset($_POST['new_password']) || !isset($_POST['new_email'])) {
         header("Location: " . orongoURL("orongo-admin/edit.php?user." . $id));
         exit;
     }
     if (!isset($_POST['password']) && getUser()->getRank() < RANK_ADMIN) {
         header("Location: " . orongoURL("orongo-admin/edit.php?user." . $id));
コード例 #27
0
ファイル: standings.php プロジェクト: biow0lf/evedev-kb
                $icon = 'bad';
            } else {
                $icon = 'horrible';
            }
        }
    }
    if ($typ == 'a') {
        $alliance = Alliance::getByID($id);
        $text = $alliance->getName();
        $pid = $alliance->getUnique();
        $link = edkURI::page('admin_standings', $typ . $row['sta_to'], 'del');
        $permt[$typ][] = array('text' => $text, 'link' => $link, 'all_url' => $alliance->getDetailsURL(), 'all_img' => $alliance->getPortraitURL(32), 'value' => $val, 'comment' => $row['sta_comment'], 'id' => $id, 'pid' => $pid, 'typ' => $row['sta_to'], 'icon' => $icon);
    } else {
        if ($typ == 'c') {
            $corp = Corporation::getByID((int) $row['sta_to']);
            $text = $corp->getName();
            $link = edkURI::page('admin_standings', $typ . $row['sta_to'], 'del');
            $permt[$typ][] = array('text' => $text, 'link' => $link, 'crp_url' => $corp->getDetailsURL(), 'crp_img' => $corp->getPortraitURL(32), 'value' => $val, 'comment' => $row['sta_comment'], 'id' => $id, 'typ' => $typ, 'icon' => $icon);
        }
    }
}
$perm = array();
if ($permt['a']) {
    $perm[] = array('name' => 'Alliances', 'list' => $permt['a']);
}
if ($permt['c']) {
    $perm[] = array('name' => 'Corporations', 'list' => $permt['c']);
}
$smarty->assignByRef('standings', $perm);
$page->setContent($smarty->fetch(get_tpl('standings')));
$page->generate();
コード例 #28
0
ファイル: admin_mods.php プロジェクト: biow0lf/evedev-kb
require_once 'common/admin/admin_menu.php';
$page = new Page('Administration - Mods');
$page->setAdmin();
if (isset($_POST['set_mods']) && $_POST['set_mods']) {
    foreach ($_POST as $key => $val) {
        if (substr($key, 0, 4) == "mod_" && $val == "on") {
            if (substr($key, 4, strlen($key) - 4) != 'item_values') {
                $activemods .= substr($key, 4, strlen($key) - 4) . ",";
            }
        }
    }
    $activemods = substr($activemods, 0, strlen($activemods) - 1);
    config::set("mods_active", $activemods);
}
$activemods = explode(",", config::get("mods_active"));
$rows = array();
if ($handle = opendir('mods')) {
    $modlist = array();
    while ($file = readdir($handle)) {
        if (is_dir("mods/{$file}") && $file != ".." & $file != "." & $file != ".svn") {
            $rows[$file] = array('name' => $file, 'url' => edkURI::page("settings_{$file}"), 'checked' => in_array($file, $activemods), 'settings' => file_exists("mods/{$file}/settings.php"));
        }
    }
    ksort($rows);
    closedir($handle);
}
$smarty->assign('rows', $rows);
$smarty->assign('url', edkURI::page("admin_mods"));
$page->setContent($smarty->fetch(get_tpl('admin_mods')));
$page->addContext($menubox->generate());
$page->generate();
コード例 #29
0
ファイル: corp_detail.php プロジェクト: biow0lf/evedev-kb
 /**
  * Start constructing the page.
  * Prepare all the shared variables such as dates and check alliance ID.
  *
  */
 function start()
 {
     $this->page = new Page('Corporation details');
     $this->scl_id = (int) edkURI::getArg('scl_id');
     $this->crp_id = (int) edkURI::getArg('crp_id');
     if (!$this->crp_id) {
         $this->crp_external_id = (int) edkURI::getArg('crp_ext_id');
         if (!$this->crp_external_id) {
             $id = (int) edkURI::getArg('id', 1);
             // True for NPC corps too, but NPC alliances recorded as corps
             // fail here. Use Jedi mind tricks?
             if ($id > 1000000) {
                 $this->crp_external_id = $id;
             } else {
                 $this->crp_id = $id;
             }
         }
     }
     $this->view = preg_replace('/[^a-zA-Z0-9_-]/', '', edkURI::getArg('view', 2));
     if ($this->view) {
         $this->page->addHeader('<meta name="robots" content="noindex, nofollow" />');
     }
     if (!$this->crp_id) {
         if ($this->crp_external_id) {
             $this->corp = new Corporation($this->crp_external_id, true);
             $this->crp_id = $this->corp->getID();
         } else {
             $html = 'That corporation does not exist.';
             $this->page->setContent($html);
             $this->page->generate();
             exit;
         }
     } else {
         $this->corp = Cacheable::factory('Corporation', $this->crp_id);
         $this->crp_external_id = $this->corp->getExternalID();
     }
     if ($this->crp_external_id) {
         $this->page->addHeader("<link rel='canonical' href='" . edkURI::build(array('crp_ext_id', $this->crp_external_id, true)) . "' />");
     } else {
         $this->page->addHeader("<link rel='canonical' href='" . edkURI::build(array('crp_id', $this->crp_id, true)) . "' />");
     }
     $this->alliance = $this->corp->getAlliance();
     if ($this->view) {
         $this->year = (int) edkURI::getArg('y', 3);
         $this->month = (int) edkURI::getArg('m', 4);
     } else {
         $this->year = (int) edkURI::getArg('y', 2);
         $this->month = (int) edkURI::getArg('m', 3);
     }
     if (!$this->month) {
         $this->month = kbdate('m');
     }
     if (!$this->year) {
         $this->year = kbdate('Y');
     }
     if ($this->month == 12) {
         $this->nmonth = 1;
         $this->nyear = $this->year + 1;
     } else {
         $this->nmonth = $this->month + 1;
         $this->nyear = $this->year;
     }
     if ($this->month == 1) {
         $this->pmonth = 12;
         $this->pyear = $this->year - 1;
     } else {
         $this->pmonth = $this->month - 1;
         $this->pyear = $this->year;
     }
     $this->monthname = kbdate("F", strtotime("2000-" . $this->month . "-2"));
 }