本文整理汇总了PHP中phemplate类的典型用法代码示例。如果您正苦于以下问题:PHP phemplate类的具体用法?PHP phemplate怎么用?PHP phemplate使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了phemplate类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: upcoming_eot
function upcoming_eot()
{
global $dbtable_prefix;
$config['days_before'] = 4;
$query_strlen = 20000;
$now = gmdate('Ymd');
$query = "SELECT b.`email`,c.`_user` as `user` FROM `{$dbtable_prefix}payments` a,`" . USER_ACCOUNTS_TABLE . "` b,`{$dbtable_prefix}user_profiles` c WHERE a.`fk_user_id`=b.`" . USER_ACCOUNT_ID . "` AND a.`fk_user_id`=c.`fk_user_id` AND a.`paid_until`='{$now}'-INTERVAL " . $config['days_before'] . " DAY AND a.`is_active`=1 AND a.`is_recurring`=0";
if (!($res = @mysql_query($query))) {
trigger_error(mysql_error(), E_USER_ERROR);
}
$alerts = array();
while ($rsrow = mysql_fetch_assoc($res)) {
$alerts[$rsrow['email']] = $rsrow;
}
if (!empty($alerts)) {
$skin = get_default_skin_dir();
$tpl = new phemplate(_BASEPATH_ . '/skins_site/' . $skin . '/emails/', 'remove_nonjs');
$tpl->set_file('temp', 'subscr_expire_alert.html');
$tpl->set_var('tplvars', $tplvars);
$subject = sprintf($GLOBALS['_lang'][218], _SITENAME_);
$subject = sanitize_and_format($subject, TYPE_STRING, $GLOBALS['__field2format'][FIELD_TEXTFIELD]);
$insert = "INSERT INTO `{$dbtable_prefix}queue_email` (`to`,`subject`,`message_body`) VALUES ";
$iquery = $insert;
foreach ($alerts as $email => $v) {
$tpl->set_var('output', $v);
$message_body = $tpl->process('', 'temp', TPL_LOOP | TPL_OPTLOOP | TPL_OPTIONAL | TPL_FINISH);
$message_body = sanitize_and_format($message_body, TYPE_STRING, $GLOBALS['__field2format'][FIELD_TEXTAREA]);
if (strlen($iquery) > $query_strlen) {
$iquery = substr($iquery, 0, -1);
if (!($res = @mysql_query($iquery))) {
trigger_error(mysql_error(), E_USER_ERROR);
}
$iquery = $insert;
}
$iquery .= "('{$email}','{$subject}','{$message_body}'),";
}
if ($iquery != $insert) {
$iquery = substr($iquery, 0, -1);
if (!($res = @mysql_query($iquery))) {
trigger_error(mysql_error(), E_USER_ERROR);
}
}
}
return true;
}
示例2: DateMill
Etano
===============================================================================
File: my_responses.php
$Revision$
Software by: DateMill (http://www.datemill.com)
Copyright by: DateMill (http://www.datemill.com)
Support at: http://www.datemill.com/forum
*******************************************************************************
* See the "docs/licenses/etano.txt" file for license. *
******************************************************************************/
require 'includes/common.inc.php';
require _BASEPATH_ . '/includes/user_functions.inc.php';
require _BASEPATH_ . '/includes/tables/user_mtpls.inc.php';
require _BASEPATH_ . '/skins_site/' . get_my_skin() . '/lang/mailbox.inc.php';
check_login_member('saved_messages');
$tpl = new phemplate(_BASEPATH_ . '/skins_site/' . get_my_skin() . '/', 'remove_nonjs');
$o = isset($_GET['o']) ? (int) $_GET['o'] : 0;
$r = !empty($_GET['r']) ? (int) $_GET['r'] : current($accepted_results_per_page);
$config['bbcode_message'] = get_site_option('bbcode_message', 'core');
$from = "`{$dbtable_prefix}user_mtpls`";
$where = "`fk_user_id`='" . $_SESSION[_LICENSE_KEY_]['user']['user_id'] . "'";
$query = "SELECT count(*) FROM {$from} WHERE {$where}";
if (!($res = @mysql_query($query))) {
trigger_error(mysql_error(), E_USER_ERROR);
}
$totalrows = mysql_result($res, 0, 0);
$loop = array();
if (!empty($totalrows)) {
if ($o >= $totalrows) {
$o = $totalrows - $r;
$o = $o >= 0 ? $o : 0;
示例3: DateMill
/******************************************************************************
Etano
===============================================================================
File: admin/loc_countries_addedit.php
$Revision$
Software by: DateMill (http://www.datemill.com)
Copyright by: DateMill (http://www.datemill.com)
Support at: http://www.datemill.com/forum
*******************************************************************************
* See the "docs/licenses/etano.txt" file for license. *
******************************************************************************/
require_once '../includes/common.inc.php';
require_once '../includes/admin_functions.inc.php';
require_once '../includes/tables/loc_countries.inc.php';
allow_dept(DEPT_ADMIN);
$tpl = new phemplate('skin/', 'remove_nonjs');
$countries = $countries_default['defaults'];
if (isset($_SESSION['topass']['input'])) {
$countries = $_SESSION['topass']['input'];
} elseif (!empty($_GET['country_id'])) {
$country_id = (int) $_GET['country_id'];
$query = "SELECT `country_id`,`country`,`iso3166`,`prefered_input` FROM `{$dbtable_prefix}loc_countries` WHERE `country_id`={$country_id}";
if (!($res = @mysql_query($query))) {
trigger_error(mysql_error(), E_USER_ERROR);
}
if (mysql_num_rows($res)) {
$countries = mysql_fetch_assoc($res);
$countries['country'] = sanitize_and_format($countries['country'], TYPE_STRING, $__field2format[TEXT_DB2EDIT]);
}
}
$countries['prefered_input'] = vector2options($country_prefered_input, $countries['prefered_input']);
示例4: DateMill
/******************************************************************************
Etano
===============================================================================
File: admin/subscriptions.php
$Revision$
Software by: DateMill (http://www.datemill.com)
Copyright by: DateMill (http://www.datemill.com)
Support at: http://www.datemill.com/forum
*******************************************************************************
* See the "docs/licenses/etano.txt" file for license. *
******************************************************************************/
require_once '../includes/common.inc.php';
require_once '../includes/admin_functions.inc.php';
allow_dept(DEPT_ADMIN);
$tpl = new phemplate('skin/', 'remove_nonjs');
$where = 'a.`m_value_to`=b.`m_value`';
$from = "`{$dbtable_prefix}subscriptions` a,`{$dbtable_prefix}memberships` b";
$query = "SELECT count(*) FROM {$from} WHERE {$where}";
if (!($res = @mysql_query($query))) {
trigger_error(mysql_error(), E_USER_ERROR);
}
$totalrows = mysql_result($res, 0, 0);
$subscriptions = array();
if (!empty($totalrows)) {
$query = "SELECT a.`subscr_id`,a.`subscr_name`,a.`price`,a.`currency`,a.`is_recurent`,b.`m_name` as `m_value_to`,a.`duration`,a.`is_visible` FROM {$from} WHERE {$where} ORDER BY a.`subscr_id`";
if (!($res = @mysql_query($query))) {
trigger_error(mysql_error(), E_USER_ERROR);
}
while ($rsrow = mysql_fetch_assoc($res)) {
$rsrow['currency'] = isset($accepted_currencies[$rsrow['currency']]) ? $accepted_currencies[$rsrow['currency']] : '';
示例5: DateMill
<?php
/******************************************************************************
Etano
===============================================================================
File: admin/blog_search.php
$Revision$
Software by: DateMill (http://www.datemill.com)
Copyright by: DateMill (http://www.datemill.com)
Support at: http://www.datemill.com/forum
*******************************************************************************
* See the "docs/licenses/etano.txt" file for license. *
******************************************************************************/
require_once '../includes/common.inc.php';
require_once '../includes/admin_functions.inc.php';
allow_dept(DEPT_ADMIN);
$tpl = new phemplate('skin/', 'remove_nonjs');
$output = array();
$output['stat'] = vector2options($accepted_pstats);
$tpl->set_file('content', 'blog_search.html');
$tpl->set_var('output', $output);
$tpl->process('content', 'content', TPL_LOOP);
$tplvars['title'] = 'Search';
$tplvars['css'] = 'blog_search.css';
$tplvars['page'] = 'blog_search';
include 'frame.php';
示例6: DateMill
$Revision$
Software by: DateMill (http://www.datemill.com)
Copyright by: DateMill (http://www.datemill.com)
Support at: http://www.datemill.com/forum
*******************************************************************************
* See the "docs/licenses/etano.txt" file for license. *
******************************************************************************/
require '../includes/common.inc.php';
require _BASEPATH_ . '/includes/admin_functions.inc.php';
allow_dept(DEPT_MODERATOR | DEPT_ADMIN);
// cleanup after an 'impersonate user' action
if (isset($_GET['clean_user_session'])) {
$_SESSION[_LICENSE_KEY_]['user'] = array();
unset($_SESSION[_LICENSE_KEY_]['user']);
}
$tpl = new phemplate('skin/', 'remove_nonjs');
$output = array('_user' => '');
// needed for the title
$output['search_md5'] = sanitize_and_format_gpc($_GET, 'search', TYPE_STRING, $__field2format[FIELD_TEXTFIELD], '');
$uid = 0;
if (!empty($_GET['uid'])) {
$uid = (int) $_GET['uid'];
if (!empty($output['search_md5']) && isset($_GET['go']) && ($_GET['go'] == 1 || $_GET['go'] == -1)) {
$query = "SELECT `results` FROM `{$dbtable_prefix}site_searches` WHERE `search_md5`='" . $output['search_md5'] . "'";
if (!($res = @mysql_query($query))) {
trigger_error(mysql_error(), E_USER_ERROR);
}
if (mysql_num_rows($res)) {
$user_ids = mysql_result($res, 0, 0);
$user_ids = explode(',', $user_ids);
$key = array_search($uid, $user_ids) + $_GET['go'];
示例7: DateMill
/******************************************************************************
Etano
===============================================================================
File: admin/access_levels.php
$Revision$
Software by: DateMill (http://www.datemill.com)
Copyright by: DateMill (http://www.datemill.com)
Support at: http://www.datemill.com/forum
*******************************************************************************
* See the "docs/licenses/etano.txt" file for license. *
******************************************************************************/
require_once '../includes/common.inc.php';
require_once '../includes/admin_functions.inc.php';
allow_dept(DEPT_ADMIN);
$tpl = new phemplate('skin/', 'remove_nonjs');
$query = "SELECT `m_id`,`m_name`,`m_value`,`is_custom` FROM `{$dbtable_prefix}memberships` ORDER BY `m_id`";
if (!($res = @mysql_query($query))) {
trigger_error(mysql_error(), E_USER_ERROR);
}
$memberships = array();
$i = 0;
while ($rsrow = mysql_fetch_assoc($res)) {
$memberships[$i] = $rsrow;
if ($memberships[$i]['is_custom']) {
$memberships[$i]['m_name'] .= ' <a href="javascript:;" onclick="del_membership(' . $memberships[$i]['m_id'] . ')" title="Delete this membership"><img src="skin/images/del.png" alt="Delete this membership" /></a>';
}
++$i;
}
$query = "SELECT `level_id`,`level_code`,`level_diz`,`level`,`disabled_level` FROM `{$dbtable_prefix}access_levels`";
if (!($res = @mysql_query($query))) {
示例8: DateMill
/******************************************************************************
Etano
===============================================================================
File: index.php
$Revision$
Software by: DateMill (http://www.datemill.com)
Copyright by: DateMill (http://www.datemill.com)
Support at: http://www.datemill.com/forum
*******************************************************************************
* See the "docs/licenses/etano.txt" file for license. *
******************************************************************************/
//define('CACHE_LIMITER','private');
require 'includes/common.inc.php';
require _BASEPATH_ . '/includes/user_functions.inc.php';
check_login_member('all');
$tpl = new phemplate(_BASEPATH_ . '/skins_site/' . get_my_skin() . '/', 'remove_nonjs');
$tpl->set_file('content', 'index.html');
sort($basic_search_fields, SORT_NUMERIC);
$search_loop = create_search_form($basic_search_fields);
$tplvars['title'] = $tplvars['sitename'];
$tpl->set_loop('search', $search_loop);
$tpl->set_var('tplvars', $tplvars);
$tpl->process('content', 'content', TPL_OPTIONAL | TPL_LOOP);
if (!empty($GLOBALS['page_last_modified_time'])) {
// header('Expires: '. gmdate('D,d M Y H:i:s',time()+1209600).' GMT',true); // +14 days
// header('Expires: -1',true);
header('Cache-Control: private, max-age=0', true);
header('Last-Modified: ' . date('D,d M Y H:i:s', $GLOBALS['page_last_modified_time']) . ' GMT', true);
}
echo $tpl->process('content', 'content', TPL_FINISH | TPL_INCLUDE);
示例9: DateMill
/******************************************************************************
Etano
===============================================================================
File: admin/email_send.php
$Revision$
Software by: DateMill (http://www.datemill.com)
Copyright by: DateMill (http://www.datemill.com)
Support at: http://www.datemill.com/forum
*******************************************************************************
* See the "docs/licenses/etano.txt" file for license. *
******************************************************************************/
require_once '../includes/common.inc.php';
require_once '../includes/admin_functions.inc.php';
allow_dept(DEPT_ADMIN);
$tpl = new phemplate('skin/', 'remove_nonjs');
$output = array();
if (isset($_SESSION['topass']['input'])) {
$output = $_SESSION['topass']['input'];
$output['return2'] = $output['return'];
$output['return'] = rawurlencode($output['return']);
} else {
if (!empty($_REQUEST['search'])) {
$output['search'] = sanitize_and_format_gpc($_REQUEST, 'search', TYPE_STRING, $__field2format[FIELD_TEXTFIELD], '');
$query = "SELECT `results` FROM `{$dbtable_prefix}site_searches` WHERE `search_md5`='" . $output['search'] . "' AND `search_type`=" . SEARCH_USER;
if (!($res = @mysql_query($query))) {
trigger_error(mysql_error(), E_USER_ERROR);
}
if (mysql_num_rows($res)) {
$results = mysql_result($res, 0, 0);
$output['uids'] = explode(',', $results);
示例10: DateMill
===============================================================================
File: photo_view.php
$Revision$
Software by: DateMill (http://www.datemill.com)
Copyright by: DateMill (http://www.datemill.com)
Support at: http://www.datemill.com/forum
*******************************************************************************
* See the "docs/licenses/etano.txt" file for license. *
******************************************************************************/
//define('CACHE_LIMITER','private');
require 'includes/common.inc.php';
require _BASEPATH_ . '/includes/user_functions.inc.php';
require _BASEPATH_ . '/skins_site/' . get_my_skin() . '/lang/photos.inc.php';
require _BASEPATH_ . '/includes/network_functions.inc.php';
check_login_member('view_photo');
$tpl = new phemplate(_BASEPATH_ . '/skins_site/' . get_my_skin() . '/', 'remove_nonjs');
$photo_id = sanitize_and_format_gpc($_GET, 'photo_id', TYPE_INT, 0, 0);
$output = array();
$output['pic_width'] = get_site_option('pic_width', 'core_photo');
$loop_comments = array();
if (!empty($photo_id)) {
$query = "SELECT `photo_id`,`is_private`,`photo`,`caption`,`fk_user_id`,`_user` as `user`,`status`,`allow_comments`,`allow_rating`,`stat_votes`,`stat_votes_total` FROM `{$dbtable_prefix}user_photos` WHERE `photo_id`={$photo_id}";
if (!($res = @mysql_query($query))) {
trigger_error(mysql_error(), E_USER_ERROR);
}
if (mysql_num_rows($res)) {
$output = array_merge($output, mysql_fetch_assoc($res));
$is_friend = false;
if (!empty($_SESSION[_LICENSE_KEY_]['user']['user_id'])) {
$is_friend = is_network_member($output['fk_user_id'], $_SESSION[_LICENSE_KEY_]['user']['user_id'], NET_FRIENDS);
}
示例11: DateMill
/******************************************************************************
Etano
===============================================================================
File: admin/loc_countries.php
$Revision$
Software by: DateMill (http://www.datemill.com)
Copyright by: DateMill (http://www.datemill.com)
Support at: http://www.datemill.com/forum
*******************************************************************************
* See the "docs/licenses/etano.txt" file for license. *
******************************************************************************/
require_once '../includes/common.inc.php';
require_once '../includes/admin_functions.inc.php';
allow_dept(DEPT_ADMIN);
$tpl = new phemplate('skin/', 'remove_nonjs');
$o = isset($_GET['o']) ? (int) $_GET['o'] : 0;
$r = isset($_GET['r']) ? (int) $_GET['r'] : current($accepted_results_per_page);
$where = '1';
$from = "`{$dbtable_prefix}loc_countries`";
$query = "SELECT count(*) FROM {$from} WHERE {$where}";
if (!($res = @mysql_query($query))) {
trigger_error(mysql_error(), E_USER_ERROR);
}
$totalrows = mysql_result($res, 0, 0);
$countries = array();
if (!empty($totalrows)) {
if ($o >= $totalrows) {
$o = $totalrows - $r;
$o = $o >= 0 ? $o : 0;
}
示例12: DateMill
/******************************************************************************
Etano
===============================================================================
File: search_more.php
$Revision$
Software by: DateMill (http://www.datemill.com)
Copyright by: DateMill (http://www.datemill.com)
Support at: http://www.datemill.com/forum
*******************************************************************************
* See the "docs/licenses/etano.txt" file for license. *
******************************************************************************/
//define('CACHE_LIMITER','private');
require 'includes/common.inc.php';
require _BASEPATH_ . '/includes/user_functions.inc.php';
check_login_member('search_advanced');
$tpl = new phemplate(_BASEPATH_ . '/skins_site/' . get_my_skin() . '/', 'remove_nonjs');
$search_fields = array();
foreach ($_pcats as $pcat_id => $pcat) {
if ((int) $pcat['access_level'] & (int) $_SESSION[_LICENSE_KEY_]['user']['membership']) {
for ($i = 0; isset($pcat['fields'][$i]); ++$i) {
if (isset($_pfields[$pcat['fields'][$i]]->config['searchable'])) {
$search_fields[] = $pcat['fields'][$i];
}
}
}
}
sort($search_fields, SORT_NUMERIC);
$search_loop = create_search_form($search_fields);
$tpl->set_file('content', 'search_more.html');
$tpl->set_loop('search', $search_loop);
$tpl->process('content', 'content', TPL_LOOP);
示例13: DateMill
Etano
===============================================================================
File: admin/user_login.php
$Revision$
Software by: DateMill (http://www.datemill.com)
Copyright by: DateMill (http://www.datemill.com)
Support at: http://www.datemill.com/forum
*******************************************************************************
* See the "docs/licenses/etano.txt" file for license. *
******************************************************************************/
require_once '../includes/common.inc.php';
require_once '../includes/admin_functions.inc.php';
allow_dept(DEPT_ADMIN | DEPT_MODERATOR);
$output['uid'] = sanitize_and_format_gpc($_GET, 'uid', TYPE_INT, 0, 0);
$output['return'] = sanitize_and_format_gpc($_GET, 'return', TYPE_STRING, $__field2format[FIELD_TEXTFIELD], '');
$tpl = new phemplate('skin/', 'remove_nonjs');
if (isset($_GET['top'])) {
$content_file = 'user_login_top.html';
$tpl->set_var('user', $_SESSION[_LICENSE_KEY_]['user']);
} else {
$content_file = 'user_login.html';
if (strpos($output['return'], '?') === false) {
$qs_sep = '?';
} else {
$qs_sep = '&';
}
$output['return'] .= $qs_sep . 'clean_user_session=1';
$output['return'] = rawurlencode($output['return']);
$query = "SELECT a.`" . USER_ACCOUNT_ID . "` as `user_id`,b.`_user` as `user`,a.`status`,a.`membership`,UNIX_TIMESTAMP(a.`last_activity`) as `last_activity`,a.`email`,b.`status` as `pstat` FROM `" . USER_ACCOUNTS_TABLE . "` a LEFT JOIN `{$dbtable_prefix}user_profiles` b ON a.`" . USER_ACCOUNT_ID . "`=b.`fk_user_id` WHERE a.`" . USER_ACCOUNT_ID . "`=" . $output['uid'];
if (!($res = @mysql_query($query))) {
trigger_error(mysql_error(), E_USER_ERROR);
示例14: round
echo "<br>checkpoint[ini]: " . round(getmicrotime() - $pradedam, 2);
}
if (empty($lang) || $lang != 'lt' && $lang != 'en') {
$lang = $g_ini->read_var('site', 'Language');
}
$lang = clean_name($lang);
include_once $RELPATH . $LANGPATH . $lang . '.inc.php';
if (isset($GLOBALS['bench'])) {
echo "<br>checkpoint[lang]: " . round(getmicrotime() - $pradedam, 2);
}
$g_db = new avDb();
if (isset($GLOBALS['bench'])) {
echo "<br>checkpoint[db]: " . round(getmicrotime() - $pradedam, 2);
}
$g_sess = new avSession();
if (isset($GLOBALS['bench'])) {
echo "<br>checkpoint[session]: " . round(getmicrotime() - $pradedam, 2);
}
$g_tpl = new phemplate($RELPATH, 'keep');
$g_tpl->set_error_handler(&$g_error);
$g_tpl->set_var('RELPATH', $RELPATH);
//$g_tpl->set_var('G_PHP_SELF', $PHP_SELF);
$g_tpl->set_var('G_PHP_SELF', $_SERVER["PHP_SELF"]);
$g_tpl->set_var('lang', $g_lang);
$avms_version = '2.1';
$g_tpl->set_var('avms_version', $avms_version);
$g_tpl->set_var('users_online', $g_sess->users_online("registered"));
if (empty($g_user_id) || !$g_sess->userID) {
$g_user_id = false;
}
$g_usr = new avUser($g_user_id);
示例15: DateMill
/******************************************************************************
Etano
===============================================================================
File: admin/user_payment_history.php
$Revision$
Software by: DateMill (http://www.datemill.com)
Copyright by: DateMill (http://www.datemill.com)
Support at: http://www.datemill.com/forum
*******************************************************************************
* See the "docs/licenses/etano.txt" file for license. *
******************************************************************************/
require_once '../includes/common.inc.php';
require_once '../includes/admin_functions.inc.php';
allow_dept(DEPT_ADMIN);
$tpl = new phemplate('skin/', 'remove_nonjs');
$loop = array();
$output = array();
if (!empty($_GET['uid'])) {
$output['uid'] = (int) $_GET['uid'];
$query = "SELECT `m_value`,`m_name` FROM `{$dbtable_prefix}memberships`";
if (!($res = @mysql_query($query))) {
trigger_error(mysql_error(), E_USER_ERROR);
}
$memberships = array();
while ($rsrow = mysql_fetch_row($res)) {
$memberships[$rsrow[0]] = $rsrow[1];
}
$config = get_site_option(array('date_format', 'time_offset'), 'def_user_prefs');
$query = "SELECT `payment_id`,`fk_user_id`,`_user`,`gateway`,`gw_txn`,`name`,`country`,`email`,`is_subscr`,`m_value_to`,`amount_paid`,`refunded`,UNIX_TIMESTAMP(`paid_from`) as `paid_from`,UNIX_TIMESTAMP(`paid_until`) as `paid_until`,UNIX_TIMESTAMP(`date`) as `date`,`is_suspect`,`suspect_reason` FROM `{$dbtable_prefix}payments` WHERE `fk_user_id`=" . $output['uid'] . " ORDER BY `payment_id`";
if (!($res = @mysql_query($query))) {