当前位置: 首页>>代码示例>>PHP>>正文


PHP template::set_filenames方法代码示例

本文整理汇总了PHP中template::set_filenames方法的典型用法代码示例。如果您正苦于以下问题:PHP template::set_filenames方法的具体用法?PHP template::set_filenames怎么用?PHP template::set_filenames使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在template的用法示例。


在下文中一共展示了template::set_filenames方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: template

<?php

session_start();
include "class_lib.php";
include "template.php";
$template = new template('html');
//=========
if (!$_POST['login'] && !$_SESSION['islogin']) {
    $template->set_filenames(array('login' => 'login.html'));
    $template->pparse('login');
} else {
    if ($_POST['login']) {
        include "classes/login.php";
        $login = new login();
        $test = $login->logger($_POST['log'], $_POST['pass']);
        if (!$test) {
            $template->set_filenames(array('login' => 'login.html'));
            $template->assign_block_vars('switch_login_fails', array());
            $template->pparse('login');
            $template->set_filenames(array('footer' => 'footer.html'));
            $template->pparse('footer');
            exit;
        }
        if ($test) {
            $_SESSION['islogin'] = $login->islogin;
            $_SESSION['access'] = $login->access;
            $_SESSION['emp'] = $login->EMP;
            $_SESSION['zone'] = $login->zone;
            $session = new session_info();
            $page = new layout();
            $page->call_info($_GET['pageload'], $session->access);
开发者ID:batoure,项目名称:epargne,代码行数:31,代码来源:help.php

示例2: module

$template->assign_var('T_TEMPLATE_PATH', '../adm/style');

// the acp template is never stored in the database
$user->theme['template_storedb'] = false;

$install = new module();

$install->create('install', "index.$phpEx", $mode, $sub);
$install->load();

// Generate the page
$install->page_header();
$install->generate_navigation();

$template->set_filenames(array(
	'body' => $install->get_tpl_name())
);

$install->page_footer();

/**
* @package install
*/
class module
{
	var $id = 0;
	var $type = 'install';
	var $module_ary = array();
	var $filename;
	var $module_url = '';
	var $tpl_name = '';
开发者ID:pombredanne,项目名称:ArcherSys,代码行数:31,代码来源:index.php

示例3: get

 /**
  * @param string|string[] $files
  * @param bool|false $template
  * @param bool|false $template_path
  *
  * @return template
  *
  * (c) Gorlum 2015
  */
 public static function get($files, $template = false, $template_path = false)
 {
     !is_object($template) ? $template = new template() : false;
     //$template->set_custom_template($template_path ? $template_path : TEMPLATE_DIR, TEMPLATE_NAME, TEMPLATE_DIR);
     // $tmpl_name = gettemplatename($user['dpath']);
     $template->set_custom_template(($template_path ? $template_path : SN_ROOT_PHYSICAL . 'design/templates/') . DEFAULT_TEMPLATE . '/', DEFAULT_TEMPLATE, TEMPLATE_DIR);
     // TODO ГРЯЗНЫЙ ХАК! Это нужно, что бы по возможности перезаписать инфу из языковых пакетов модулей там, где она была перезаписана раньше инфой из основного пакета. Почему?
     //  - сначала грузятся модули и их языковые пакеты
     //  - затем по ходу дела ОСНОВНОЙ языковой пакет может перезаписать данные из МОДУЛЬНОГО языкового пакета
     // Поэтому и нужен этот грязный хак
     // В норме же - страницы заявляют сами, какие им пакеты нужны. Так что сначала всегда должны грузится основные языковые пакеты, а уже ПОВЕРХ них - пакеты модулей
     //    global $sn_mvc, $sn_page_name;
     //    !empty($sn_mvc['i18n']['']) ? lng_load_i18n($sn_mvc['i18n']['']) : false;
     //    $sn_page_name ? lng_load_i18n($sn_mvc['i18n'][$sn_page_name]) : false;
     if (!empty($files)) {
         is_string($files) ? $files = array(basename($files) => $files) : false;
         foreach ($files as &$filename) {
             $filename = $filename . TEMPLATE_EXTENSION;
         }
         $template->set_filenames($files);
     }
     return $template;
 }
开发者ID:supernova-ws,项目名称:TicTacToe,代码行数:32,代码来源:template.php

示例4: gettemplate

function gettemplate($files, $template = false, $template_path = false)
{
    global $user;
    $template_ex = '.tpl.html';
    if ($template === false) {
        return sys_file_read(TEMPLATE_DIR . '/' . $files . $template_ex);
    }
    if (is_string($files)) {
        //    $files = array('body' => $files);
        $files = array(basename($files) => $files);
    }
    if (!is_object($template)) {
        $template = new template();
    }
    //$template->set_custom_template($template_path ? $template_path : TEMPLATE_DIR, TEMPLATE_NAME, TEMPLATE_DIR);
    $tmpl_name = gettemplatename($user['dpath']);
    $template->set_custom_template(($template_path ? $template_path : SN_ROOT_PHYSICAL . 'design/templates/') . $tmpl_name . '/', $tmpl_name, TEMPLATE_DIR);
    foreach ($files as &$filename) {
        $filename = $filename . $template_ex;
    }
    $template->set_filenames($files);
    return $template;
}
开发者ID:hayalolsam,项目名称:SuperNova,代码行数:23,代码来源:template.php

示例5: template

<?php

session_start();
if (!$_SESSION['islogin']) {
    include "template.php";
    $template = new template('html');
    $template->set_filenames(array('login' => 'login.html'));
    $template->assign_block_vars('switch_login_fails', array());
    $template->pparse('login');
    $template->set_filenames(array('footer' => 'footer.html'));
    $template->pparse('footer');
    exit;
}
if ($_GET['zid']) {
    unset($_SESSION['zone']);
    $_SESSION['zone'] = $_GET['zid'];
}
if (!$_SESSION['zone']) {
    if ($_SESSION['access'] > 1) {
        include_once "view_all_clients.php";
    } else {
        $template->set_filenames(array('body' => 'zone_error.html'));
        $template->pparse('body');
    }
} else {
    include 'classes/my_customers.php';
    $List = new client();
    if ($_GET['pageload'] == 7) {
        $template->set_filenames(array('body' => 'view_client.html'));
        if ($_GET['cid'] || $_POST['cid'] || $_POST['scid']) {
            include "classes/deposit.php";
开发者ID:batoure,项目名称:epargne,代码行数:31,代码来源:view_clients.php

示例6: gmdate

<?php

session_start();
header('Expires: Fri, 25 Dec 1980 00:00:00 GMT');
// time in the past
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . 'GMT');
header('Cache-Control: no-cache, must-revalidate');
header('Pragma: no-cache');
include "class_lib.php";
include "template.php";
$template = new template('templates/square/html');
//=========
if (!$_POST['login'] && !$_SESSION['islogin']) {
    $template->set_filenames(array('login' => 'login.html'));
    $template->pparse('login');
    exit;
} else {
    if ($_POST['login']) {
        include "classes/login.php";
        $login = new login();
        $test = $login->logger($_POST['log'], $_POST['pass']);
        if (!$test) {
            $template->set_filenames(array('login' => 'login.html'));
            $template->assign_block_vars('switch_login_fails', array());
            $template->pparse('login');
            $template->set_filenames(array('footer' => 'footer.html'));
            exit;
        }
        if ($test) {
            $_SESSION['islogin'] = $login->islogin;
            $_SESSION['access'] = $login->access;
开发者ID:batoure,项目名称:epargne,代码行数:31,代码来源:index.php

示例7: template

<?php

session_start();
if (!$_SESSION['islogin']) {
    include "template.php";
    $template = new template('html');
    $template->set_filenames(array('login' => 'login.html'));
    $template->assign_block_vars('switch_login_fails', array());
    $template->pparse('login');
    $template->set_filenames(array('footer' => 'footer.html'));
    $template->pparse('footer');
    exit;
}
include 'classes/my_customers.php';
$data = array();
$List = new client();
?>
	
	 <div class="verify">
    <form action = "confirm.php" method="POST">

      <fieldset>
      	<legend>
			Donnee a Verifier
		</legend>
		<table class="tabl" width="100%" cellspacing="0" summary="Data set of deposits to be approved from a given day.">
          <caption>
          <a href="#" onClick="return displayMenu('30 -- 9 -- 2009');">30 -- 9 -- 2009</a>
          </caption>

          <thead class="hat" id="30 -- 9 -- 20091">
开发者ID:batoure,项目名称:epargne,代码行数:31,代码来源:reporting.php

示例8: get_poll


//.........这里部分代码省略.........
                        $db->sql_query($sql);
                    }
                }
                foreach ($currVotedID as $option) {
                    if (!in_array($option, $inboundVote)) {
                        $sql = '
							UPDATE ' . POLL_OPTIONS_TABLE . '
							SET poll_option_total = poll_option_total - 1
							WHERE poll_option_id = ' . (int) $option . '
								AND topic_id = ' . (int) $topicID;
                        $db->sql_query($sql);
                        if ($user->data['is_registered']) {
                            $sql = '
								DELETE FROM ' . POLL_VOTES_TABLE . '
								WHERE topic_id = ' . (int) $topicID . '
									AND poll_option_id = ' . (int) $option . '
									AND vote_user_id = ' . (int) $user->data['user_id'];
                            $db->sql_query($sql);
                        }
                    }
                }
                if ($user->data['user_id'] == ANONYMOUS && !$user->data['is_bot']) {
                    $user->set_cookie('poll_' . $topicID, implode(',', $inboundVote), time() + 31536000);
                }
                $sql = '
					UPDATE ' . TOPICS_TABLE . '
					SET poll_last_vote = ' . time() . "\n\t\t\t\t\tWHERE topic_id = {$topicID}";
                $db->sql_query($sql);
                $actionMsg = $user->lang['VOTE_SUBMITTED'] . '<br />';
                // Reload vote state:
                $pollOptions = array();
                $sql = '
					SELECT * 
					FROM ' . POLL_OPTIONS_TABLE . ' 
					WHERE topic_id = ' . (int) $topicID;
                $result = $db->sql_query($sql);
                while ($row = $db->sql_fetchrow($result)) {
                    $pollOptions[] = $row;
                }
                $db->sql_freeresult($result);
                $currVotedID = $inboundVote;
                $userCanVote = $auth->acl_get('f_votechg', $topicData['forum_id']) && $topicData['poll_vote_change'];
                $displayResults = true;
            }
            // ***** end of vote registration ******
        }
        $pollTotal = 0;
        foreach ($pollOptions as $pollOption) {
            $pollTotal += $pollOption['poll_option_total'];
        }
        $pollBBCode = false;
        if ($topicData['bbcode_bitfield']) {
            require_once $wpUnited->get_setting('phpbb_path') . 'includes/functions_posting.' . $phpEx;
            require_once $wpUnited->get_setting('phpbb_path') . 'includes/bbcode.' . $phpEx;
            $pollBBCode = new bbcode();
        }
        for ($i = 0, $size = sizeof($pollOptions); $i < $size; $i++) {
            $pollOptions[$i]['poll_option_text'] = censor_text($pollOptions[$i]['poll_option_text']);
            if ($pollBBCode !== false) {
                $pollBBCode->bbcode_second_pass($pollOptions[$i]['poll_option_text'], $topicData['bbcode_uid'], $topicData['bbcode_bitfield']);
            }
            $pollOptions[$i]['poll_option_text'] = bbcode_nl2br($pollOptions[$i]['poll_option_text']);
            $pollOptions[$i]['poll_option_text'] = $phpbbForum->parse_phpbb_text_for_smilies($pollOptions[$i]['poll_option_text']);
        }
        $topicData['poll_title'] = $phpbbForum->censor($topicData['poll_title']);
        if ($pollBBCode !== false) {
            $pollBBCode->bbcode_second_pass($topicData['poll_title'], $topicData['bbcode_uid'], $topicData['bbcode_bitfield']);
        }
        $topicData['poll_title'] = bbcode_nl2br($topicData['poll_title']);
        $topicData['poll_title'] = $phpbbForum->parse_phpbb_text_for_smilies($topicData['poll_title']);
        unset($pollBBCode);
        $pollEnd = $topicData['poll_length'] + $topicData['poll_start'];
        $pollLength = $topicData['poll_length'] ? sprintf($user->lang[$pollEnd > time() ? 'POLL_RUN_TILL' : 'POLL_ENDED_AT'], $user->format_date($pollEnd)) : '';
        $topicLink = $phpbbForum->seo ? "topic{$topicID}.html" : "viewtopic.{$phpEx}?t={$topicID}";
        $pTemplate = new template();
        $pTemplate->set_custom_template($wpUnited->get_plugin_path() . 'extras/quickpoll/templates/', 'wpupoll');
        $pTemplate->set_filenames(array('poll' => "{$template}.html"));
        $pTemplate->assign_vars(array('POLL_QUESTION' => $topicData['poll_title'], 'TOTAL_VOTES' => $pollTotal, 'POLL_LEFT_CAP_IMG' => str_replace($wpUnited->get_setting('phpbb_path'), $phpbbForum->get_board_url(), $user->img('poll_left')), 'POLL_RIGHT_CAP_IMG' => str_replace($wpUnited->get_setting('phpbb_path'), $phpbbForum->get_board_url(), $user->img('poll_right')), 'POLL_ID' => $topicID, 'L_MAX_VOTES' => $topicData['poll_max_options'] == 1 ? $user->lang['MAX_OPTION_SELECT'] : sprintf($user->lang['MAX_OPTIONS_SELECT'], $topicData['poll_max_options']), 'L_POLL_LENGTH' => $actionMsg . $pollLength, 'POLL_TEMPLATE' => $template, 'S_CAN_VOTE' => $userCanVote, 'S_DISPLAY_RESULTS' => $displayResults, 'S_SHOW_LINK' => $showLink, 'U_TOPIC_LINK' => $phpbbForum->get_board_url() . $topicLink, 'L_TOPIC_LINK' => __('View poll in forum', 'wp-united'), 'S_IS_MULTI_CHOICE' => $topicData['poll_max_options'] > 1 ? true : false, 'S_POLL_ACTION' => $currURL, 'U_VIEW_RESULTS' => !strstr($currURL, '?') ? $currURL . '?wpupolldisp=1' : $currURL . '&amp;wpupolldisp=1'));
        foreach ($pollOptions as $pollOption) {
            $optionPct = $pollTotal > 0 ? $pollOption['poll_option_total'] / $pollTotal : 0;
            $optionPctTxt = sprintf("%.1d%%", round($optionPct * 100));
            $pTemplate->assign_block_vars('poll_option', array('POLL_OPTION_ID' => $pollOption['poll_option_id'], 'POLL_OPTION_CAPTION' => $pollOption['poll_option_text'], 'POLL_OPTION_RESULT' => $pollOption['poll_option_total'], 'POLL_OPTION_PERCENT' => $optionPctTxt, 'POLL_OPTION_PCT' => round($optionPct * 100), 'POLL_OPTION_IMG' => str_replace($wpUnited->get_setting('phpbb_path'), $phpbbForum->get_board_url(), $user->img('poll_center', $optionPctTxt, round($optionPct * 250))), 'POLL_OPTION_VOTED' => in_array($pollOption['poll_option_id'], $currVotedID) ? true : false));
        }
        ob_start();
        $pTemplate->display('poll');
        $pollMarkup = ob_get_contents();
        unset($pTemplate);
        ob_end_clean();
        $phpbbForum->restore_state($fStateChanged);
        if ($ajax) {
            wpu_ajax_header();
            echo '<wpupoll>';
            echo '<newnonce>' . wp_create_nonce('wpu-poll-submit') . '</newnonce>';
            echo '<pollid>' . $topicID . '</pollid>';
            echo '<markup><![CDATA[' . base64_encode($pollMarkup) . ']]></markup>';
            echo '</wpupoll>';
            exit;
        }
        return $pollMarkup;
    }
开发者ID:snitchashor,项目名称:wp-united,代码行数:101,代码来源:main.php

示例9: gettemplate

function gettemplate($templatename, $is_phpbb = false)
{
    $templatename .= '.tpl';
    if ($is_phpbb) {
        $template = new template();
        $template->set_custom_template(TEMPLATE_DIR, TEMPLATE_NAME);
        $template->set_filenames(array('body' => $templatename));
        return $template;
    } else {
        return ReadFromFile(TEMPLATE_DIR . '/' . $templatename);
    }
}
开发者ID:sonicmaster,项目名称:RPG,代码行数:12,代码来源:template.php

示例10: template

$template = new template();
$template->set_custom_template('templates', 'default');
/* Find the pot size to entice viewers */
try {
    $pot_size = number_format($bc->getbalance("Lottery Pot"), 2) . " BTC";
} catch (Exception $e) {
    if ($debug) {
        echo "EXCEPTION: " . $e->getMessage();
    } else {
        die("Sorry, an error occured and we cannot continue processing this page.");
    }
}
/* Site name */
$template->assign_vars(array('SITENAME' => 'BitLuck', 'DONATE' => '16nCPK6mx4WxSzbAQQCU7Sh9XTzDHDwB63', 'TOTALPOT' => $pot_size, 'OWNERPERCENTAGE' => $owner_fee * 100, 'WINNERPERCENTAGE' => 100 - $owner_fee * 100, 'DRAWTIME' => $draw_time, 'COST' => $ticket_cost));
/* Load up the header to be used on each page */
$template->set_filenames(array('header' => 'site_header.html'));
if (isset($_POST['submit'])) {
    /* Check if the address was valid */
    try {
        $resp = $bc->validateaddress($_POST['address']);
    } catch (Exception $e) {
        if ($debug) {
            echo "EXCEPTION: " . $e->getMessage();
        } else {
            die("Sorry, an error occured and we cannot continue processing this page.");
        }
    }
    if ($resp['isvalid']) {
        /* Find or generate the key for them to send to, save it */
        try {
            $addr = $bc->getaccountaddress("Incoming from " . $_POST['address']);
开发者ID:elpirata15,项目名称:BitLuck,代码行数:31,代码来源:index.php


注:本文中的template::set_filenames方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。