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


PHP template类代码示例

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


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

示例1: ShowTeamspeakPage

function ShowTeamspeakPage()
{
    global $CONF, $LNG;
    if ($_POST) {
        if (isset($_POST['ts_on']) && $_POST['ts_on'] == 'on') {
            $CONF['ts_modon'] = 1;
        } else {
            $CONF['ts_modon'] = 0;
        }
        $CONF['ts_server'] = request_var('ts_ip', '');
        $CONF['ts_tcpport'] = request_var('ts_tcp', 0);
        $CONF['ts_udpport'] = request_var('ts_udp', 0);
        $CONF['ts_timeout'] = request_var('ts_to', 0);
        $CONF['ts_version'] = request_var('ts_v', 0);
        update_config('ts_timeout', $CONF['ts_timeout']);
        update_config('ts_modon', $CONF['ts_modon']);
        update_config('ts_server', $CONF['ts_server']);
        update_config('ts_tcpport', $CONF['ts_tcpport']);
        update_config('ts_udpport', $CONF['ts_udpport']);
        update_config('ts_version', $CONF['ts_version']);
    }
    $template = new template();
    $template->page_header();
    $template->assign_vars(array('se_save_parameters' => $LNG['se_save_parameters'], 'ts_tcpport' => $LNG['ts_tcpport'], 'ts_serverip' => $LNG['ts_serverip'], 'ts_version' => $LNG['ts_version'], 'ts_active' => $LNG['ts_active'], 'ts_settings' => $LNG['ts_settings'], 'ts_udpport' => $LNG['ts_udpport'], 'ts_timeout' => $LNG['ts_timeout'], 'ts_server_query' => $LNG['ts_server_query'], 'ts_server_id' => $LNG['ts_server_id'], 'ts_to' => $CONF['ts_timeout'], 'ts_on' => $CONF['ts_modon'], 'ts_ip' => $CONF['ts_server'], 'ts_tcp' => $CONF['ts_tcpport'], 'ts_udp' => $CONF['ts_udpport'], 'ts_v' => $CONF['ts_version']));
    $template->show('adm/TeamspeakPage.tpl');
}
开发者ID:sonicmaster,项目名称:RPG,代码行数:26,代码来源:ShowTeamspeakPage.php

示例2: ShowIndexPage

/**
 *  2Moons
 *  Copyright (C) 2012 Jan Kröpke
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 * @package 2Moons
 * @author Jan Kröpke <info@2moons.cc>
 * @copyright 2012 Jan Kröpke <info@2moons.cc>
 * @license http://www.gnu.org/licenses/gpl.html GNU GPLv3 License
 * @version 1.7.2 (2013-03-18)
 * @info $Id$
 * @link http://2moons.cc/
 */
function ShowIndexPage()
{
    global $LNG;
    $template = new template();
    $template->assign_vars(array('game_name' => Config::get()->game_name, 'adm_cp_title' => $LNG['adm_cp_title']));
    $template->display('adm/ShowIndexPage.tpl');
}
开发者ID:bergi9,项目名称:2Moons,代码行数:32,代码来源:ShowIndexPage.php

示例3: ShowPaybonusPage

function ShowPaybonusPage()
{
    global $LNG;
    $CONF = Config::getAll(NULL, 1);
    if (!empty($_POST)) {
        $pay_before = array('bonus_button' => $CONF['bonus_button'], 'academy_bonus' => $CONF['academy_bonus'], 'premium' => $CONF['premium'], 'stardust_bonus' => $CONF['stardust_bonus'], 'purchase_bonus' => $CONF['purchase_bonus'], 'purchase_bonus_timer' => $CONF['purchase_bonus_timer'], 'cosmonaute' => $CONF['cosmonaute'], 'fleetconf' => $CONF['fleetconf'], 'new_year' => $CONF['new_year']);
        $purchase_bonus = $_POST['percent'];
        $academy_bonus = $_POST['academy_bonus'];
        $bonus_button = $_POST['bonus_button'];
        $premium = $_POST['premium'];
        $stardust_bonus = $_POST['stardust_bonus'];
        $stardust_bonus = $_POST['stardust_bonus'];
        $fleetconf = isset($_POST['fleetconf']) && $_POST['fleetconf'] == 'on' ? 1 : 0;
        $cosmonaute = isset($_POST['cosmonaute']) && $_POST['cosmonaute'] == 'on' ? 1 : 0;
        $new_year = isset($_POST['new_year']) && $_POST['new_year'] == 'on' ? 1 : 0;
        $purchase_bonus_timer = TIMESTAMP + $_POST['days'] * 24 * 60 * 60;
        $pay_after = array('bonus_button' => $bonus_button, 'academy_bonus' => $academy_bonus, 'premium' => $premium, 'stardust_bonus' => $stardust_bonus, 'purchase_bonus' => $purchase_bonus, 'purchase_bonus_timer' => $purchase_bonus_timer, 'fleetconf' => $fleetconf, 'cosmonaute' => $cosmonaute, 'new_year' => $new_year);
        Config::update($pay_after, 1);
        $CONF = Config::getAll(NULL, 1);
        $LOG = new Log(3);
        $LOG->target = 1;
        $LOG->old = $pay_before;
        $LOG->new = $pay_after;
        $LOG->save();
    }
    $template = new template();
    $template->assign_vars(array('academy_bonus' => $CONF['academy_bonus'], 'cosmonaute' => $CONF['cosmonaute'], 'new_year' => $CONF['new_year'], 'bonus_button' => $CONF['bonus_button'], 'fleetconf' => $CONF['fleetconf'], 'premium' => $CONF['premium'], 'stardust_bonus' => $CONF['stardust_bonus'], 'purchase_bonus' => $CONF['purchase_bonus'], 'purchase_bonus_timer' => $CONF['purchase_bonus_timer'], 'bonus_next_active' => $CONF['purchase_bonus_timer'] > TIMESTAMP ? $CONF['purchase_bonus_timer'] - TIMESTAMP : 0, 'bonus_next_active_timer' => $CONF['purchase_bonus_timer'] > TIMESTAMP ? date("d.m.Y H:i:s", $CONF['purchase_bonus_timer']) : 0));
    $template->show('paybonus.tpl');
}
开发者ID:Decoder1978,项目名称:Xterium,代码行数:29,代码来源:ShowPaybonusPage.php

示例4: show

 function show($view, $loc, $title = '')
 {
     $template = new template('imagemanagermodule', $view, $loc);
     $uilevel = 99;
     // MAX
     if (exponent_sessions_isset("uilevel")) {
         $uilevel = exponent_sessions_get("uilevel");
     }
     $template->assign('show', defined('SELECTOR') || $uilevel > UILEVEL_PREVIEW ? 1 : 0);
     if (!defined('SYS_FILES')) {
         include_once BASE . 'subsystems/files.php';
     }
     $directory = 'files/imagemanagermodule/' . $loc->src;
     if (!file_exists(BASE . $directory)) {
         $err = exponent_files_makeDirectory($directory);
         if ($err != SYS_FILES_SUCCESS) {
             $template->assign('noupload', 1);
             $template->assign('uploadError', $err);
         }
     }
     global $db;
     $location = serialize($loc);
     if (!isset($_SESSION['image_cache'][$location])) {
         $items = $db->selectObjects("imagemanageritem", "location_data='" . serialize($loc) . "'");
         $_SESSION['image_cache'][$location] = $items;
     } else {
         $items = $_SESSION['image_cache'][$location];
     }
     $files = $db->selectObjectsIndexedArray("file", "directory='{$directory}'");
     $template->assign('items', $items);
     $template->assign('files', $files);
     $template->assign('moduletitle', $title);
     $template->register_permissions(array('administrate', 'post', 'edit', 'delete'), $loc);
     $template->output();
 }
开发者ID:BackupTheBerlios,项目名称:exponentva-svn,代码行数:35,代码来源:class.php

示例5: ShowSendMessagesPage

function ShowSendMessagesPage()
{
    global $USER, $LNG, $db;
    if ($_GET['mode'] == 'send') {
        switch ($USER['authlevel']) {
            case AUTH_MOD:
                $color = 'yellow';
                break;
            case AUTH_OPS:
                $color = 'skyblue';
                break;
            case AUTH_ADM:
                $color = 'red';
                break;
        }
        $Subject = makebr(request_var('subject', '', true));
        $Message = makebr(request_var('text', '', true));
        if (!empty($Message) && !empty($Subject)) {
            require_once ROOT_PATH . 'includes/functions/BBCode.php';
            $Time = TIMESTAMP;
            $From = '<span style="color:' . $color . ';">' . $LNG['user_level'][$USER['authlevel']] . ' ' . $USER['username'] . '</span>';
            $Subject = '<span style="color:' . $color . ';">' . $Subject . '</span>';
            $Message = '<span style="color:' . $color . ';font-weight:bold;">' . bbcode($Message) . '</span>';
            SendSimpleMessage(0, $USER['id'], TIMESTAMP, 50, $From, $Subject, $Message, 0, $_SESSION['adminuni']);
            $db->query("UPDATE " . USERS . " SET `new_gmessage` = `new_gmessage` + '1', `new_message` = `new_message` + '1' WHERE `universe` = '" . $_SESSION['adminuni'] . "';");
            exit($LNG['ma_message_sended']);
        } else {
            exit($LNG['ma_subject_needed']);
        }
    }
    $template = new template();
    $template->assign_vars(array('mg_empty_text' => $LNG['mg_empty_text'], 'ma_subject' => $LNG['ma_subject'], 'ma_none' => $LNG['ma_none'], 'ma_message' => $LNG['ma_message'], 'ma_send_global_message' => $LNG['ma_send_global_message'], 'ma_characters' => $LNG['ma_characters'], 'button_submit' => $LNG['button_submit']));
    $template->show('adm/SendMessagesPage.tpl');
}
开发者ID:sonicmaster,项目名称:RPG,代码行数:34,代码来源:ShowSendMessagesPage.php

示例6: ShowTeamspeakPage

function ShowTeamspeakPage()
{
    global $LNG, $USER;
    $CONF = Config::getAll(NULL, $_SESSION['adminuni']);
    if ($_POST) {
        $config_before = array('ts_timeout' => $CONF['ts_timeout'], 'ts_modon' => $CONF['ts_modon'], 'ts_server' => $CONF['ts_server'], 'ts_tcpport' => $CONF['ts_tcpport'], 'ts_udpport' => $CONF['ts_udpport'], 'ts_version' => $CONF['ts_version'], 'ts_login' => $CONF['ts_login'], 'ts_password' => $CONF['ts_password'], 'ts_cron_interval' => $CONF['ts_cron_interval']);
        $ts_modon = isset($_POST['ts_on']) && $_POST['ts_on'] == 'on' ? 1 : 0;
        $ts_server = HTTP::_GP('ts_ip', '');
        $ts_tcpport = HTTP::_GP('ts_tcp', 0);
        $ts_udpport = HTTP::_GP('ts_udp', 0);
        $ts_timeout = HTTP::_GP('ts_to', 0);
        $ts_version = HTTP::_GP('ts_v', 0);
        $ts_login = HTTP::_GP('ts_login', '');
        $ts_password = HTTP::_GP('ts_password', '', true);
        $ts_cron_interval = HTTP::_GP('ts_cron', 0);
        $config_after = array('ts_timeout' => $ts_timeout, 'ts_modon' => $ts_modon, 'ts_server' => $ts_server, 'ts_tcpport' => $ts_tcpport, 'ts_udpport' => $ts_udpport, 'ts_version' => $ts_version, 'ts_login' => $ts_login, 'ts_password' => $ts_password, 'ts_cron_interval' => $ts_cron_interval);
        Config::update($config_after);
        $GLOBALS['DATABASE']->query("UPDATE " . CRONJOBS . " SET isActive = " . $ts_modon . ", `lock` = NULL, nextTime = 0 WHERE name = 'teamspeak';");
        $CONF = Config::getAll(NULL, $_SESSION['adminuni']);
        $LOG = new Log(3);
        $LOG->target = 4;
        $LOG->old = $config_before;
        $LOG->new = $config_after;
        $LOG->save();
    }
    $template = new template();
    $template->assign_vars(array('se_save_parameters' => $LNG['se_save_parameters'], 'ts_tcpport' => $LNG['ts_tcpport'], 'ts_serverip' => $LNG['ts_serverip'], 'ts_version' => $LNG['ts_version'], 'ts_active' => $LNG['ts_active'], 'ts_settings' => $LNG['ts_settings'], 'ts_udpport' => $LNG['ts_udpport'], 'ts_timeout' => $LNG['ts_timeout'], 'ts_server_query' => $LNG['ts_server_query'], 'ts_sq_login' => $LNG['ts_login'], 'ts_sq_pass' => $LNG['ts_pass'], 'ts_lng_cron' => $LNG['ts_cron'], 'ts_to' => $CONF['ts_timeout'], 'ts_on' => $CONF['ts_modon'], 'ts_ip' => $CONF['ts_server'], 'ts_tcp' => $CONF['ts_tcpport'], 'ts_udp' => $CONF['ts_udpport'], 'ts_v' => $CONF['ts_version'], 'ts_login' => $CONF['ts_login'], 'ts_password' => $CONF['ts_password'], 'ts_cron' => $CONF['ts_cron_interval']));
    $template->show('TeamspeakPage.tpl');
}
开发者ID:fuding,项目名称:Antaris,代码行数:29,代码来源:ShowTeamspeakPage.php

示例7: message

function message($mes, $dest = "", $time = "3", $topnav = false, $menu = true)
{
    require_once ROOT_PATH . 'includes/classes/class.template.php';
    $template = new template();
    $template->message($mes, $dest, $time, !$topnav);
    exit;
}
开发者ID:sonicmaster,项目名称:RPG,代码行数:7,代码来源:GeneralFunctions.php

示例8: __construct

 public function __construct()
 {
     global $CONF, $dpath, $LNG, $db, $USER, $PLANET;
     $mode = request_var('mode', '');
     $msg = request_var('msg', '', true);
     $ctype = request_var('chat_type', '');
     $MessageID = request_var('id', 0);
     switch ($mode) {
         case "delete":
             $this->DelMeassageFromChat($MessageID);
             break;
         case "send":
             $this->SetMeassageInChat($ctype, $msg);
             break;
         case "call":
             $this->GetMessages($ctype);
             break;
         default:
             $template = new template();
             $template->execscript("showMessage();setInterval(showMessage, 10000);");
             $template->loadscript("chat.js");
             if (empty($ctype)) {
                 $PlanetRess = new ResourceUpdate();
                 $PlanetRess->CalcResource();
                 $PlanetRess->SavePlanetToDB();
             } else {
                 $template->isPopup(true);
             }
             $template->assign_vars(array('ctype' => $ctype, 'chat_send' => $LNG['chat_send'], 'chat_disc' => $LNG['chat_disc'], 'chat_message' => $LNG['chat_message'], 'chat_bbcode' => $LNG['chat_bbcode'], 'chat_fontcolor' => $LNG['chat_fontcolor'], 'chat_color_white' => $LNG['chat_color_white'], 'chat_color_blue' => $LNG['chat_color_blue'], 'chat_color_yellow' => $LNG['chat_color_yellow'], 'chat_color_green' => $LNG['chat_color_green'], 'chat_color_pink' => $LNG['chat_color_pink'], 'chat_color_red' => $LNG['chat_color_red'], 'chat_color_orange' => $LNG['chat_color_orange'], 'chat_notext' => $LNG['chat_notext'], 'chat_request_url' => $LNG['chat_request_url'], 'chat_request_url_desc' => $LNG['chat_request_url_desc']));
             $template->show("chat_overview.tpl");
             break;
     }
 }
开发者ID:sonicmaster,项目名称:RPG,代码行数:33,代码来源:class.ShowChatPage.php

示例9: ShowMenuPage

/**
 *  2Moons
 *  Copyright (C) 2012 Jan Kröpke
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 * @package 2Moons
 * @author Jan Kröpke <info@2moons.cc>
 * @copyright 2012 Jan Kröpke <info@2moons.cc>
 * @license http://www.gnu.org/licenses/gpl.html GNU GPLv3 License
 * @version 1.7.3 (2013-05-19)
 * @info $Id: ShowMenuPage.php 2632 2013-03-18 19:05:14Z slaver7 $
 * @link http://2moons.cc/
 */
function ShowMenuPage()
{
    global $USER;
    $template = new template();
    $template->assign_vars(array('supportticks' => $GLOBALS['DATABASE']->getFirstCell("SELECT COUNT(*) FROM " . TICKETS . " WHERE universe = " . $_SESSION['adminuni'] . " AND status = 0;")));
    $template->show('ShowMenuPage.tpl');
}
开发者ID:fuding,项目名称:Antaris,代码行数:32,代码来源:ShowMenuPage.php

示例10: ShowChatConfigPage

function ShowChatConfigPage()
{
    global $LNG, $USER;
    $CONF = Config::getAll(NULL, 1);
    if (!empty($_POST)) {
        $config_before = array('chat_closed' => $CONF['chat_closed'], 'chat_allowchan' => $CONF['chat_allowchan'], 'chat_allowmes' => $CONF['chat_allowmes'], 'chat_allowdelmes' => $CONF['chat_allowdelmes'], 'chat_logmessage' => $CONF['chat_logmessage'], 'chat_nickchange' => $CONF['chat_nickchange'], 'chat_botname' => $CONF['chat_botname'], 'chat_channelname' => $CONF['chat_channelname']);
        $chat_allowchan = isset($_POST['chat_allowchan']) && $_POST['chat_allowchan'] == 'on' ? 1 : 0;
        $chat_allowmes = isset($_POST['chat_allowmes']) && $_POST['chat_allowmes'] == 'on' ? 1 : 0;
        $chat_allowdelmes = isset($_POST['chat_allowdelmes']) && $_POST['chat_allowdelmes'] == 'on' ? 1 : 0;
        $chat_logmessage = isset($_POST['chat_logmessage']) && $_POST['chat_logmessage'] == 'on' ? 1 : 0;
        $chat_nickchange = isset($_POST['chat_nickchange']) && $_POST['chat_nickchange'] == 'on' ? 1 : 0;
        $chat_closed = isset($_POST['chat_closed']) && $_POST['chat_closed'] == 'on' ? 1 : 0;
        $chat_channelname = HTTP::_GP('chat_channelname', '', true);
        $chat_botname = HTTP::_GP('chat_botname', '', true);
        $config_after = array('chat_closed' => $chat_closed, 'chat_allowchan' => $chat_allowchan, 'chat_allowmes' => $chat_allowmes, 'chat_allowdelmes' => $chat_allowdelmes, 'chat_logmessage' => $chat_logmessage, 'chat_nickchange' => $chat_nickchange, 'chat_botname' => $chat_botname, 'chat_channelname' => $chat_channelname);
        Config::update($config_after);
        $CONF = Config::getAll(NULL, 1);
        $LOG = new Log(3);
        $LOG->target = 3;
        $LOG->old = $config_before;
        $LOG->new = $config_after;
        $LOG->save();
    }
    $template = new template();
    $template->assign_vars(array('chat_closed' => $CONF['chat_closed'], 'chat_allowchan' => $CONF['chat_allowchan'], 'chat_allowmes' => $CONF['chat_allowmes'], 'chat_logmessage' => $CONF['chat_logmessage'], 'chat_nickchange' => $CONF['chat_nickchange'], 'chat_botname' => $CONF['chat_botname'], 'chat_channelname' => $CONF['chat_channelname'], 'se_server_parameters' => $LNG['se_server_parameters'], 'se_save_parameters' => $LNG['se_save_parameters'], 'ch_closed' => $LNG['ch_closed'], 'ch_allowchan' => $LNG['ch_allowchan'], 'ch_allowmes' => $LNG['ch_allowmes'], 'ch_allowdelmes' => $LNG['ch_allowdelmes'], 'ch_logmessage' => $LNG['ch_logmessage'], 'ch_nickchange' => $LNG['ch_nickchange'], 'ch_botname' => $LNG['ch_botname'], 'ch_channelname' => $LNG['ch_channelname']));
    $template->show('ChatConfigBody.tpl');
}
开发者ID:Decoder1978,项目名称:Xterium,代码行数:27,代码来源:ShowChatConfigPage.php

示例11: run

function run()
{
    global $layout;
    global $DB;
    global $website;
    global $theme;
    $out = '';
    switch ($_REQUEST['act']) {
        case "copy_from_template_zones":
            // return template sections and (textarea) properties for a content id
            $template = new template();
            $template->load($_REQUEST['template']);
            $zones = array();
            for ($ts = 0; $ts < count($template->sections); $ts++) {
                $title = $theme->t($template->sections[$ts]['name']);
                if ($title == '#main#') {
                    $title = t(238, 'Main content');
                }
                $zones[] = array('type' => 'section', 'code' => $template->sections[$ts]['code'], 'title' => $title);
            }
            for ($ps = 0; $ps < count($template->properties); $ps++) {
                // ignore non-textual properties
                if (!in_array($template->properties[$ps]->type, array("text", "textarea", "rich_textarea"))) {
                    continue;
                }
                $zones[] = array('type' => 'property', 'code' => $template->properties[$ps]->id, 'title' => $theme->t($template->properties[$ps]->name));
            }
            echo json_encode($zones);
            core_terminate();
            break;
    }
}
开发者ID:NavigateCMS,项目名称:Navigate-CMS,代码行数:32,代码来源:properties.php

示例12: dok_link_song_album

function dok_link_song_album($VARS, $update, $theme_path)
{
    if (!is_numeric($VARS['id']) || $VARS['id'] < 1) {
        $VARS['id'] = 0;
    }
    $res = mysql_query('select * from ' . dok_tn('song') . ' where id = ' . $VARS['id']);
    if (!mysql_numrows($res)) {
        $t = dok_error_template(MSG_ERR_SONG_NOT_FOUND);
        return array($t, MSG_TITLE_ADD_SONG_ALBUM);
    }
    $song = mysql_fetch_array($res);
    /**	$res = dok_oquery('select distinct(album_id) as aid from '.dok_tn('rel_song_album').' where song_id = '.$song['id']);
    	$current_albums = $res->fetch_col_array('aid');
    	$where = '';
    	if ( sizeof($current_albums) )	$where = ' where id not in('.implode(',',$current_albums).')';*/
    $where = '';
    $res = mysql_query('select id, name from ' . dok_tn('album') . $where . ' order by name');
    $a_select = '';
    while ($row = mysql_fetch_array($res)) {
        $a_select .= '<option value="' . $row['id'] . '"';
        if ($_SESSION['song_select_album'] == $row['id']) {
            $a_select .= ' selected';
        }
        $a_select .= '>' . $row['name'] . '</option>';
    }
    $t = new template($theme_path);
    $t->set_file('page', 'song_album_link.tpl');
    $t->set_var(dok_song_format($song));
    $t->set_var('ALBUM_SELECT', $a_select);
    $t->set_var('SONG_ID', $song['id']);
    return array($t, MSG_TITLE_ADD_SONG_ALBUM);
}
开发者ID:BackupTheBerlios,项目名称:diskotek,代码行数:32,代码来源:link_song_album.php

示例13: display_form

 function display_form($template = false)
 {
     global $CONFIG, $Sql, $LANG, $Session;
     $note = !empty($_POST['note']) ? numeric($_POST['note']) : 0;
     $path_redirect = $this->path . sprintf(str_replace('&amp;', '&', $this->script_path), 0);
     if ($this->_note_loaded()) {
         if (!is_object($template) || strtolower(get_class($template)) != 'template') {
             $template = new template('framework/note.tpl');
         }
         ###########################Insertion##############################
         if (!empty($_POST['valid_note'])) {
             if (!empty($note)) {
                 $this->add($note);
             }
             redirect($path_redirect);
         } else {
             ###########################Affichage##############################
             $row_note = $Sql->query_array(PREFIX . $this->sql_table, 'users_note', 'nbrnote', 'note', "WHERE id = '" . $this->idprov . "'", __LINE__, __FILE__);
             $select = '<option value="-1" selected="selected">' . $LANG['note'] . '</option>';
             for ($i = 0; $i <= $this->notation_scale; $i++) {
                 $select .= '<option value="' . $i . '">' . $i . '</option>';
             }
             ### Notation Ajax ###
             $row_note['note'] = round($row_note['note'] / 0.25) * 0.25;
             $l_note = ($this->options & NOTE_DISPLAY_NOTE) !== 0 ? '<strong>' . $LANG['note'] . ':</strong>&nbsp;' : '';
             $display = ($this->options & NOTE_DISPLAY_BLOCK) !== 0 ? 'block' : 'inline';
             $width = ($this->options & NOTE_DISPLAY_BLOCK) !== 0 ? 'width:' . $this->notation_scale * 16 . 'px;margin:auto;' : '';
             $ajax_note = '<div style="' . $width . 'display:none" id="note_stars' . $this->idprov . '" onmouseout="out_div(' . $this->idprov . ', array_note[' . $this->idprov . '])" onmouseover="over_div()">';
             for ($i = 1; $i <= $this->notation_scale; $i++) {
                 $star_img = 'stars.png';
                 if ($row_note['note'] < $i) {
                     $decimal = $i - $row_note['note'];
                     if ($decimal >= 1) {
                         $star_img = 'stars0.png';
                     } elseif ($decimal >= 0.75) {
                         $star_img = 'stars1.png';
                     } elseif ($decimal >= 0.5) {
                         $star_img = 'stars2.png';
                     } else {
                         $star_img = 'stars3.png';
                     }
                 }
                 $ajax_note .= '<a href="javascript:send_note(' . $this->idprov . ', ' . $i . ', \'' . $Session->get_token() . '\')" onmouseover="select_stars(' . $this->idprov . ', ' . $i . ');"><img src="../templates/' . get_utheme() . '/images/' . $star_img . '" alt="" class="valign_middle" id="n' . $this->idprov . '_stars' . $i . '" /></a>';
             }
             if (($this->options & NOTE_NODISPLAY_NBRNOTES) !== 0) {
                 $ajax_note .= '</div> <span id="noteloading' . $this->idprov . '"></span>';
             } else {
                 $ajax_note .= '</div> <span id="noteloading' . $this->idprov . '"></span> <div style="display:' . $display . '" id="nbrnote' . $this->idprov . '">(' . $row_note['nbrnote'] . ' ' . ($row_note['nbrnote'] > 1 ? strtolower($LANG['notes']) : strtolower($LANG['note'])) . ')</div>';
             }
             $template->assign_vars(array('C_JS_NOTE' => !defined('HANDLE_NOTE'), 'ID' => $this->idprov, 'NOTE_MAX' => $this->notation_scale, 'SELECT' => $select, 'NOTE' => $l_note . '<span id="note_value' . $this->idprov . '">' . ($row_note['nbrnote'] > 0 ? '<strong>' . $row_note['note'] . '</strong>' : '<em>' . $LANG['no_note'] . '</em>') . '</span>' . $ajax_note, 'ARRAY_NOTE' => 'array_note[' . $this->idprov . '] = \'' . $row_note['note'] . '\';', 'DISPLAY' => $display, 'L_AUTH_ERROR' => addslashes($LANG['e_auth']), 'L_ALERT_ALREADY_VOTE' => addslashes($LANG['already_vote']), 'L_ALREADY_VOTE' => '', 'L_NOTE' => addslashes($LANG['note']), 'L_NOTES' => addslashes($LANG['notes']), 'L_VALID_NOTE' => $LANG['valid_note']));
         }
         if (!defined('HANDLE_NOTE')) {
             define('HANDLE_NOTE', true);
         }
         return $template->parse(TEMPLATE_STRING_MODE);
     } else {
         global $Errorh;
         $Errorh->handler('e_unexist_page', E_USER_REDIRECT);
     }
 }
开发者ID:janus57,项目名称:PHPBoost_v3c,代码行数:60,代码来源:note.class.php

示例14: ShowVoucherPage

function ShowVoucherPage()
{
    global $LNG, $USER;
    $template = new template();
    if ($_GET['mode'] == 'delete' && !empty($_GET['i'])) {
        //delete an entry
        $GLOBALS['DATABASE']->query("DELETE from `uni1_reward` where `rewardId` = " . $GLOBALS['DATABASE']->sql_escape($_GET['i']) . " ;");
        $template->message("Voucher Code deleted");
        die;
    }
    if ($_POST) {
        $SQL = "";
        foreach ($_POST as $key => $value) {
            $SQL .= "'" . $value . "',";
        }
        $SQL = substr($SQL, 0, -1);
        $GLOBALS['DATABASE']->query("INSERT INTO `uni1_reward` VALUES (NULL," . $SQL . ");");
        $template->message("Voucher Added");
        die;
    }
    $AllVouchers = array();
    $GetAll = $GLOBALS['DATABASE']->query("SELECT * FROM `uni1_reward` ;");
    if ($GLOBALS['DATABASE']->numRows($GetAll) > 0) {
        while ($x = $GLOBALS['DATABASE']->fetch_array($GetAll)) {
            $AllVouchers[] = $x;
        }
    }
    $template->assign_vars(array('AllVouchers' => $AllVouchers));
    $template->show('VoucherEditor.tpl');
}
开发者ID:Decoder1978,项目名称:Xterium,代码行数:30,代码来源:ShowVoucherPage.php

示例15: ShowInformationPage

function ShowInformationPage()
{
    global $LNG, $CONF, $USER;
    if (file_exists(ini_get('error_log'))) {
        $Lines = count(file(ini_get('error_log')));
    } else {
        $Lines = 0;
    }
    try {
        $dateTimeZoneServer = new DateTimeZone(Config::get('timezone'));
    } catch (Exception $e) {
        $dateTimeZoneServer = new DateTimeZone(date_default_timezone_get());
    }
    try {
        $dateTimeZoneUser = new DateTimeZone($USER['timezone']);
    } catch (Exception $e) {
        $dateTimeZoneUser = new DateTimeZone(date_default_timezone_get());
    }
    try {
        $dateTimeZonePHP = new DateTimeZone(ini_get('date.timezone'));
    } catch (Exception $e) {
        $dateTimeZonePHP = new DateTimeZone(date_default_timezone_get());
    }
    $dateTimeServer = new DateTime("now", $dateTimeZoneServer);
    $dateTimeUser = new DateTime("now", $dateTimeZoneUser);
    $dateTimePHP = new DateTime("now", $dateTimeZonePHP);
    $template = new template();
    $template->assign_vars(array('info_information' => sprintf($LNG['info_information'], 'http://tracker.2moons.cc/'), 'info' => $_SERVER['SERVER_SOFTWARE'], 'vPHP' => PHP_VERSION, 'vAPI' => PHP_SAPI, 'vGame' => Config::get('VERSION'), 'vMySQLc' => $GLOBALS['DATABASE']->getVersion(), 'vMySQLs' => $GLOBALS['DATABASE']->getServerVersion(), 'root' => $_SERVER['SERVER_NAME'], 'gameroot' => $_SERVER['SERVER_NAME'] . str_replace('/admin.php', '', $_SERVER['PHP_SELF']), 'json' => function_exists('json_encode') ? 'Ja' : 'Nein', 'bcmath' => extension_loaded('bcmath') ? 'Ja' : 'Nein', 'curl' => extension_loaded('curl') ? 'Ja' : 'Nein', 'browser' => $_SERVER['HTTP_USER_AGENT'], 'safemode' => ini_get('safe_mode') ? 'Ja' : 'Nein', 'memory' => ini_get('memory_limit'), 'suhosin' => ini_get('suhosin.request.max_value_length') ? 'Ja' : 'Nein', 'log_errors' => ini_get('log_errors') ? 'Aktiv' : 'Inaktiv', 'errorlog' => ini_get('error_log'), 'errorloglines' => $Lines, 'php_tz' => $dateTimePHP->getOffset() / 3600, 'conf_tz' => $dateTimeServer->getOffset() / 3600, 'user_tz' => $dateTimeUser->getOffset() / 3600));
    $template->show('ShowInformationPage.tpl');
}
开发者ID:fuding,项目名称:Antaris,代码行数:30,代码来源:ShowInformationPage.php


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