本文整理汇总了PHP中phemplate::set_file方法的典型用法代码示例。如果您正苦于以下问题:PHP phemplate::set_file方法的具体用法?PHP phemplate::set_file怎么用?PHP phemplate::set_file使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类phemplate
的用法示例。
在下文中一共展示了phemplate::set_file方法的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
<?php
/******************************************************************************
Etano
===============================================================================
File: admin/photo_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', 'photo_search.html');
$tpl->set_var('output', $output);
$tpl->process('content', 'content', TPL_LOOP);
$tplvars['title'] = 'Search';
$tplvars['css'] = 'photo_search.css';
$tplvars['page'] = 'photo_search';
include 'frame.php';
示例3: phemplate
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']);
$tpl->set_file('content', 'loc_countries_addedit.html');
$tpl->set_var('countries', $countries);
if (isset($_GET['o'])) {
$tpl->set_var('o', $_GET['o']);
}
if (isset($_GET['r'])) {
$tpl->set_var('r', $_GET['r']);
}
$tpl->process('content', 'content');
$tplvars['title'] = 'Location Management: Countries';
$tplvars['page'] = 'loc_countries_addedit';
include 'frame.php';
示例4: while
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']] : '';
$rsrow['subscr_name'] = sanitize_and_format($rsrow['subscr_name'], TYPE_STRING, $__field2format[TEXT_DB2DISPLAY]);
if (!empty($rsrow['is_recurent'])) {
$rsrow['is_recurent'] = '<img src="skin/images/refresh.gif" title="Recuring" />';
} else {
unset($rsrow['is_recurent']);
}
if (!empty($rsrow['is_visible'])) {
$rsrow['is_visible'] = '<img src="skin/images/check.gif" />';
} else {
unset($rsrow['is_visible']);
}
if (empty($rsrow['duration'])) {
$rsrow['duration'] = 'Lifetime';
} else {
$rsrow['duration'] .= ' days';
}
$subscriptions[] = $rsrow;
}
}
$tpl->set_file('content', 'subscriptions.html');
$tpl->set_loop('subscriptions', $subscriptions);
$tpl->process('content', 'content', TPL_LOOP | TPL_NOLOOP);
$tpl->drop_loop('subscriptions');
$tplvars['title'] = 'Site Subscriptions';
$tplvars['page'] = 'subscriptions';
include 'frame.php';
示例5: array
$loop = array();
if (!empty($totalrows)) {
if ($o >= $totalrows) {
$o = $totalrows - $r;
$o = $o >= 0 ? $o : 0;
}
$query = "SELECT * FROM {$from} WHERE {$where} ORDER BY `news_id` DESC LIMIT {$o},{$r}";
if (!($res = @mysql_query($query))) {
trigger_error(mysql_error(), E_USER_ERROR);
}
while ($rsrow = mysql_fetch_assoc($res)) {
$rsrow['news_title'] = sanitize_and_format($rsrow['news_title'], TYPE_STRING, $__field2format[TEXT_DB2DISPLAY]);
$loop[] = $rsrow;
}
$output['pager2'] = pager($totalrows, $o, $r);
}
$output['return2me'] = 'site_news.php';
if (!empty($_SERVER['QUERY_STRING'])) {
$output['return2me'] .= '?' . $_SERVER['QUERY_STRING'];
}
$output['return2me'] = rawurlencode($output['return2me']);
$tpl->set_file('content', 'site_news.html');
$tpl->set_loop('loop', $loop);
$tpl->set_var('output', $output);
$tpl->process('content', 'content', TPL_LOOP | TPL_NOLOOP);
$tpl->drop_loop('loop');
$tpl->drop_var('output.pager2');
unset($loop);
$tplvars['title'] = 'Site news';
$tplvars['page'] = 'site_news';
include 'frame.php';
示例6: elseif
$p->finish();
}
}
} else {
$error = true;
$topass['message']['type'] = MESSAGE_ERROR;
$topass['message']['text'] = 'Error reading the package';
}
} else {
$error = true;
$topass['message']['type'] = MESSAGE_ERROR;
$topass['message']['text'] = 'File is not a valid Etano package';
}
}
if (isset($p) && $p->error && !empty($p->manual_actions)) {
$tpl->set_file('content', 'package_install.html');
$tpl->set_loop('manual_actions', $p->manual_actions);
$output['f'] = $file;
$output['finish'] = $install_index;
$output['show_finish'] = $show_finish;
$tpl->set_var('output', $output);
$tpl->process('content', 'content', TPL_LOOP | TPL_OPTIONAL);
$tplvars['title'] = 'Package Manager';
$tplvars['page'] = 'package_install';
$tplvars['css'] = 'package_install.css';
include 'frame.php';
} elseif ($ui_request) {
$tpl->set_file('content', 'package_ui.html');
$tpl->set_var('output', $p->ui);
$tpl->process('content', 'content');
$tplvars['title'] = 'Package Manager';
示例7: array
trigger_error(mysql_error(), E_USER_ERROR);
}
$i = 0;
$access_levels = array();
while ($rsrow = mysql_fetch_assoc($res)) {
$rsrow['level_code'] = sanitize_and_format($rsrow['level_code'], TYPE_STRING, $__field2format[TEXT_DB2DISPLAY]);
$rsrow['level_diz'] = sanitize_and_format($rsrow['level_diz'], TYPE_STRING, $__field2format[TEXT_DB2DISPLAY]);
$access_levels[$i]['row'] = '<td><a href="access_levels_addedit.php?level_id=' . $rsrow['level_id'] . '" title="' . $rsrow['level_diz'] . '">' . $rsrow['level_code'] . "</a></td>\n";
for ($j = 0; isset($memberships[$j]); ++$j) {
$access_levels[$i]['row'] .= '<td><input type="checkbox" name="levels[' . $rsrow['level_id'] . '][' . $memberships[$j]['m_value'] . ']" value="1"';
if ((int) $memberships[$j]['m_value'] & (int) $rsrow['level']) {
$access_levels[$i]['row'] .= ' checked="checked"';
}
if ((int) $memberships[$j]['m_value'] & (int) $rsrow['disabled_level']) {
$access_levels[$i]['row'] .= ' disabled="disabled"';
}
$access_levels[$i]['row'] .= " /></td>\n";
}
++$i;
}
$tpl->set_file('content', 'access_levels.html');
$tpl->set_loop('access_levels', $access_levels);
$tpl->set_loop('memberships', $memberships);
$tpl->process('content', 'content', TPL_LOOP | TPL_NOLOOP);
$tpl->drop_loop('access_levels');
$tpl->drop_loop('memberships');
unset($access_levels);
unset($memberships);
$tplvars['title'] = 'Define access levels';
$tplvars['page'] = 'access_levels';
include 'frame.php';
示例8: while
if (!empty($totalrows)) {
if ($o >= $totalrows) {
$o = $totalrows - $r;
$o = $o >= 0 ? $o : 0;
}
$config = get_site_option(array('datetime_format'), 'def_user_prefs');
$query = "SELECT `fk_user_id`,`user`,`level_code`,`ip`,UNIX_TIMESTAMP(`time`) as `time` FROM {$from} WHERE {$where} ORDER BY `log_id` DESC LIMIT {$o},{$r}";
if (!($res = @mysql_query($query))) {
trigger_error(mysql_error(), E_USER_ERROR);
}
while ($rsrow = mysql_fetch_assoc($res)) {
if (!empty($rsrow['fk_user_id'])) {
$rsrow['user'] = '<a href="profile.php?uid=' . $rsrow['fk_user_id'] . '">' . $rsrow['user'] . '</a>';
}
$rsrow['time'] = strftime($config['datetime_format'], $rsrow['time']);
$rsrow['ip'] = long2ip($rsrow['ip']);
$loop[] = $rsrow;
}
$output['pager2'] = pager($totalrows, $o, $r);
}
$tpl->set_file('content', 'site_log.html');
$tpl->set_loop('loop', $loop);
$tpl->set_var('output', $output);
$tpl->process('content', 'content', TPL_LOOP | TPL_NOLOOP);
$tpl->drop_loop('loop');
$tpl->drop_var('output.pager2');
unset($loop);
$tplvars['title'] = 'Site Activity Log';
$tplvars['page'] = 'site_log';
$tplvars['css'] = 'site_log.css';
include 'frame.php';
示例9: array
if (!($res = @mysql_query($query))) {
trigger_error(mysql_error(), E_USER_ERROR);
}
$output['m_name'] = mysql_result($res, 0, 0);
$output['paid_until'] = $GLOBALS['_lang'][123];
}
$my_stats = get_user_stats($_SESSION[_LICENSE_KEY_]['user']['user_id'], array('total_photos', 'pviews', 'num_friends'));
$query = "SELECT count(*) FROM `{$dbtable_prefix}user_inbox` WHERE `fk_user_id`='" . $_SESSION[_LICENSE_KEY_]['user']['user_id'] . "' AND `del`=0";
if (!($res = @mysql_query($query))) {
trigger_error(mysql_error(), E_USER_ERROR);
}
$my_stats['total_messages'] = mysql_result($res, 0, 0);
$query = "SELECT count(*) FROM `{$dbtable_prefix}user_inbox` WHERE `is_read`=0 AND `fk_user_id`='" . $_SESSION[_LICENSE_KEY_]['user']['user_id'] . "' AND `del`=0";
if (!($res = @mysql_query($query))) {
trigger_error(mysql_error(), E_USER_ERROR);
}
$my_stats['new_messages'] = mysql_result($res, 0, 0);
$tpl->set_file('content', 'home.html');
$tpl->set_var('output', $output);
$tpl->set_var('my_stats', $my_stats);
$tpl->process('content', 'content');
$tplvars['title'] = $GLOBALS['_lang'][124];
$tplvars['page_title'] = $GLOBALS['_lang'][124];
$tplvars['page'] = 'home';
$tplvars['css'] = 'home.css';
if (is_file('home_left.php')) {
include 'home_left.php';
}
unset($page_last_modified_time);
// we want everything fresh on this page.
include 'frame.php';
示例10: DateMill
===============================================================================
File: install/step3.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. *
******************************************************************************/
ini_set('include_path', '.');
ini_set('session.use_cookies', 1);
ini_set('session.use_trans_sid', 0);
ini_set('date.timezone', 'GMT');
// temporary fix for the php 5.1+ TZ compatibility
ini_set('error_reporting', 2047);
ini_set('display_errors', 0);
define('_LICENSE_KEY_', '');
require_once '../includes/sessions.inc.php';
require_once '../includes/sco_functions.inc.php';
require_once '../includes/classes/phemplate.class.php';
$output = array();
$tpl = new phemplate('skin/', 'remove_nonjs');
$tpl->set_file('content', 'step3.html');
$tplvars = array();
$tplvars['page_title'] = 'Etano Install Process';
$tplvars['css'] = 'step3.css';
$tplvars['page'] = 'step3';
$tpl->set_var('output', $output);
$tpl->set_var('tplvars', $tplvars);
$tpl->process('content', 'content');
include 'frame.php';
示例11: array
$output['uids'] = sanitize_and_format($_REQUEST['uids'], TYPE_INT, 0, array());
}
}
if (!empty($output['uids'])) {
$output['uids'] = join('|', $output['uids']);
} else {
$topass['message']['type'] = MESSAGE_ERROR;
$topass['message']['text'] = 'No members selected';
if (!empty($output['return'])) {
$nextpage = _BASEURL_ . '/admin/' . $output['return'];
} else {
$nextpage = _BASEURL_ . '/admin/member_search.php';
}
redirect2page($nextpage, $topass, '', true);
}
if (empty($output['return'])) {
if ($_SERVER['REQUEST_METHOD'] == 'GET') {
$output['return2'] = sanitize_and_format_gpc($_REQUEST, 'return', TYPE_STRING, $__field2format[FIELD_TEXTFIELD], '');
$output['return'] = rawurlencode($output['return2']);
} else {
$output['return'] = sanitize_and_format_gpc($_REQUEST, 'return', TYPE_STRING, $__field2format[FIELD_TEXTFIELD], '');
$output['return2'] = rawurldecode($output['return']);
}
}
$tpl->set_file('content', 'email_send.html');
$tpl->set_var('output', $output);
$tpl->process('content', 'content');
$tplvars['title'] = 'Send an Email';
$tplvars['page'] = 'email_send';
$tplvars['css'] = 'email_send.css';
include 'frame.php';
示例12: rawurlencode
redirect2page('info.php', $topass);
}
} else {
$topass['message']['type'] = MESSAGE_ERROR;
$topass['message']['text'] = $GLOBALS['_lang'][6];
redirect2page('info.php', $topass);
}
$output['lang_256'] = sanitize_and_format($GLOBALS['_lang'][256], TYPE_STRING, $__field2format[TEXT_DB2DISPLAY]);
$output['return2me'] = 'photo_view.php';
if (!empty($_SERVER['QUERY_STRING'])) {
$output['return2me'] .= '?' . $_SERVER['QUERY_STRING'];
}
$output['return2me'] = rawurlencode($output['return2me']);
$output['return2'] = sanitize_and_format_gpc($_GET, 'return', TYPE_STRING, $__field2format[FIELD_TEXTFIELD], '');
$output['return'] = rawurlencode($output['return2']);
$tpl->set_file('content', 'photo_view.html');
$tpl->set_var('output', $output);
$tpl->set_loop('loop_comments', $loop_comments);
$tpl->set_var('tplvars', $tplvars);
$tpl->process('content', 'content', TPL_LOOP | TPL_OPTLOOP | TPL_OPTIONAL);
$tpl->drop_loop('loop_comments');
unset($loop_comments);
$tplvars['title'] = sprintf($GLOBALS['_lang'][143], $output['user']);
$tplvars['page_title'] = sprintf($GLOBALS['_lang'][143], '<a href="' . $tplvars['relative_url'] . 'photo_search.php?st=user&uid=' . $output['fk_user_id'] . '">' . $output['user'] . '</a>');
$tplvars['page'] = 'photo_view';
$tplvars['css'] = 'photo_view.css';
if (is_file('photo_view_left.php')) {
include 'photo_view_left.php';
}
include 'frame.php';
if (!empty($photo_id) && isset($output['fk_user_id']) && (!empty($_SESSION[_LICENSE_KEY_]['user']['user_id']) && $output['fk_user_id'] != $_SESSION[_LICENSE_KEY_]['user']['user_id'] || empty($_SESSION[_LICENSE_KEY_]['user']['user_id']))) {
示例13: array
$totalrows = mysql_result($res, 0, 0);
$countries = array();
if (!empty($totalrows)) {
if ($o >= $totalrows) {
$o = $totalrows - $r;
$o = $o >= 0 ? $o : 0;
}
$query = "SELECT * FROM {$from} WHERE {$where} ORDER BY `country` ASC LIMIT {$o},{$r}";
if (!($res = @mysql_query($query))) {
trigger_error(mysql_error(), E_USER_ERROR);
}
$i = 0;
while ($rsrow = mysql_fetch_assoc($res)) {
$rsrow['country'] = sanitize_and_format($rsrow['country'], TYPE_STRING, $__field2format[TEXT_DB2DISPLAY]);
$rsrow['prefered_input'] = $country_prefered_input[$rsrow['prefered_input']];
$rsrow['myclass'] = $i % 2 ? 'odd_item' : 'even_item';
$countries[] = $rsrow;
++$i;
}
$tpl->set_var('pager1', pager($totalrows, $o, $r));
$tpl->set_var('pager2', pager($totalrows, $o, $r));
}
$tpl->set_file('content', 'loc_countries.html');
$tpl->set_loop('countries', $countries);
$tpl->set_var('o', $o);
$tpl->set_var('r', $r);
$tpl->process('content', 'content', TPL_LOOP | TPL_NOLOOP);
$tpl->drop_loop('countries');
$tplvars['title'] = 'Location Management: Countries';
$tplvars['page'] = 'loc_countries';
include 'frame.php';
示例14: phemplate
//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);
$tpl->drop_loop('search');
unset($search_loop);
$tplvars['title'] = $GLOBALS['_lang'][247];
$tplvars['page_title'] = $GLOBALS['_lang'][247];
$tplvars['page'] = 'search_more';
$tplvars['css'] = 'search_more.css';
if (is_file('search_more_left.php')) {
include 'search_more_left.php';
}
$no_timeout = true;
include 'frame.php';
示例15: phemplate
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);
}
if (mysql_num_rows($res)) {
$user = mysql_fetch_assoc($res);
$user['prefs'] = get_user_settings($user['user_id'], 'def_user_prefs', array('date_format', 'datetime_format', 'time_offset', 'rate_my_photos', 'profile_comments'));
$_SESSION[_LICENSE_KEY_]['user'] = $user;
}
}
$tpl->set_file('content', $content_file);
$tpl->set_var('output', $output);
echo $tpl->process('', 'content');