本文整理汇总了PHP中get_tpl函数的典型用法代码示例。如果您正苦于以下问题:PHP get_tpl函数的具体用法?PHP get_tpl怎么用?PHP get_tpl使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_tpl函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: details
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;
}
开发者ID:biow0lf,项目名称:evedev-kb,代码行数:30,代码来源:invtype.php
示例2: generate
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 .= "&";
}
$smarty->assign('splitter_endpage', $endpage);
$smarty->assign('splitter_page', $page);
$smarty->assign('splitter_url', $url);
return $smarty->fetch(get_tpl('pagesplitter'));
}
开发者ID:biow0lf,项目名称:evedev-kb,代码行数:31,代码来源:class.pagesplitter.php
示例3: use_keh
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!!!";
}
}
}
开发者ID:AngelWayfarer,项目名称:prizvanie,代码行数:34,代码来源:cache.class.php
示例4: run_template
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;
}
开发者ID:JongMenS,项目名称:JongMenS.github.io,代码行数:25,代码来源:template.php
示例5: is_cached
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']);
}
开发者ID:lnmpoo,项目名称:yangziephp,代码行数:8,代码来源:SmartyView.class.php
示例6: display_flashes
function display_flashes(&$flash)
{
foreach ($flash as $k => $v) {
if ($v) {
get_tpl('_flash', array('status' => $k, 'messages' => $v));
$flash[$k] = array();
}
}
}
开发者ID:alexkurilo77,项目名称:Alex1,代码行数:9,代码来源:functions.php
示例7: generate
/**
* 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'));
}
开发者ID:biow0lf,项目名称:evedev-kb,代码行数:17,代码来源:class.box.php
示例8: generate
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'));
}
开发者ID:biow0lf,项目名称:evedev-kb,代码行数:13,代码来源:class.weapon.php
示例9: getHtml
/**
* 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'));
}
}
开发者ID:biow0lf,项目名称:evedev-kb,代码行数:24,代码来源:class.comments.php
示例10: generate
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'));
}
开发者ID:biow0lf,项目名称:evedev-kb,代码行数:15,代码来源:class.ship.php
示例11: generate
/**
* Generate the HTML for this BarGraph.
*
* @global type $smarty
* @return string HTML for this bar.
*/
function generate()
{
if ($this->text == "") {
$this->text = " ";
}
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"));
}
开发者ID:biow0lf,项目名称:evedev-kb,代码行数:22,代码来源:class.bargraph.php
示例12: display
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'));
}
开发者ID:biow0lf,项目名称:evedev-kb,代码行数:45,代码来源:self_detail.php
示例13: parsing_tpl
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;
}
开发者ID:AngelWayfarer,项目名称:prizvanie,代码行数:18,代码来源:pasing_tpl.class.php
示例14: generate
/**
* 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'));
}
开发者ID:Salvoxia,项目名称:fleet_battles_mod,代码行数:47,代码来源:class.awardboxlong.php
示例15: content
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'));
}
开发者ID:biow0lf,项目名称:evedev-kb,代码行数:42,代码来源:login.php
示例16: generate
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&crp_ext_id=" . $corp->getExternalID();
} else {
$uri = KB_HOST . "/?a=corp_detail&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'));
}
开发者ID:biow0lf,项目名称:evedev-kb,代码行数:21,代码来源:class.corp.php
示例17: details
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'));
}
开发者ID:biow0lf,项目名称:evedev-kb,代码行数:23,代码来源:groupdb.php
示例18: generate
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'));
}
开发者ID:biow0lf,项目名称:evedev-kb,代码行数:23,代码来源:class.pilot.php
示例19: Page
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();
开发者ID:biow0lf,项目名称:evedev-kb,代码行数:31,代码来源:admin_mods.php
示例20: array
<?php
$submit = 'Add';
$method = 'POST';
$form_classes = array('col-sm-5');
$form_parts[] = '_add_post_fields';
include get_tpl('_base_form');
开发者ID:alexkurilo77,项目名称:Alex1,代码行数:7,代码来源:_add_post_form.php
注:本文中的get_tpl函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论