本文整理汇总了PHP中pTemplate类的典型用法代码示例。如果您正苦于以下问题:PHP pTemplate类的具体用法?PHP pTemplate怎么用?PHP pTemplate使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了pTemplate类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: system_message
function system_message($msg)
{
global $cfg;
$theme_color = $cfg['USER_INITIAL_THEME_COLOR'];
$tpl = new pTemplate();
/*
if (preg_match("/(admin|client|reseller)/", $_SERVER['PHP_SELF'], $matches)) {
$tpl_path = "../".$cfg['ROOT_TEMPLATE_PATH'];
} else {
$tpl_path = $cfg['ROOT_TEMPLATE_PATH'];
}
*/
$tpl_path = "../" . $cfg['ROOT_TEMPLATE_PATH'] . $cfg['USER_INITIAL_THEME'];
$tpl->define_dynamic('page', $tpl_path . '/system-message.tpl');
$tpl->assign(array('TR_SYSTEM_MESSAGE_PAGE_TITLE' => 'VHCS Error', 'THEME_COLOR_PATH' => "themes/{$theme_color}", 'THEME_CHARSET' => tr('encoding'), 'TR_ERROR_MESSAGE' => 'Error Message', 'TR_VHCS_LICENSE' => $cfg['VHCS_LICENSE'], 'TR_TIME' => date("g:i a"), 'TR_DATE' => date("l dS of F Y"), 'MESSAGE' => $msg));
$tpl->parse('PAGE', 'page');
$tpl->prnt();
exit(0);
}
示例2: check_login
// | Copyright (c) 2001-2005 by moleSoftware |
// | http://vhcs.net | http://www.molesoftware.com |
// | |
// | This program is free software; you can redistribute it and/or |
// | modify it under the terms of the MPL General Public License |
// | as published by the Free Software Foundation; either version 1.1 |
// | of the License, or (at your option) any later version. |
// | |
// | You should have received a copy of the MPL Mozilla Public License |
// | along with this program; if not, write to the Open Source Initiative (OSI) |
// | http://opensource.org | osi@opensource.org |
// | |
// -------------------------------------------------------------------------------
include '../include/vhcs-lib.php';
check_login();
$tpl = new pTemplate();
$tpl->define_dynamic('page', $cfg['RESELLER_TEMPLATE_PATH'] . '/order_email.tpl');
$tpl->define_dynamic('page_message', 'page');
$tpl->define_dynamic('logged_from', 'page');
$tpl->define_dynamic('custom_buttons', 'page');
global $cfg;
$theme_color = $cfg['USER_INITIAL_THEME'];
function gen_email_data(&$tpl, &$sql)
{
if (isset($_POST['uaction']) && $_POST['uaction'] === 'order_email') {
$tpl->assign(array('SUBJECT_VALUE' => $_POST['auto_subject'], 'MESSAGE_VALUE' => $_POST['auto_message'], 'SENDER_EMAIL_VALUE' => $_POST['sender_email'], 'SENDER_NAME_VALUE' => $_POST['sender_name']));
} else {
$user_id = $_SESSION['user_id'];
$query = <<<SQL_QUERY
select
fname, lname, email
示例3: check_login
// | Copyright (c) 2001-2005 by moleSoftware |
// | http://vhcs.net | http://www.molesoftware.com |
// | |
// | This program is free software; you can redistribute it and/or |
// | modify it under the terms of the MPL General Public License |
// | as published by the Free Software Foundation; either version 1.1 |
// | of the License, or (at your option) any later version. |
// | |
// | You should have received a copy of the MPL Mozilla Public License |
// | along with this program; if not, write to the Open Source Initiative (OSI) |
// | http://opensource.org | osi@opensource.org |
// | |
// -------------------------------------------------------------------------------
include '../include/vhcs-lib.php';
check_login();
$tpl = new pTemplate();
$tpl->define_dynamic('page', $cfg['CLIENT_TEMPLATE_PATH'] . '/manage_domains.tpl');
$tpl->define_dynamic('page_message', 'page');
$tpl->define_dynamic('logged_from', 'page');
$tpl->define_dynamic('als_message', 'page');
$tpl->define_dynamic('als_list', 'page');
$tpl->define_dynamic('als_item', 'als_list');
$tpl->define_dynamic('sub_message', 'page');
$tpl->define_dynamic('sub_list', 'page');
$tpl->define_dynamic('sub_item', 'sub_list');
$tpl->define_dynamic('custom_buttons', 'page');
//
// page functions.
//
function gen_user_sub_action($sub_id, $sub_status)
{
示例4: preg_split
$ar_buf = preg_split('/\\s+/', $mounts[$i], 6);
$results[$i - 1] = array();
$results[$i - 1]['disk'] = $ar_buf[0];
$results[$i - 1]['size'] = $ar_buf[1];
$results[$i - 1]['used'] = $ar_buf[2];
$results[$i - 1]['free'] = $ar_buf[3];
$results[$i - 1]['percent'] = round($results[$i - 1]['used'] * 100 / $results[$i - 1]['size']) . '%';
$results[$i - 1]['mount'] = $ar_buf[5];
$fstype[$ar_buf[5]] ? $results[$i - 1]['fstype'] = $fstype[$ar_buf[5]] : ($results[$i - 1]['fstype'] = $fsdev[$ar_buf[0]]);
}
return $results;
}
/* END system functions */
include '../include/vhcs-lib.php';
check_login();
$tpl = new pTemplate();
$tpl->define_dynamic('page', $cfg['ADMIN_TEMPLATE_PATH'] . '/sysinfo.tpl');
$tpl->define_dynamic('page_message', 'page');
$tpl->define_dynamic('hosting_plans', 'page');
$tpl->define_dynamic('disk_list', 'page');
$tpl->define_dynamic('disk_list_item', 'disk_list');
global $cfg;
$theme_color = $cfg['USER_INITIAL_THEME'];
$tpl->assign(array('TR_ADMIN_SYSTEM_INFO_PAGE_TITLE' => tr('VHCS - Virtual Hosting Control System'), 'THEME_COLOR_PATH' => "../themes/{$theme_color}", 'THEME_CHARSET' => tr('encoding'), 'ISP_LOGO' => get_logo($_SESSION['user_id']), 'VHCS_LICENSE' => $cfg['VHCS_LICENSE']));
function gen_mount_point(&$tpl)
{
$mount_points = filesystems();
while (list($number, $row) = each($mount_points)) {
if (($number + 1) % 2 == 0) {
$tpl->assign(array('ITEM_CLASS' => 'content'));
} else {
示例5: check_login
// | Copyright (c) 2001-2005 by moleSoftware |
// | http://vhcs.net | http://www.molesoftware.com |
// | |
// | This program is free software; you can redistribute it and/or |
// | modify it under the terms of the MPL General Public License |
// | as published by the Free Software Foundation; either version 1.1 |
// | of the License, or (at your option) any later version. |
// | |
// | You should have received a copy of the MPL Mozilla Public License |
// | along with this program; if not, write to the Open Source Initiative (OSI) |
// | http://opensource.org | osi@opensource.org |
// | |
// -------------------------------------------------------------------------------
include '../include/vhcs-lib.php';
check_login();
$tpl = new pTemplate();
$tpl->define_dynamic('page', $cfg['CLIENT_TEMPLATE_PATH'] . '/language.tpl');
$tpl->define_dynamic('page_message', 'page');
$tpl->define_dynamic('def_language', 'page');
$tpl->define_dynamic('logged_from', 'page');
$tpl->define_dynamic('custom_buttons', 'page');
/*
*
* page actions.
*
*/
if (isset($_POST['uaction']) && $_POST['uaction'] === 'save_lang') {
$user_id = $_SESSION['user_id'];
$user_lang = $_POST['def_language'];
$query = <<<SQL_QUERY
update
示例6: check_login
// | Copyright (c) 2001-2005 by moleSoftware |
// | http://vhcs.net | http://www.molesoftware.com |
// | |
// | This program is free software; you can redistribute it and/or |
// | modify it under the terms of the MPL General Public License |
// | as published by the Free Software Foundation; either version 1.1 |
// | of the License, or (at your option) any later version. |
// | |
// | You should have received a copy of the MPL Mozilla Public License |
// | along with this program; if not, write to the Open Source Initiative (OSI) |
// | http://opensource.org | osi@opensource.org |
// | |
// -------------------------------------------------------------------------------
include '../include/vhcs-lib.php';
check_login();
$tpl = new pTemplate();
$tpl->define_dynamic('page', $cfg['RESELLER_TEMPLATE_PATH'] . '/chpsswd.tpl');
$tpl->define_dynamic('page_message', 'page');
$tpl->define_dynamic('logged_from', 'page');
$tpl->define_dynamic('custom_buttons', 'page');
global $cfg;
$theme_color = $cfg['USER_INITIAL_THEME'];
$tpl->assign(array('TR_CLIENT_CHANGE_PASSWORD_PAGE_TITLE' => tr('VHCS - Reseller/Change Password'), 'THEME_COLOR_PATH' => "../themes/{$theme_color}", 'THEME_CHARSET' => tr('encoding'), 'VHCS_LICENSE' => $cfg['VHCS_LICENSE'], 'ISP_LOGO' => get_logo($_SESSION['user_id'])));
if (isset($_POST['uaction']) && $_POST['uaction'] === 'updt_pass') {
if ($_POST['pass'] === '' || $_POST['pass_rep'] === '') {
set_page_message(tr('Please fill up both data fields!'));
} else {
if ($_POST['pass'] !== $_POST['pass_rep']) {
set_page_message(tr('Passwords does not match!'));
} else {
if (chk_password($_POST['pass']) > 0) {
示例7: check_login
// | http://vhcs.net | http://www.molesoftware.com |
// | |
// | This program is free software; you can redistribute it and/or |
// | modify it under the terms of the MPL General Public License |
// | as published by the Free Software Foundation; either version 1.1 |
// | of the License, or (at your option) any later version. |
// | |
// | You should have received a copy of the MPL Mozilla Public License |
// | along with this program; if not, write to the Open Source Initiative (OSI) |
// | http://opensource.org | osi@opensource.org |
// | |
// -------------------------------------------------------------------------------
// Begin page line
include '../include/vhcs-lib.php';
check_login();
$tpl = new pTemplate();
$tpl->define_dynamic('page', $cfg['RESELLER_TEMPLATE_PATH'] . '/orders.tpl');
$tpl->define_dynamic('logged_from', 'page');
$tpl->define_dynamic('custom_buttons', 'page');
$tpl->define_dynamic('page_message', 'page');
// Table with orders
$tpl->define_dynamic('orders_table', 'page');
$tpl->define_dynamic('order', 'orders_table');
// scrolling
$tpl->define_dynamic('scroll_prev_gray', 'page');
$tpl->define_dynamic('scroll_prev', 'page');
$tpl->define_dynamic('scroll_next_gray', 'page');
$tpl->define_dynamic('scroll_next', 'page');
global $cfg;
$theme_color = $cfg['USER_INITIAL_THEME'];
$tpl->assign(array('TR_RESELLER_MAIN_INDEX_PAGE_TITLE' => tr('VHCS - Reseller/Order management'), 'THEME_COLOR_PATH' => "../themes/{$theme_color}", 'THEME_CHARSET' => tr('encoding'), 'VHCS_LICENSE' => $cfg['VHCS_LICENSE'], 'ISP_LOGO' => get_logo($_SESSION['user_id'])));
示例8: check_login
// | Copyright (c) 2001-2005 by moleSoftware |
// | http://vhcs.net | http://www.molesoftware.com |
// | |
// | This program is free software; you can redistribute it and/or |
// | modify it under the terms of the MPL General Public License |
// | as published by the Free Software Foundation; either version 1.1 |
// | of the License, or (at your option) any later version. |
// | |
// | You should have received a copy of the MPL Mozilla Public License |
// | along with this program; if not, write to the Open Source Initiative (OSI) |
// | http://opensource.org | osi@opensource.org |
// | |
// -------------------------------------------------------------------------------
include '../include/vhcs-lib.php';
check_login();
$tpl = new pTemplate();
$tpl->define_dynamic('page', $cfg['RESELLER_TEMPLATE_PATH'] . '/domain_alias.tpl');
$tpl->define_dynamic('page_message', 'page');
$tpl->define_dynamic('logged_from', 'page');
$tpl->define_dynamic('table_list', 'page');
$tpl->define_dynamic('table_item', 'table_list');
$tpl->define_dynamic('custom_buttons', 'page');
$tpl->define_dynamic('scroll_prev', 'page');
$tpl->define_dynamic('scroll_next_gray', 'page');
$tpl->define_dynamic('scroll_next', 'page');
global $cfg;
$theme_color = $cfg['USER_INITIAL_THEME'];
$tpl->assign(array('TR_ALIAS_PAGE_TITLE' => tr('VHCS - Manage Domain/Alias'), 'THEME_COLOR_PATH' => "../themes/{$theme_color}", 'THEME_CHARSET' => tr('encoding'), 'VHCS_LICENSE' => $cfg['VHCS_LICENSE'], 'ISP_LOGO' => get_logo($_SESSION['user_id'])));
/*
*
* static page messages.
示例9: check_login
// | Copyright (c) 2001-2005 by moleSoftware |
// | http://vhcs.net | http://www.molesoftware.com |
// | |
// | This program is free software; you can redistribute it and/or |
// | modify it under the terms of the MPL General Public License |
// | as published by the Free Software Foundation; either version 1.1 |
// | of the License, or (at your option) any later version. |
// | |
// | You should have received a copy of the MPL Mozilla Public License |
// | along with this program; if not, write to the Open Source Initiative (OSI) |
// | http://opensource.org | osi@opensource.org |
// | |
// -------------------------------------------------------------------------------
include '../include/vhcs-lib.php';
check_login();
$tpl = new pTemplate();
$tpl->define_dynamic('page', $cfg['CLIENT_TEMPLATE_PATH'] . '/add_subdomain.tpl');
$tpl->define_dynamic('page_message', 'page');
$tpl->define_dynamic('logged_from', 'page');
$tpl->define_dynamic('custom_buttons', 'page');
//
// page functions.
//
function check_subdomain_permissions($sql, $user_id)
{
list($dmn_id, $dmn_name, $dmn_gid, $dmn_uid, $dmn_created_id, $dmn_created, $dmn_last_modified, $dmn_mailacc_limit, $dmn_ftpacc_limit, $dmn_traff_limit, $dmn_sqld_limit, $dmn_sqlu_limit, $dmn_status, $dmn_als_limit, $dmn_subd_limit, $dmn_ip_id, $dmn_disk_limit, $dmn_disk_usage, $dmn_php, $dmn_cgi) = get_domain_default_props($sql, $user_id);
$sub_cnt = get_domain_running_sub_cnt($sql, $dmn_id);
if ($dmn_subd_limit != 0 && $sub_cnt >= $dmn_subd_limit) {
set_page_message(tr('Subdomain limit expired!'));
header("Location: manage_domains.php");
die;
示例10: unset_user_login_data
// -------------------------------------------------------------------------------
// | VHCS(tm) - Virtual Hosting Control System |
// | Copyright (c) 2001-2005 be moleSoftware |
// | http://vhcs.net | http://www.molesoftware.com |
// | |
// | This program is free software; you can redistribute it and/or |
// | modify it under the terms of the MPL General Public License |
// | as published by the Free Software Foundation; either version 1.1 |
// | of the License, or (at your option) any later version. |
// | |
// | You should have received a copy of the MPL Mozilla Public License |
// | along with this program; if not, write to the Open Source Initiative (OSI) |
// | http://opensource.org | osi@opensource.org |
// | |
// -------------------------------------------------------------------------------
include 'include/vhcs-lib.php';
unset_user_login_data();
if (isset($_SESSION['user_theme_color'])) {
global $cfg;
$theme_color = $cfg['USER_INITIAL_THEME'];
} else {
$theme_color = $cfg['USER_INITIAL_THEME_COLOR'];
}
$tpl = new pTemplate();
$tpl->define('page', $cfg['LOGIN_TEMPLATE_PATH'] . '/index.tpl');
$tpl->assign(array('TR_MAIN_INDEX_PAGE_TITLE' => tr('VHCS - Virtual Hosting Control System'), 'THEME_COLOR_PATH' => "themes/{$theme_color}", 'THEME_CHARSET' => tr('encoding'), 'TC_BLUE_SELECTED' => $theme_color === 'blue' ? 'selected' : '', 'TC_GREEN_SELECTED' => $theme_color === 'green' ? 'selected' : '', 'TC_YELLOW_SELECTED' => $theme_color === 'yellow' ? 'selected' : '', 'TC_RED_SELECTED' => $theme_color === 'red' ? 'selected' : '', 'TR_LOGIN' => tr('Login'), 'TR_USERNAME' => tr('Username'), 'TR_PASSWORD' => tr('Password'), 'TR_THEME_COLOR' => tr('Theme color'), 'TR_BLUE' => tr('Blue'), 'TR_GREEN' => tr('Green'), 'TR_YELLOW' => tr('Yellow'), 'TR_RED' => tr('Red'), 'TR_LOSTPW' => tr('Lost password'), 'TR_TIME' => date("g:i a"), 'TR_DATE' => date("l dS of F Y"), 'TR_VHCS_LICENSE' => $cfg['VHCS_LICENSE']));
$tpl->parse('PAGE', 'page');
$tpl->prnt();
if (isset($cfg['DUMP_GUI_DEBUG'])) {
dump_gui_debug();
}
示例11: pTemplate
// | VHCS(tm) - Virtual Hosting Control System |
// | Copyright (c) 2001-2005 be moleSoftware |
// | http://vhcs.net | http://www.molesoftware.com |
// | |
// | This program is free software; you can redistribute it and/or |
// | modify it under the terms of the MPL General Public License |
// | as published by the Free Software Foundation; either version 1.1 |
// | of the License, or (at your option) any later version. |
// | |
// | You should have received a copy of the MPL Mozilla Public License |
// | along with this program; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
// | |
// -------------------------------------------------------------------------------
include '../include/vhcs-lib.php';
$tpl = new pTemplate();
$tpl->define_dynamic('page', $cfg['PURCHASE_TEMPLATE_PATH'] . '/package_info.tpl');
$tpl->define_dynamic('purchase_list', 'page');
$tpl->define_dynamic('purchase_message', 'page');
$tpl->define_dynamic('purchase_header', 'page');
$tpl->define_dynamic('purchase_footer', 'page');
/*
* Functions start
*/
function translate_sse($value)
{
if ($value == '_yes_') {
return tr('Yes');
} else {
if ($value == '_no_') {
return tr('No');
示例12: check_login
// | http://vhcs.net | http://www.molesoftware.com |
// | |
// | This program is free software; you can redistribute it and/or |
// | modify it under the terms of the MPL General Public License |
// | as published by the Free Software Foundation; either version 1.1 |
// | of the License, or (at your option) any later version. |
// | |
// | You should have received a copy of the MPL Mozilla Public License |
// | along with this program; if not, write to the Open Source Initiative (OSI) |
// | http://opensource.org | osi@opensource.org |
// | |
// -------------------------------------------------------------------------------
// Begin page line
include '../include/vhcs-lib.php';
check_login();
$tpl = new pTemplate();
$tpl->define_dynamic('page', $cfg['RESELLER_TEMPLATE_PATH'] . '/orders_detailst.tpl');
$tpl->define_dynamic('logged_from', 'page');
$tpl->define_dynamic('custom_buttons', 'page');
$tpl->define_dynamic('ip_entry', 'page');
$tpl->define_dynamic('page_message', 'page');
global $cfg;
$theme_color = $cfg['USER_INITIAL_THEME'];
$tpl->assign(array('TR_RESELLER_MAIN_INDEX_PAGE_TITLE' => tr('VHCS - Reseller/Order details'), 'THEME_COLOR_PATH' => "../themes/{$theme_color}", 'THEME_CHARSET' => tr('encoding'), 'VHCS_LICENSE' => $cfg['VHCS_LICENSE'], 'ISP_LOGO' => get_logo($_SESSION['user_id'])));
// Functions
//*
//*
function gen_order_details(&$tpl, &$sql, $user_id, $order_id)
{
$query = <<<SQL_QUERY
select
示例13: check_login
// | Copyright (c) 2001-2005 by moleSoftware |
// | http://vhcs.net | http://www.molesoftware.com |
// | |
// | This program is free software; you can redistribute it and/or |
// | modify it under the terms of the MPL General Public License |
// | as published by the Free Software Foundation; either version 1.1 |
// | of the License, or (at your option) any later version. |
// | |
// | You should have received a copy of the MPL Mozilla Public License |
// | along with this program; if not, write to the Open Source Initiative (OSI) |
// | http://opensource.org | osi@opensource.org |
// | |
// -------------------------------------------------------------------------------
include '../include/vhcs-lib.php';
check_login();
$tpl = new pTemplate();
$tpl->define_dynamic('page', $cfg['CLIENT_TEMPLATE_PATH'] . '/sql_execute_query.tpl');
$tpl->define_dynamic('page_message', 'page');
$tpl->define_dynamic('logged_from', 'page');
$tpl->define_dynamic('sql_result', 'page');
$tpl->define_dynamic('custom_buttons', 'page');
if (isset($_GET['id'])) {
$db_user_id = $_GET['id'];
} else {
if (isset($_POST['id'])) {
$db_user_id = $_POST['id'];
} else {
user_goto('manage_sql.php');
}
}
//
示例14: check_login
// | Copyright (c) 2001-2005 by moleSoftware |
// | http://vhcs.net | http://www.molesoftware.com |
// | |
// | This program is free software; you can redistribute it and/or |
// | modify it under the terms of the MPL General Public License |
// | as published by the Free Software Foundation; either version 1.1 |
// | of the License, or (at your option) any later version. |
// | |
// | You should have received a copy of the MPL Mozilla Public License |
// | along with this program; if not, write to the Open Source Initiative (OSI) |
// | http://opensource.org | osi@opensource.org |
// | |
// -------------------------------------------------------------------------------
include '../include/vhcs-lib.php';
check_login();
$tpl = new pTemplate();
$tpl->define_dynamic('page', $cfg['CLIENT_TEMPLATE_PATH'] . '/edit_mail_acc.tpl');
$tpl->define_dynamic('page_message', 'page');
$tpl->define_dynamic('logged_from', 'page');
$tpl->define_dynamic('normal_mail', 'page');
$tpl->define_dynamic('forward_mail', 'page');
$tpl->define_dynamic('custom_buttons', 'page');
//
// page functions.
//
function edit_mail_account(&$tpl, &$sql)
{
if (!isset($_GET['id']) || $_GET['id'] === '' || !is_numeric($_GET['id'])) {
set_page_message(tr('Email account not found!'));
header('Location: email_accounts.php');
die;
示例15: check_login
// | Copyright (c) 2001-2005 by moleSoftware |
// | http://vhcs.net | http://www.molesoftware.com |
// | |
// | This program is free software; you can redistribute it and/or |
// | modify it under the terms of the MPL General Public License |
// | as published by the Free Software Foundation; either version 1.1 |
// | of the License, or (at your option) any later version. |
// | |
// | You should have received a copy of the MPL Mozilla Public License |
// | along with this program; if not, write to the Open Source Initiative (OSI) |
// | http://opensource.org | osi@opensource.org |
// | |
// -------------------------------------------------------------------------------
include '../include/vhcs-lib.php';
check_login();
$tpl = new pTemplate();
$tpl->define_dynamic('page', $cfg['RESELLER_TEMPLATE_PATH'] . '/new_ticket.tpl');
$tpl->define_dynamic('page_message', 'page');
$tpl->define_dynamic('logged_from', 'page');
$tpl->define_dynamic('custom_buttons', 'page');
//
// page functions.
//
function send_user_message(&$sql, $user_id, $user_created_by)
{
if (!isset($_POST['uaction'])) {
return;
}
if ($_POST['subj'] === '') {
set_page_message(tr('Please specify message subject!'));
return;