Example #1
0
 function details()
 {
     global $smarty;
     $item = new dogma($this->typeID);
     if (!$item->isValid()) {
         $this->page->setTitle('Error');
         return 'This ID is not a valid dogma ID.';
     }
     $this->page->setTitle('Item details - ' . $item->get('typeName'));
     $this->page->addHeader('<meta name="robots" content="noindex, nofollow" />');
     $smarty->assignByRef('item', $item);
     if ($item->get('itt_cat') == 6) {
         //we have a ship, so get it from the db
         $ship = Ship::getByID($item->get('typeID'));
         $smarty->assign('shipImage', $ship->getImage(64));
         $smarty->assign('armour', array('armorHP', 'armorEmDamageResonance', 'armorExplosiveDamageResonance', 'armorKineticDamageResonance', 'armorThermalDamageResonance'));
         $smarty->assign('shield', array('shieldCapacity', 'shieldRechargeRate', 'shieldEmDamageResonance', 'shieldExplosiveDamageResonance', 'shieldKineticDamageResonance', 'shieldThermalDamageResonance'));
         $smarty->assign('propulsion', array('maxVelocity', 'agility', 'droneCapacity', 'capacitorCapacity', 'rechargeRate'));
         $smarty->assign('fitting', array('hiSlots', 'medSlots', 'lowSlots', 'rigSlots', 'upgradeCapacity', 'droneBandwidth', 'launcherSlotsLeft', 'turretSlotsLeft', 'powerOutput', 'cpuOutput'));
         $smarty->assign('targetting', array('maxTargetRange', 'scanResolution', 'maxLockedTargets', 'scanRadarStrength', 'scanLadarStrength', 'scanMagnetometricStrength', 'scanGravimetricStrength', 'signatureRadius'));
         $smarty->assign('miscellaneous', array('techLevel', 'propulsionFusionStrength', 'propulsionIonStrength', 'propulsionMagpulseStrength', 'propulsionPlasmaStrength'));
         $html = $smarty->fetch(get_tpl('invtype_ship'));
     } else {
         $i = new Item($this->typeID);
         $smarty->assign('itemImage', $i->getIcon(64, false));
         $smarty->assign('akey', session::isAdmin() ? session::makeKey() : false);
         $html = $smarty->fetch(get_tpl('invtype_item'));
     }
     return $html;
 }
Example #2
0
 function generate()
 {
     global $smarty;
     if (!$this->split_ || $this->max_ / $this->split_ <= 1) {
         return;
     }
     $endpage = ceil($this->max_ / $this->split_);
     $args = edkURI::parseURI();
     if ($page = edkURI::getArg('page')) {
         if (edkURI::getArg('page')) {
             foreach ($args as $key => $value) {
                 if ($value[0] == 'page') {
                     unset($args[$key]);
                     break;
                 }
             }
         }
     } else {
         $page = 1;
     }
     $url = edkURI::build($args);
     if (strpos($url, '?') === false) {
         $url .= "?";
     } else {
         $url .= "&amp;";
     }
     $smarty->assign('splitter_endpage', $endpage);
     $smarty->assign('splitter_page', $page);
     $smarty->assign('splitter_url', $url);
     return $smarty->fetch(get_tpl('pagesplitter'));
 }
Example #3
0
function use_keh()
{
    // получаем имя файла
    //$_name_file_keh=get_name_file_keh();
    $_name_file_keh = parse_for_url(get_post_session()) . ".keh";
    // debug ceche
    if (DEBUG_KEH == 1) {
        echo " Начало - " . $_name_file_keh;
    }
    // ищем сгенеренный кеш
    if (file_exists(HOST . '/cache/' . $_GET['action'] . '/' . $_name_file_keh)) {
        //echo "keh!!!";
        $_str .= get_tpl('/cache/' . $_GET['action'] . '/' . $_name_file_keh);
        // выводим содержимое
        /*
         * парсим банер
         */
        // елементы для замены
        $mass_element_for_parsing = array("%banner%");
        $mass_result_for_parsing = array(_BANNER);
        // парсим данные
        $_str = parsing_data($mass_element_for_parsing, $mass_result_for_parsing, $_str);
        // debug ceche
        if (DEBUG_KEH == 1) {
            echo " | keh!!!";
        }
        die($_str);
    } else {
        // debug ceche
        if (DEBUG_KEH == 1) {
            echo " | NO keh!!!";
        }
    }
}
Example #4
0
function run_template($request, $page)
{
    $tpl_main = get_tpl('main');
    $tpl = $page['type'] == 'event' ? 'event' : 'info';
    $tpl_page = get_tpl($tpl);
    /*--- globals ---*/
    $translate = array('[title]' => TITLE, '[base_url]' => BASE_URL, '{title}' => $page['title']);
    $tpl_main = translate_tpl($tpl_main, $translate);
    /*--- page ---*/
    $translate = array('{event_join}' => $page['event_join'], '{event_people}' => $page['event_people'], '{event_author}' => $page['author'], '{after_text}' => $page['after_text']);
    $tpl_page = translate_tpl($tpl_page, $translate);
    $translate = array('{title}' => $page['title'], '{text}' => $page['text']);
    $tpl_page = translate_tpl($tpl_page, $translate, true);
    /*--- place page in main ---*/
    $translate = array('@before_page' => $page['before_text'], '@page' => $tpl_page, '@after_page' => $page['after_text']);
    $html = translate_tpl($tpl_main, $translate);
    /*--- save html as cache ---*/
    if (CACHE && !isset($page['no_cache'])) {
        $cachefile = './pages/' . $request . '.html';
        if (file_exists($cachefile) == false) {
            file_put_contents($cachefile, $html);
        }
    }
    return $html;
}
Example #5
0
 protected function is_cached($tpl = null)
 {
     if (C("SMARTY_ON")) {
         halt("请先开启smarty");
     }
     $tpl = $this - get_tpl($tpl);
     return self::$smarty->is_cached($tpl, $_SERVER['REQUEST_URI']);
 }
Example #6
0
function display_flashes(&$flash)
{
    foreach ($flash as $k => $v) {
        if ($v) {
            get_tpl('_flash', array('status' => $k, 'messages' => $v));
            $flash[$k] = array();
        }
    }
}
Example #7
0
 /**
  * Generate the html from the template.
  *
  * @global Smarty $smarty
  * @return string
  */
 function generate()
 {
     global $smarty;
     $smarty->assign('count', count($this->box_array));
     if ($this->icon_) {
         $smarty->assign('icon', config::get('cfg_img') . "/" . $this->icon_);
     }
     $smarty->assign('title', $this->title_);
     $smarty->assign('items', $this->box_array);
     return $smarty->fetch(get_tpl('box'));
 }
Example #8
0
 function generate()
 {
     global $smarty;
     $this->toplist->generate();
     while ($row = $this->toplist->getRow()) {
         $item = new Item($row['itm_id']);
         $rows[] = array('rank' => false, 'name' => $item->getName(), 'uri' => edkURI::build(array('a', 'invtype', true), array('id', $item->getID(), true)), 'icon' => $item->getIcon(32), 'count' => $row['cnt']);
     }
     $smarty->assign('tl_name', Language::get('weapon'));
     $smarty->assign('tl_type', Language::get('kills'));
     $smarty->assignByRef('tl_rows', $rows);
     return $smarty->fetch(get_tpl('toplisttable'));
 }
Example #9
0
 /**
  * Retrieve formatted html comments for a kill.
  *
  * The kill id is set when the Comments object is constructed.
  *
  * @global Smarty $smarty
  * @param boolean $commentsOnly
  * @return string
  */
 function getHtml($commentsOnly = false)
 {
     global $smarty;
     if (empty($this->comments_)) {
         $this->getComments();
     }
     $smarty->assignByRef('comments', $this->comments_);
     $smarty->assign('norep', time() % 3700);
     $smarty->assign('akey', session::isAdmin() ? session::makeKey() : false);
     if ($commentsOnly) {
         return $smarty->fetch(get_tpl('comments_comments'));
     } else {
         return $smarty->fetch(get_tpl('block_comments'));
     }
 }
Example #10
0
 function generate()
 {
     global $smarty;
     $this->toplist->generate();
     while ($row = $this->toplist->getRow()) {
         $ship = Ship::getByID($row['shp_id']);
         $shipclass = $ship->getClass();
         $shipclass->getName();
         $rows[] = array('rank' => false, 'name' => $ship->getName(), 'subname' => $shipclass->getName(), 'uri' => edkURI::page('invtype', $ship->getID()), 'portrait' => $ship->getImage(32), 'count' => $row['cnt']);
     }
     $smarty->assign('tl_name', Language::get('ship'));
     $smarty->assign('tl_type', Language::get('kills'));
     $smarty->assignByRef('tl_rows', $rows);
     return $smarty->fetch(get_tpl('toplisttable'));
 }
Example #11
0
 /**
  * Generate the HTML for this BarGraph.
  *
  * @global type $smarty
  * @return string HTML for this bar.
  */
 function generate()
 {
     if ($this->text == "") {
         $this->text = "&nbsp;";
     }
     if ($this->value) {
         $width = (int) (100 * $this->value / $this->max);
     } else {
         $width = 0;
     }
     global $smarty;
     $smarty->assign('class', $this->class);
     $smarty->assign('width', $width);
     $smarty->assign('text', $this->text);
     return $smarty->fetch(get_tpl("bargraph"));
 }
Example #12
0
 function display()
 {
     global $smarty;
     $alls = $corps = $pilots = false;
     if (config::get('cfg_allianceid')) {
         $alls = array();
         foreach (config::get('cfg_allianceid') as $entity) {
             $alliance = new Alliance($entity);
             if ($alliance->getExternalID()) {
                 $url = edkURI::page('alliance_detail', $alliance->getExternalID(), 'all_ext_id');
             } else {
                 $url = edkURI::page('alliance_detail', $alliance->getID(), 'all_id');
             }
             $alls[] = array('id' => $alliance->getID(), 'extid' => $alliance->getExternalID(), 'name' => $alliance->getName(), 'portrait' => $alliance->getPortraitURL(128), 'url' => $url);
         }
     }
     if (config::get('cfg_corpid')) {
         $corps = array();
         foreach (config::get('cfg_corpid') as $entity) {
             $corp = new Corporation($entity);
             if ($corp->getExternalID()) {
                 $url = edkURI::page('corp_detail', $corp->getExternalID(), 'crp_ext_id');
             } else {
                 $url = edkURI::page('corp_detail', $corp->getID(), 'crp_id');
             }
             $corps[] = array('id' => $corp->getID(), 'extid' => $corp->getExternalID(), 'name' => $corp->getName(), 'portrait' => $corp->getPortraitURL(128), 'url' => $url);
         }
     }
     if (config::get('cfg_pilotid')) {
         $pilots = array();
         foreach (config::get('cfg_pilotid') as $entity) {
             $pilot = new Pilot($entity);
             if ($pilot->getExternalID()) {
                 $url = edkURI::page('pilot_detail', $pilot->getExternalID(), 'plt_ext_id');
             } else {
                 $url = edkURI::page('pilot_detail', $pilot->getID(), 'plt_id');
             }
             $pilots[] = array('id' => $pilot->getID(), 'extid' => $pilot->getExternalID(), 'name' => $pilot->getName(), 'portrait' => $pilot->getPortraitURL(128), 'url' => $url);
         }
     }
     $smarty->assignByRef('alliances', $alls);
     $smarty->assignByRef('corps', $corps);
     $smarty->assignByRef('pilots', $pilots);
     return $smarty->fetch(get_tpl('self'));
 }
function parsing_tpl($name_file, $mass_element_for_parsing, $mass_result_for_parsing, $_str_ = "")
{
    if (count($mass_element_for_parsing) > 0) {
        // открываем файл tpl, считывем, парсим и выводим
        $filename = HOST . "" . $name_file;
        //    echo $filename."<br><br>";
        $fp = fopen($filename, 'r');
        $output = fread($fp, filesize($filename));
        fclose($fp);
        for ($i = 0; $i < count($mass_element_for_parsing); $i++) {
            // парсим
            @($output = replace_data($output, $mass_element_for_parsing[$i], $mass_result_for_parsing[$i]));
        }
    } else {
        $output = get_tpl($name_file);
    }
    return $_str_ . "" . $output;
}
 /**
  * Generate the output html from the template file.
  */
 function generate()
 {
     global $smarty;
     $rows = array();
     $max = 0;
     for ($i = 1; $i <= $this->length_; $i++) {
         $row = $this->toplist_->getRow();
         if ($row) {
             $rows[] = $row;
         }
         if ($row['cnt'] > $max) {
             $max = $row['cnt'];
         }
     }
     if (empty($rows)) {
         return;
     }
     $pilot = new Pilot($rows[0]['plt_id']);
     $smarty->assign('title', $this->title_);
     $smarty->assign('pilot_portrait', $pilot->getPortraitURL(64));
     $smarty->assign('award_img', config::get('cfg_img') . "/awards/" . $this->award_ . ".png");
     $smarty->assign('url', edkURI::build(array('a', 'pilot_detail', true), array('plt_id', $rows[0]['plt_id'], true)));
     $smarty->assign('name', $pilot->getName());
     $bar = new BarGraph($rows[0]['cnt'], $max);
     $smarty->assign('bar', $bar->generate());
     $smarty->assign('cnt', $rows[0]['cnt']);
     for ($i = 2; $i < $this->length_ + 1; $i++) {
         if (!$rows[$i - 1]['plt_id']) {
             break;
         } else {
             if (!$rows[$i - 1]['plt_name']) {
                 $pilot = new Pilot($rows[$i - 1]['plt_id']);
                 $pilotname = $pilot->getName();
             } else {
                 $pilotname = $rows[$i - 1]['plt_name'];
             }
         }
         $bar = new BarGraph($rows[$i - 1]['cnt'], $max);
         $top[$i] = array('url' => edkURI::build(array('a', 'pilot_detail', true), array('plt_id', $rows[$i - 1]['plt_id'], true)), 'name' => $pilotname, 'bar' => $bar->generate(), 'cnt' => $rows[$i - 1]['cnt']);
     }
     $smarty->assign('top', $top);
     $smarty->assign('comment', $this->comment_);
     return $smarty->fetch(get_tpl('award_box'));
 }
Example #15
0
 function content()
 {
     global $smarty;
     if (trim($_POST['usrpass'])) {
         if ($_POST['usrlogin'] == '' && $_POST['usrpass'] == ADMIN_PASSWORD && substr(ADMIN_PASSWORD, 0, 3) != '$1$' && substr(ADMIN_PASSWORD, 0, 3) != '$2$' && substr(ADMIN_PASSWORD, 0, 3) != '$2a$') {
             @chmod("kbconfig.php", 0660);
             if (!is_writeable("kbconfig.php")) {
                 $smarty->assign('error', 'Admin password is unencrypted and ' . 'kbconfig.php is not writeable. Either encrypt the admin ' . 'password or set kbconfig.php writeable.');
             } else {
                 $kbconfig = file_get_contents('kbconfig.php');
                 $newpwd = preg_replace('/(\\$|\\\\)/', '\\\\$1', crypt(ADMIN_PASSWORD));
                 $kbconfig = preg_replace('/define\\s*\\(\\s*[\'"]ADMIN_PASSWORD[\'"]' . '[^)]*\\)/', "define('ADMIN_PASSWORD', '" . $newpwd . "')", $kbconfig);
                 file_put_contents("kbconfig.php", trim($kbconfig));
                 chmod("kbconfig.php", 0440);
                 session::create(true);
                 session_write_close();
                 header('Location: ' . htmlspecialchars_decode(edkURI::page('admin') . '&akey=' . session::makeKey()));
                 //session created but not in current page
                 die;
             }
         } else {
             if ($_POST['usrlogin'] == '' && crypt($_POST['usrpass'], ADMIN_PASSWORD) == ADMIN_PASSWORD) {
                 session::create(true);
                 $page = preg_replace('/[^a-zA-Z0-9-_]/', '', edkURI::getArg("page", 1));
                 $page = $page ? $page : "admin";
                 header('Location: ' . htmlspecialchars_decode(edkURI::page('admin') . '&akey=' . session::makeKey()));
                 //session created but not in current page
                 session_write_close();
                 die;
             } else {
                 $result = user::login($_POST['usrlogin'], $_POST['usrpass']);
                 if ($result) {
                     header('Location: ' . html_entity_decode(edkURI::page('home')));
                     die;
                 } else {
                     $smarty->assign('error', 'Login error, please check your username and password.');
                 }
             }
         }
     }
     return $smarty->fetch(get_tpl('user_login'));
 }
Example #16
0
 function generate()
 {
     global $smarty;
     $this->toplist->generate();
     $i = 1;
     while ($row = $this->toplist->getRow()) {
         /* @var $corp Corporation */
         $corp = Cacheable::factory('Corporation', $row['crp_id']);
         if ($corp->getExternalID()) {
             $uri = KB_HOST . "/?a=corp_detail&amp;crp_ext_id=" . $corp->getExternalID();
         } else {
             $uri = KB_HOST . "/?a=corp_detail&amp;crp_id=" . $row['crp_id'];
         }
         $rows[] = array('rank' => $i, 'name' => $corp->getName(), 'uri' => $uri, 'portrait' => imageURL::getURL('Corporation', $corp->getExternalID(false), 32), 'count' => $row['cnt']);
         $i++;
     }
     $smarty->assign('tl_name', 'Corporation');
     $smarty->assign('tl_type', $this->entity_);
     $smarty->assignByRef('tl_rows', $rows);
     return $smarty->fetch(get_tpl('toplisttable'));
 }
Example #17
0
 function details()
 {
     global $smarty;
     if (!$this->groupID) {
         $this->page->setTitle('Error');
         return 'This ID is not a valid group ID.';
     }
     $sql = 'SELECT * FROM kb3_item_types d' . ' WHERE d.itt_id = ' . $this->groupID;
     $qry = DBFactory::getDBQuery();
     $qry->execute($sql);
     $row = $qry->getRow();
     $this->page->setTitle('Item Database - ' . $row['itt_name'] . ' Index');
     $sql = 'SELECT * FROM kb3_invtypes d' . ' WHERE d.groupID = ' . $this->groupID . ' ORDER BY d.typeName ASC';
     $qry = DBFactory::getDBQuery();
     $qry->execute($sql);
     $rows = array();
     while ($row = $qry->getRow()) {
         $rows[] = array('typeID' => $row['typeID'], 'typeName' => $row['typeName']);
     }
     $smarty->assign('rows', $rows);
     $smarty->assign('actionURL', edkURI::page('invtype'));
     return $smarty->fetch(get_tpl('groupdb'));
 }
Example #18
0
 function generate()
 {
     global $smarty;
     $this->toplist->generate();
     $i = 1;
     $rows = array();
     while ($row = $this->toplist->getRow()) {
         $pilot = Pilot::getByID($row['plt_id']);
         if ($row['plt_externalid']) {
             $uri = edkURI::build(array('a', 'pilot_detail', true), array('plt_ext_id', $row['plt_externalid'], true));
             $img = imageURL::getURL('Pilot', $row['plt_externalid'], 32);
         } else {
             $uri = edkURI::build(array('a', 'pilot_detail', true), array('plt_id', $row['plt_id'], true));
             $img = $pilot->getPortraitURL(32);
         }
         $rows[] = array('rank' => $i, 'name' => $pilot->getName(), 'uri' => $uri, 'portrait' => $img, 'count' => $row['cnt']);
         $i++;
     }
     $smarty->assign('tl_name', 'Pilot');
     $smarty->assign('tl_type', $this->entity_);
     $smarty->assignByRef('tl_rows', $rows);
     return $smarty->fetch(get_tpl('toplisttable'));
 }
Example #19
0
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();
Example #20
0
<?php

$submit = 'Add';
$method = 'POST';
$form_classes = array('col-sm-5');
$form_parts[] = '_add_post_fields';
include get_tpl('_base_form');
Example #21
0
            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();
Example #22
0
<?php

$templates[] = '_blog';
include get_tpl('_base');
Example #23
0
 * 74cms 培训课程详细页
 * ============================================================================
 * 版权所有: 骑士网络,并保留所有权利。
 * 网站地址: http://www.74cms.com;
 * ----------------------------------------------------------------------------
 * 这不是一个自由软件!您只能在不用于商业目的的前提下对程序代码进行修改和
 * 使用;不允许对程序代码以任何形式任何目的的再发布。
 * ============================================================================
*/
define('IN_QISHI', true);
$alias = "QS_train_lecturershow";
require_once dirname(__FILE__) . '/../include/common.inc.php';
if ($_PLUG['train']['p_install'] == 1) {
    $link[0]['text'] = "返回首页";
    $link[0]['href'] = $_CFG['site_dir'];
    showmsg("管理员已关闭此模块!", 1, $link);
}
if ($mypage['caching'] > 0) {
    $smarty->cache = true;
    $smarty->cache_lifetime = $mypage['caching'];
} else {
    $smarty->cache = false;
}
$cached_id = $alias . (isset($_GET['id']) ? "|" . intval($_GET['id']) % 100 . '|' . intval($_GET['id']) : '') . (isset($_GET['page']) ? "|p" . intval($_GET['page']) % 100 : '');
require_once QISHI_ROOT_PATH . 'include/mysql.class.php';
$db = new mysql($dbhost, $dbuser, $dbpass, $dbname);
unset($dbhost, $dbuser, $dbpass, $dbname);
$mypage['tpl'] = get_tpl("train_profile", $_GET['id']) . $mypage['tpl'];
$smarty->display($mypage['tpl'], $cached_id);
$db->close();
unset($smarty);
 function generate()
 {
     if ($this->klist) {
         $entry = array();
         // build array
         $sql = "select scl_id, scl_class\n                    from kb3_ship_classes\n                   where scl_class not in ( 'Drone', 'Unknown' )\n                  order by scl_class";
         $qry = DBFactory::getDBQuery();
         $qry->execute($sql) or die($qry->getErrorMsg());
         while ($row = $qry->getRow()) {
             if (!$row['scl_id']) {
                 continue;
             }
             $entry[$row['scl_class']]['id'] = $row['scl_id'];
             $entry[$row['scl_class']]['kills'] = 0;
             $entry[$row['scl_class']]['kills_isk'] = 0;
         }
         while ($kill = $this->klist->getKill()) {
             $classname = $kill->getVictimShipClassName();
             $entry[$classname]['kills']++;
             $entry[$classname]['kills_isk'] += $kill->getISKLoss();
             $this->tkcount++;
             $this->tkisk += $kill->getISKLoss();
         }
     } else {
         $this->getkills();
         $entry =& $this->entry;
     }
     // Don't count noobships.
     $num = count($entry) - 1;
     $summary = array();
     $count = 0;
     $args = edkURI::parseURI();
     if (edkURI::getArg('scl_id')) {
         foreach ($args as $key => $value) {
             if ($value[0] == 'scl_id') {
                 unset($args[$key]);
                 break;
             }
         }
     }
     $qrystring = edkURI::build($args);
     $clearfilter = $qrystring;
     if (strpos($qrystring, '?') === false) {
         $qrystring .= "?";
     } else {
         $qrystring .= "&amp;";
     }
     foreach ($entry as $k => $v) {
         if ($v['id'] == 3) {
             continue;
         }
         $v['break'] = 0;
         if ($_GET['scl_id'] && $_GET['scl_id'] == $v['id']) {
             $v['hl'] = 1;
         } else {
             $v['hl'] = 0;
         }
         $v['qry'] = $qrystring;
         $v['kisk'] = round($v['kills_isk'] / 1000000, 2);
         $v['name'] = $k;
         $summary[] = $v;
         $this->tkcount += $kcount;
         $this->tkisk += $kisk;
         $this->tkpoints += $kpoints;
         $count++;
     }
     global $smarty;
     $smarty->assign('summary', $summary);
     $smarty->assign('count', $num);
     $smarty->assign('verbose', $this->verbose);
     $smarty->assign('filter', $this->filter);
     if (config::get('summarytable_summary')) {
         $smarty->assign('summarysummary', 1);
         $smarty->assign('efficiency', 0);
         $smarty->assign('kiskB', round($this->tkisk / 1000000000, 2));
         $smarty->assign('kiskM', round($this->tkisk / 1000000, 2));
         $smarty->assign('kcount', $this->tkcount);
         if (config::get('summarytable_collapsed')) {
             $smarty->assign('summarycollapsed', 1);
         }
     }
     if (edkURI::getArg('scl_id')) {
         $smarty->assign('clearfilter', $clearfilter);
     }
     $html .= $smarty->fetch(get_tpl('summarytable'));
     return $html;
 }
Example #25
0
/*
 * 74cms 职位详细页
 * ============================================================================
 * 版权所有: 骑士网络,并保留所有权利。
 * 网站地址: http://www.74cms.com;
 * ----------------------------------------------------------------------------
 * 这不是一个自由软件!您只能在不用于商业目的的前提下对程序代码进行修改和
 * 使用;不允许对程序代码以任何形式任何目的的再发布。
 * ============================================================================
*/
define('IN_QISHI', true);
$alias = "QS_jobsshow";
require_once dirname(__FILE__) . '/../include/common.inc.php';
if (browser() == "mobile" && $_GET['iswap'] == "") {
    header("location:" . $_CFG['wap_domain'] . '/jobs-show.php?id=' . intval($_GET['id']));
}
if ($mypage['caching'] > 0) {
    $smarty->cache = true;
    $smarty->cache_lifetime = $mypage['caching'];
} else {
    $smarty->cache = false;
}
$cached_id = $alias . (isset($_GET['id']) ? "|" . intval($_GET['id']) % 100 . '|' . intval($_GET['id']) : '') . (isset($_GET['page']) ? "|p" . intval($_GET['page']) % 100 : '');
require_once QISHI_ROOT_PATH . 'include/mysql.class.php';
$db = new mysql($dbhost, $dbuser, $dbpass, $dbname);
unset($dbhost, $dbuser, $dbpass, $dbname);
echo 33;
$mypage['tpl'] = get_tpl("jobs", $_GET['id']) . $mypage['tpl'];
$smarty->display($mypage['tpl'], $cached_id);
$db->close();
unset($smarty);
Example #26
0
    $page['before_text'] = translate_tpl($page['before_text'], $translate);
}
// check for register teaser
if ((isset($show_teaser) || $user->read_cookie('login', 'show') == 3) && $user->login == true) {
    $log .= '[ show register teaser ]';
    // show login form
    $page['before_text'] = get_tpl('register-teaser');
    $translate = array('{title}' => $page['title']);
    $page['before_text'] = translate_tpl($page['before_text'], $translate);
}
// show current join status
if (!isset($status)) {
    $status = $user->joined($page['title']) ? 'joined' : 'join';
}
require_once './template.php';
$page['event_join'] = get_tpl('event-' . $status);
$log .= '[ join-status is ' . $status . ' ]';
// show others comming
require_once './db.php';
$people = mysql_select_array("SELECT `username` FROM `joined` WHERE `event_title` = '" . mysql_rescue($page['title']) . "'");
if (!empty($people)) {
    $page['event_people'] = '';
    foreach ($people as $person) {
        $page['event_people'] .= '<a href="./index.php?p=' . $person['username'] . '" class="person">' . $person['username'] . '</a>, ';
    }
    $page['event_people'] = trim($page['event_people'], ', ');
} else {
    $page['event_people'] = 'nog niemand..';
}
// add list of events
require_once './specials/events.php';
Example #27
0
/*
 * 74cms 简历详细页面
 * ============================================================================
 * 版权所有: 骑士网络,并保留所有权利。
 * 网站地址: http://www.74cms.com;
 * ----------------------------------------------------------------------------
 * 这不是一个自由软件!您只能在不用于商业目的的前提下对程序代码进行修改和
 * 使用;不允许对程序代码以任何形式任何目的的再发布。
 * ============================================================================
*/
define('IN_QISHI', true);
$alias = "QS_resumeshow";
require_once dirname(__FILE__) . '/../include/common.inc.php';
if (browser() == "mobile" && $_GET['iswap'] == "") {
    header("location:" . $_CFG['wap_domain'] . '/resume-show.php?id=' . intval($_GET['id']));
}
if ($mypage['caching'] > 0) {
    $smarty->cache = true;
    $smarty->cache_lifetime = $mypage['caching'];
} else {
    $smarty->cache = false;
}
$cached_id = $alias . (isset($_GET['id']) ? "|" . intval($_GET['id']) % 100 . '|' . intval($_GET['id']) : '') . (isset($_GET['page']) ? "|p" . intval($_GET['page']) % 100 : '');
require_once QISHI_ROOT_PATH . 'include/mysql.class.php';
$db = new mysql($dbhost, $dbuser, $dbpass, $dbname);
unset($dbhost, $dbuser, $dbpass, $dbname);
$mypage['tpl'] = get_tpl("resume", $_GET['id']) . $mypage['tpl'];
$smarty->display($mypage['tpl'], $cached_id);
$db->close();
unset($smarty);
Example #28
0
<?php

$titles[] = 'Register';
if ($s['user']) {
    add_flash('warning', "You can't create new users during the session");
    go_home();
}
if ($p) {
    $error_messages = validate('register', $p);
    if ($error_messages) {
        foreach ($error_messages as $msg) {
            add_flash('danger', $msg);
        }
    } else {
        $model['user']['create']($p);
        login_user($p['name'], $p['password']);
    }
}
include get_tpl('register');
Example #29
0
 * ============================================================================
 * 版权所有: 骑士网络,并保留所有权利。
 * 网站地址: http://www.74cms.com;
 * ----------------------------------------------------------------------------
 * 这不是一个自由软件!您只能在不用于商业目的的前提下对程序代码进行修改和
 * 使用;不允许对程序代码以任何形式任何目的的再发布。
 * ============================================================================
*/
define('IN_QISHI', true);
$alias = "QS_shop_show";
require_once 'shop_common.php';
$id = $_GET['id'] ? intval($_GET['id']) : 0;
$smarty->assign("shop_nav", "all");
$smarty->assign("id", $id);
if ($mypage['caching'] > 0) {
    $smarty->cache = true;
    $smarty->cache_lifetime = $mypage['caching'];
} else {
    $smarty->cache = false;
}
$cached_id = $alias . (isset($_GET['id']) ? "|" . intval($_GET['id']) % 100 . '|' . intval($_GET['id']) : '') . (isset($_GET['page']) ? "|p" . intval($_GET['page']) % 100 : '');
if (!$smarty->is_cached($mypage['tpl'], $cached_id)) {
    require_once QISHI_ROOT_PATH . 'include/mysql.class.php';
    $db = new mysql($dbhost, $dbuser, $dbpass, $dbname);
    $mypage['tpl'] = get_tpl("shop", $_GET['id']) . $mypage['tpl'];
    $smarty->display($mypage['tpl'], $cached_id);
    $db->close();
} else {
    $smarty->display($mypage['tpl'], $cached_id);
}
unset($smarty);
Example #30
0
 function awards()
 {
     if (isset($this->viewList[$this->view])) {
         return call_user_func_array($this->viewList[$this->view], array(&$this));
     }
     global $smarty;
     $awardboxes = array();
     // top killers
     $tklist = new TopList_Kills();
     $tklist->setMonth($this->month);
     $tklist->setYear($this->year);
     involved::load($tklist, 'kill');
     $tklist->generate();
     $tkbox = new AwardBox($tklist, Language::get('topkillers'), Language::get('kills'), "kills", "eagle");
     $awardboxes[] = $tkbox->generate();
     // top scorers
     if (config::get('kill_points')) {
         $tklist = new TopList_Score();
         $tklist->setMonth($this->month);
         $tklist->setYear($this->year);
         involved::load($tklist, 'kill');
         $tklist->generate();
         $tkbox = new AwardBox($tklist, Language::get('topscorers'), Language::get('top_points'), "points", "redcross");
         $awardboxes[] = $tkbox->generate();
     }
     // top solo killers
     $tklist = new TopList_SoloKiller();
     $tklist->setMonth($this->month);
     $tklist->setYear($this->year);
     involved::load($tklist, 'kill');
     $tklist->generate();
     $tkbox = new AwardBox($tklist, Language::get('top_solo'), Language::get('top_solo_desc'), "kills", "cross");
     $awardboxes[] = $tkbox->generate();
     // top damage dealers
     $tklist = new TopList_DamageDealer();
     $tklist->setMonth($this->month);
     $tklist->setYear($this->year);
     involved::load($tklist, 'kill');
     $tklist->generate();
     $tkbox = new AwardBox($tklist, Language::get('top_damage'), Language::get('top_damage_desc'), "kills", "wing1");
     $awardboxes[] = $tkbox->generate();
     // top final blows
     $tklist = new TopList_FinalBlow();
     $tklist->setMonth($this->month);
     $tklist->setYear($this->year);
     involved::load($tklist, 'kill');
     $tklist->generate();
     $tkbox = new AwardBox($tklist, Language::get('top_final'), Language::get('top_final_desc'), "kills", "skull");
     $awardboxes[] = $tkbox->generate();
     // top podkillers
     $tklist = new TopList_Kills();
     $tklist->setMonth($this->month);
     $tklist->setYear($this->year);
     involved::load($tklist, 'kill');
     $tklist->addVictimShipClass(2);
     // pod
     $tklist->generate();
     $tkbox = new AwardBox($tklist, Language::get('top_podkill'), Language::get('top_podkill_desc'), "kills", "globe");
     $awardboxes[] = $tkbox->generate();
     // top griefers
     $tklist = new TopList_Kills();
     $tklist->setMonth($this->month);
     $tklist->setYear($this->year);
     involved::load($tklist, 'kill');
     $tklist->addVictimShipClass(20);
     // freighter
     $tklist->addVictimShipClass(22);
     // exhumer
     $tklist->addVictimShipClass(7);
     // industrial
     $tklist->addVictimShipClass(12);
     // barge
     $tklist->addVictimShipClass(14);
     // transport
     $tklist->addVictimShipClass(39);
     // industrial command
     $tklist->addVictimShipClass(43);
     // exploration ship
     $tklist->addVictimShipClass(29);
     // capital industrial
     $tklist->generate();
     $tkbox = new AwardBox($tklist, Language::get('top_griefer'), Language::get('top_griefer_desc'), "kills", "star");
     $awardboxes[] = $tkbox->generate();
     // top capital killers
     $tklist = new TopList_Kills();
     $tklist->setMonth($this->month);
     $tklist->setYear($this->year);
     involved::load($tklist, 'kill');
     $tklist->addVictimShipClass(20);
     // freighter
     $tklist->addVictimShipClass(19);
     // dread
     $tklist->addVictimShipClass(27);
     // carrier
     $tklist->addVictimShipClass(28);
     // mothership
     $tklist->addVictimShipClass(26);
     // titan
     $tklist->addVictimShipClass(29);
     // cap. industrial
     $tklist->generate();
     $tkbox = new AwardBox($tklist, Language::get('top_isk_kill'), Language::get('top_isk_kill_desc'), "kills", "wing2");
     $awardboxes[] = $tkbox->generate();
     $monthname = kbdate("F", strtotime("2000-" . $this->month . "-2"));
     $smarty->assignByRef('awardboxes', $awardboxes);
     $smarty->assign('month', $monthname);
     $smarty->assign('year', $this->year);
     $smarty->assign('boxcount', count($awardboxes));
     $smarty->assign('page_title', Language::get('page_awards_for') . " " . $monthname . " " . $this->year);
     return $smarty->fetch(get_tpl('awards'));
 }