本文整理汇总了PHP中phemplate::set_loop方法的典型用法代码示例。如果您正苦于以下问题:PHP phemplate::set_loop方法的具体用法?PHP phemplate::set_loop怎么用?PHP phemplate::set_loop使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类phemplate
的用法示例。
在下文中一共展示了phemplate::set_loop方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
$memberships[] = $rsrow['m_value'];
$cols[]['content'] = $rsrow['m_name'];
}
$rows[0]['cols'] = $cols;
$query = "SELECT `level_diz`,`level` FROM `{$dbtable_prefix}access_levels` WHERE `level_code`<>'login'";
if (!($res = @mysql_query($query))) {
trigger_error(mysql_error(), E_USER_ERROR);
}
$j = 1;
while ($rsrow = mysql_fetch_assoc($res)) {
$cols = array();
$rows[$j]['level_diz'] = $rsrow['level_diz'];
for ($i = 0; isset($memberships[$i]); ++$i) {
if ((int) $rsrow['level'] & (int) $memberships[$i]) {
$cols[]['content'] = '<img src="' . $tplvars['tplrelpath'] . '/images/check.gif" />';
} else {
$cols[]['content'] = ' ';
}
}
$rows[$j]['cols'] = $cols;
++$j;
}
$tpl->set_file('content', 'plan-comparision-chart.html');
$tpl->set_loop('rows', $rows);
$tpl->process('content', 'content', TPL_MULTILOOP);
$tplvars['title'] = $GLOBALS['_lang'][245];
$tplvars['page_title'] = $GLOBALS['_lang'][245];
$tplvars['page'] = 'plan';
$tplvars['css'] = 'plan-comparision-chart.css';
$no_timeout = true;
include 'frame.php';
示例2: 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';
示例3: pager
}
$loop_rows[0]['class'] = 'first';
if (empty($rows)) {
$loop_rows[0]['class'] .= ' last';
} else {
$loop_rows[count($loop_rows) - 1]['class'] = 'last';
}
$output['pager2'] = pager($totalrows, $o, $r);
}
$output['return2me'] = 'my_photos.php';
if (!empty($_SERVER['QUERY_STRING'])) {
$output['return2me'] .= '?' . $_SERVER['QUERY_STRING'];
}
$output['return2me'] = rawurlencode($output['return2me']);
$tpl->set_file('content', 'my_photos.html');
$tpl->set_loop('loop_rows', $loop_rows);
$tpl->set_var('output', $output);
$tpl->process('content', 'content', TPL_MULTILOOP | TPL_OPTLOOP | TPL_OPTIONAL | TPL_NOLOOP);
$tpl->drop_loop('loop_rows');
unset($loop_rows);
$tpl->drop_var('output.pager2');
$tplvars['title'] = $GLOBALS['_lang'][140];
$tplvars['page_title'] = $GLOBALS['_lang'][140];
$tplvars['page'] = 'my_photos';
$tplvars['css'] = 'my_photos.css';
if (is_file('my_photos_left.php')) {
include 'my_photos_left.php';
}
unset($page_last_modified_time);
// we want everything fresh on this page.
include 'frame.php';
示例4: 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';
示例5: join
}
$output['ips'] = join(', ', $output['ips']);
}
$output['pic_width'] = get_site_option('pic_width', 'core_photo');
if (empty($output['search_md5'])) {
unset($output['search_md5']);
}
if (isset($_GET['o'])) {
$output['o'] = $_GET['o'];
}
if (isset($_GET['r'])) {
$output['r'] = $_GET['r'];
}
$output['return2me'] = 'profile.php';
if (!empty($_SERVER['QUERY_STRING'])) {
$output['return2me'] .= '?' . $_SERVER['QUERY_STRING'];
}
$output['return2me'] = rawurlencode($output['return2me']);
if (isset($_GET['return'])) {
$output['return2'] = sanitize_and_format($_GET['return'], TYPE_STRING, $__field2format[FIELD_TEXTFIELD]);
}
$tpl->set_file('content', 'profile.html');
$tpl->set_loop('categs', $categs);
$tpl->set_var('output', $output);
$tpl->set_var('account', $account);
$tpl->process('content', 'content', TPL_MULTILOOP | TPL_OPTIONAL);
$tpl->drop_loop('categs');
$tplvars['title'] = sprintf('%1$s Member Profile', $output['_user']);
$tplvars['css'] = 'profile.css';
$tplvars['page'] = 'profile';
include 'frame.php';
示例6: phemplate
<?php
include 'tplutil.inc';
include 'phemplate.class.php';
$tpl = new phemplate('slides/pragmatic/');
$tpl->set_var('TITLE', 'My Title');
$tpl->set_var('USER', get_user());
$tpl->set_loop('OPTIONS', get_users(true));
$tpl->set_file('main', 'phemplate.tpl');
echo $tpl->process('out', 'main', 1);
示例7: rawurlencode
} 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']))) {
$query = "UPDATE `{$dbtable_prefix}user_photos` SET `stat_views`=`stat_views`+1 WHERE `photo_id`={$photo_id}";
@mysql_query($query);
示例8: fgets
if (empty($temp) && function_exists('popen')) {
$fp = @popen('which php', 'r');
if ($fp) {
$temp = fgets($fp);
if (!empty($temp) && $temp[0] == '/') {
$_SESSION['install']['phpbin'] = trim($temp);
$_SESSION['install']['exec'] = 'popen';
}
@pclose($fp);
$fp = @popen('which mysql', 'r');
$temp = fgets($fp);
if (!empty($temp) && $temp[0] == '/') {
$_SESSION['install']['mysqlbin'] = trim($temp);
$_SESSION['install']['exec'] = 'popen';
}
@pclose($fp);
}
}
if (!$error) {
$output['continue'] = true;
}
$output['rand'] = mt_rand(1, 10000);
$tplvars = array();
$tplvars['page_title'] = 'Etano Install Process';
$tplvars['css'] = 'index.css';
$tplvars['page'] = 'index';
$tpl->set_var('output', $output);
$tpl->set_var('tplvars', $tplvars);
$tpl->set_loop('rw_files', $rw_files);
$tpl->process('content', 'content', TPL_OPTIONAL | TPL_LOOP);
include 'frame.php';
示例9: while
$o = $totalrows - $r;
$o = $o >= 0 ? $o : 0;
}
$query = "SELECT `state_id`,`state`,`num_cities` FROM {$from} WHERE {$where} ORDER BY `state` 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['state'] = sanitize_and_format($rsrow['state'], TYPE_STRING, $__field2format[TEXT_DB2DISPLAY]);
$rsrow['myclass'] = $i % 2 ? 'odd_item' : 'even_item';
$states[] = $rsrow;
++$i;
}
$tpl->set_var('pager1', pager($totalrows, $o, $r));
$tpl->set_var('pager2', pager($totalrows, $o, $r));
}
}
$tpl->set_file('content', 'loc_states.html');
$tpl->set_loop('states', $states);
$tpl->set_var('country_id', $country_id);
$tpl->set_var('country', $country);
$tpl->set_var('o', $o);
$tpl->set_var('r', $r);
$tpl->set_var('co', $co);
$tpl->set_var('cr', $cr);
$tpl->process('content', 'content', TPL_LOOP | TPL_NOLOOP);
$tpl->drop_loop('states');
$tplvars['title'] = 'Location Management: States';
$tplvars['page'] = 'loc_states';
include 'frame.php';
示例10: regenerate_skin_cache
function regenerate_skin_cache($skin_module_code = '', $last_id = 0)
{
$timeout = 120;
require _BASEPATH_ . '/includes/classes/Cache/Lite.php';
$cache = new Cache_Lite($GLOBALS['_cache_config']);
global $dbtable_prefix, $_pfields, $_pcats, $__field2format;
$tpl = new phemplate(_BASEPATH_ . '/skins_site/', 'remove_nonjs');
if (empty($skin_module_code)) {
$query = "SELECT b.`config_value` as `skin_dir` FROM `{$dbtable_prefix}modules` a,`{$dbtable_prefix}site_options3` b WHERE a.`module_type`=" . MODULE_SKIN . " AND a.`module_code`=b.`fk_module_code` AND b.`config_option`='skin_dir'";
} else {
$query = "SELECT `config_value` as `skin_dir` FROM `{$dbtable_prefix}site_options3` WHERE `config_option`='skin_dir' AND `fk_module_code`='{$skin_module_code}'";
}
if (!($res = @mysql_query($query))) {
trigger_error(mysql_error(), E_USER_ERROR);
}
for ($i = 0; $i < mysql_num_rows($res); ++$i) {
$skins[] = mysql_result($res, $i, 0);
}
$now = gmdate('YmdHis');
$select = '`fk_user_id`,`status`,`del`,UNIX_TIMESTAMP(`last_changed`) as `last_changed`,UNIX_TIMESTAMP(`date_added`) as `date_added`,`_user`,`_photo`,`rad_longitude`,`rad_latitude`';
$used_fields = array();
foreach ($_pfields as $field_id => $field) {
if ($field->config['visible']) {
$select .= ',' . $field->query_select();
$used_fields[] = $field_id;
}
}
// create the cache in every skin
for ($s = 0; isset($skins[$s]); ++$s) {
$GLOBALS['_lang'] = array();
$GLOBALS['_pfields'] = array();
$GLOBALS['_pcats'] = array();
include _BASEPATH_ . '/skins_site/' . $skins[$s] . '/lang/global.inc.php';
include _BASEPATH_ . '/includes/fields.inc.php';
$query = "SELECT {$select} FROM `{$dbtable_prefix}user_profiles` WHERE `status`=" . STAT_APPROVED;
if (!empty($last_id)) {
$query .= " AND `fk_user_id`>{$last_id}";
}
$query .= " ORDER BY `fk_user_id`";
if (!($res = @mysql_query($query))) {
trigger_error(mysql_error(), E_USER_ERROR);
}
$start_time = (int) time();
while ($profile = mysql_fetch_assoc($res)) {
for ($i = 0; isset($used_fields[$i]); ++$i) {
$field =& $_pfields[$used_fields[$i]];
$field->set_value($profile, false);
$profile[$field->config['dbfield']] = $field->display();
// the label should be set after the call to display(). See field_birthdate::display() for explanation.
$profile[$field->config['dbfield'] . '_label'] = $field->config['label'];
}
if (empty($profile['_photo']) || !is_file(_PHOTOPATH_ . '/t1/' . $profile['_photo']) || !is_file(_PHOTOPATH_ . '/t2/' . $profile['_photo']) || !is_file(_PHOTOPATH_ . '/' . $profile['_photo'])) {
$profile['_photo'] = 'no_photo.gif';
} else {
$profile['has_photo'] = true;
}
$tpl->set_var('profile', $profile);
// generate the user details for result lists
$tpl->set_file('temp', $skins[$s] . '/static/result_user.html');
$towrite = $tpl->process('', 'temp', TPL_OPTIONAL);
$cache->save($towrite, 'skin' . $skins[$s] . $profile['fk_user_id'] . 'result_user');
// generate the categories to be used on profile.php page
$categs = array();
$tpl->set_file('temp', $skins[$s] . '/static/profile_categ.html');
foreach ($_pcats as $pcat_id => $pcat) {
$fields = array();
$j = 0;
for ($k = 0; isset($pcat['fields'][$k]); ++$k) {
if (in_array($pcat['fields'][$k], $used_fields) && !empty($profile[$_pfields[$pcat['fields'][$k]]->config['dbfield']])) {
$fields[$j]['label'] = $profile[$_pfields[$pcat['fields'][$k]]->config['dbfield'] . '_label'];
$fields[$j]['field'] = $profile[$_pfields[$pcat['fields'][$k]]->config['dbfield']];
$fields[$j]['dbfield'] = $_pfields[$pcat['fields'][$k]]->config['dbfield'];
++$j;
}
}
$categs['pcat_name'] = $pcat['pcat_name'];
$categs['pcat_id'] = $pcat_id;
$tpl->set_loop('fields', $fields);
$tpl->set_var('categs', $categs);
$towrite = $tpl->process('', 'temp', TPL_LOOP);
$cache->save($towrite, 'skin' . $skins[$s] . $profile['fk_user_id'] . 'pcat' . $pcat_id);
$tpl->drop_loop('fields');
$tpl->drop_var('categs');
}
$tpl->drop_var('profile');
if ((int) time() - $start_time > $timeout) {
echo 'To prevent timeouts this script interrupts every few minutes. Press the continue button to resume.<br />';
echo 'Last user ID processed: ', $profile['fk_user_id'], '<br />';
echo '<form action="regenerate_skin.php" method="get">';
echo '<input type="hidden" name="last_id" value="', $profile['fk_user_id'], '" />';
if (!empty($skin_module_code)) {
echo '<input type="hidden" name="s" value="', $skin_module_code, '" />';
}
echo '<input type="submit" value="Continue" />';
echo '</form>';
die;
}
}
}
}
示例11: gmdate
case FIELD_TEXTFIELD:
$rsrow['field'] = '<input class="input_tf" type="text" name="' . $rsrow['fk_module_code'] . '_' . $rsrow['config_option'] . '" id="' . $rsrow['fk_module_code'] . '_' . $rsrow['config_option'] . '" value="' . $rsrow['config_value'] . '" />';
break;
case FIELD_INT:
$rsrow['field'] = '<input class="number" type="text" name="' . $rsrow['fk_module_code'] . '_' . $rsrow['config_option'] . '" id="' . $rsrow['fk_module_code'] . '_' . $rsrow['config_option'] . '" value="' . $rsrow['config_value'] . '" />';
break;
case FIELD_TEXTAREA:
$rsrow['field'] = '<textarea class="input_ta" name="' . $rsrow['fk_module_code'] . '_' . $rsrow['config_option'] . '" id="' . $rsrow['fk_module_code'] . '_' . $rsrow['config_option'] . '" cols="" rows="">' . $rsrow['config_value'] . '</textarea>';
break;
case FIELD_SELECT:
$rsrow['field'] = '<select name="' . $rsrow['fk_module_code'] . '_' . $rsrow['config_option'] . '" id="' . $rsrow['fk_module_code'] . '_' . $rsrow['config_option'] . '">' . vector2options($rsrow['choices'], $rsrow['config_value']) . '</select>';
break;
case FIELD_FILE:
$rsrow['field'] = '<input class="text" type="file" name="' . $rsrow['fk_module_code'] . '_' . $rsrow['config_option'] . '" id="' . $rsrow['fk_module_code'] . '_' . $rsrow['config_option'] . '" /> <a class="remove_upl_file" href="processors/site_options_del_file.php?cid=' . $rsrow['config_id'] . '"><span>Remove</span></a> <p>' . $rsrow['config_value'] . '</p>';
break;
}
if (isset($rsrow['field'])) {
$site_options[$i]['options'][] = $rsrow;
}
}
//print_r($site_options);
$output['gmtime'] = gmdate('F d, Y, h:i:s A');
$tpl->set_file('content', 'site_options.html');
$tpl->set_loop('site_options', $site_options);
$tpl->set_var('module_code', $active_module_code);
$tpl->set_var('output', $output);
$tpl->process('content', 'content', TPL_MULTILOOP);
$tplvars['title'] = 'Site Options';
$tplvars['css'] = 'site_options.css';
$tplvars['page'] = 'site_options';
include 'frame.php';
示例12: gen_user_cache
function gen_user_cache()
{
global $dbtable_prefix, $_pfields, $_pcats;
$dirname = dirname(__FILE__);
$temp = array();
if ($dirname[0] == '/') {
// unixes here
$temp = explode('/', $dirname);
} else {
// windows here
$temp = explode('\\', $dirname);
}
$interval = (int) $temp[count($temp) - 1];
// that's how often we're executed ;)
$tpl = new phemplate(_BASEPATH_ . '/skins_site/', 'remove_nonjs');
$query = "SELECT a.`config_value` FROM `{$dbtable_prefix}site_options3` a,`{$dbtable_prefix}modules` b WHERE a.`config_option`='skin_dir' AND a.`fk_module_code`=b.`module_code` AND b.`module_type`=" . MODULE_SKIN;
if (!($res = @mysql_query($query))) {
trigger_error(mysql_error(), E_USER_ERROR);
}
$skins = array();
for ($i = 0; $i < mysql_num_rows($res); ++$i) {
$skins[] = mysql_result($res, $i, 0);
}
require _BASEPATH_ . '/includes/classes/Cache/Lite.php';
$cache = new Cache_Lite($GLOBALS['_cache_config']);
$now = gmdate('YmdHis');
$select = '`fk_user_id`,`status`,`del`,UNIX_TIMESTAMP(`last_changed`) as `last_changed`,UNIX_TIMESTAMP(`date_added`) as `date_added`,`_user`,`_photo`,`rad_longitude`,`rad_latitude`';
$used_fields = array();
foreach ($_pfields as $field_id => $field) {
if ($field->config['visible']) {
$select .= ',' . $field->query_select();
$used_fields[] = $field_id;
}
}
// create the cache in every skin
for ($s = 0; isset($skins[$s]); ++$s) {
$GLOBALS['_lang'] = array();
$GLOBALS['_pfields'] = array();
$GLOBALS['_pcats'] = array();
include _BASEPATH_ . '/skins_site/' . $skins[$s] . '/lang/global.inc.php';
include _BASEPATH_ . '/includes/fields.inc.php';
$query = "SELECT {$select} FROM `{$dbtable_prefix}user_profiles` WHERE `status`=" . STAT_APPROVED . " AND `last_changed`>=DATE_SUB('{$now}',INTERVAL " . ($interval + 2) . " MINUTE)";
//print $query;
if (!($res = @mysql_query($query))) {
trigger_error(mysql_error(), E_USER_ERROR);
}
while ($profile = mysql_fetch_assoc($res)) {
for ($i = 0; isset($used_fields[$i]); ++$i) {
$field =& $_pfields[$used_fields[$i]];
$field->set_value($profile, false);
$profile[$field->config['dbfield']] = $field->display();
// the label should be set after the call to display(). See field_birthdate::display() for explanation.
$profile[$field->config['dbfield'] . '_label'] = $field->config['label'];
/*
} elseif ($field['field_type']==FIELD_INT || $field['field_type']==FIELD_FLOAT) {
// $profile[$field['dbfield']]=$profile[$field['dbfield']];
*/
}
if (empty($profile['_photo']) || !is_file(_PHOTOPATH_ . '/t1/' . $profile['_photo']) || !is_file(_PHOTOPATH_ . '/t2/' . $profile['_photo']) || !is_file(_PHOTOPATH_ . '/' . $profile['_photo'])) {
$profile['_photo'] = 'no_photo.gif';
} else {
$profile['has_photo'] = true;
}
$tpl->set_var('profile', $profile);
// generate the user details for result lists
$tpl->set_file('temp', $skins[$s] . '/static/result_user.html');
$towrite = $tpl->process('', 'temp', TPL_OPTIONAL);
$cache->save($towrite, 'skin' . $skins[$s] . $profile['fk_user_id'] . 'result_user');
// generate the categories to be used on profile.php page
$categs = array();
$tpl->set_file('temp', $skins[$s] . '/static/profile_categ.html');
foreach ($_pcats as $pcat_id => $pcat) {
$fields = array();
$j = 0;
for ($k = 0; isset($pcat['fields'][$k]); ++$k) {
if (in_array($pcat['fields'][$k], $used_fields) && !empty($profile[$_pfields[$pcat['fields'][$k]]->config['dbfield']])) {
$fields[$j]['label'] = $profile[$_pfields[$pcat['fields'][$k]]->config['dbfield'] . '_label'];
$fields[$j]['field'] = $profile[$_pfields[$pcat['fields'][$k]]->config['dbfield']];
$fields[$j]['dbfield'] = $_pfields[$pcat['fields'][$k]]->config['dbfield'];
++$j;
}
}
$categs['pcat_name'] = $pcat['pcat_name'];
$categs['pcat_id'] = $pcat_id;
$tpl->set_loop('fields', $fields);
$tpl->set_var('categs', $categs);
$towrite = $tpl->process('', 'temp', TPL_LOOP);
$cache->save($towrite, 'skin' . $skins[$s] . $profile['fk_user_id'] . 'pcat' . $pcat_id);
$tpl->drop_loop('fields');
$tpl->drop_var('categs');
}
$tpl->drop_var('profile');
}
}
return true;
}
示例13: join
if ($relevant_install) {
$not_installed[$m]['text'] = $p->install[$j]['text'];
$relevant_install = false;
}
}
if ($install_req_satisfied) {
$not_installed[$m]['valid'] = true;
$not_installed[$m]['reasons'] = 'All satisfied.';
} else {
for ($n = 0; isset($reasons[$n]); ++$n) {
$reasons[$n] = join(', ', $reasons[$n]);
}
$not_installed[$m]['reasons'] = '<strong>' . join('</strong> OR <strong>', $reasons) . '</strong>';
}
$not_installed[$m]['module_name'] = $p->module_name;
$not_installed[$m]['module_type'] = $accepted_module_types[$p->module_type];
$not_installed[$m]['version'] = $p->version;
$not_installed[$m]['filename'] = rawurlencode($filenames[$i]);
++$m;
}
}
$output['bu'] = base64_encode(_BASEURL_);
$tpl->set_file('content', 'packages.html');
$tpl->set_loop('installed', $installed);
$tpl->set_loop('not_installed', $not_installed);
$tpl->set_var('output', $output);
$tpl->process('content', 'content', TPL_LOOP | TPL_OPTIONAL | TPL_OPTLOOP);
$tplvars['title'] = 'Package manager';
$tplvars['page'] = 'packages';
$tplvars['css'] = 'packages.css';
include 'frame.php';
示例14: while
if (!empty($totalrows)) {
if ($o >= $totalrows) {
$o = $totalrows - $r;
$o = $o >= 0 ? $o : 0;
}
$query = "SELECT * FROM {$from} WHERE {$where} ORDER BY `admin_id` 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['name'] = sanitize_and_format($rsrow['name'], TYPE_STRING, $__field2format[TEXT_DB2DISPLAY]);
$rsrow['status'] = $accepted_astats[$rsrow['status']];
$rsrow['dept_id'] = $accepted_admin_depts[$rsrow['dept_id']];
$rsrow['myclass'] = $i % 2 ? 'odd_item' : 'even_item';
$admin_accounts[] = $rsrow;
++$i;
}
$tpl->set_var('pager1', pager($totalrows, $o, $r));
$tpl->set_var('pager2', pager($totalrows, $o, $r));
}
$tpl->set_file('content', 'admin_accounts.html');
$tpl->set_loop('admin_accounts', $admin_accounts);
$tpl->set_var('o', $o);
$tpl->set_var('r', $r);
$tpl->process('content', 'content', TPL_LOOP | TPL_NOLOOP);
$tpl->drop_loop('admin_accounts');
unset($admin_accounts);
$tplvars['title'] = 'Admin Accounts';
$tplvars['page'] = 'admin_accounts';
include 'frame.php';
示例15: unset
if ($i >= 0) {
$site_skins[$i] = sanitize_and_format($site_skins[$i], TYPE_STRING, $__field2format[TEXT_DB2DISPLAY]);
if (!empty($site_skins[$i]['is_default'])) {
$site_skins[$i]['is_default'] = '<img src="skin/images/check.gif" />';
} else {
unset($site_skins[$i]['is_default']);
}
}
++$i;
$site_skins[$i]['module_code'] = $rsrow['module_code'];
$site_skins[$i]['skin_name'] = $rsrow['module_name'] . ' ' . $rsrow['version'];
$last_code = $rsrow['module_code'];
}
$site_skins[$i][$rsrow['config_option']] = $rsrow['config_value'];
}
// one more time for the last row
if ($i >= 0) {
$site_skins[$i] = sanitize_and_format($site_skins[$i], TYPE_STRING, $__field2format[TEXT_DB2DISPLAY]);
if (!empty($site_skins[$i]['is_default'])) {
$site_skins[$i]['is_default'] = '<img src="skin/images/check.gif" />';
} else {
unset($site_skins[$i]['is_default']);
}
}
$tpl->set_file('content', 'site_skins.html');
$tpl->set_loop('site_skins', $site_skins);
$tpl->process('content', 'content', TPL_LOOP | TPL_NOLOOP | TPL_OPTLOOP);
$tpl->drop_loop('site_skins');
$tplvars['title'] = 'Skin Settings';
$tplvars['page'] = 'site_skins';
include 'frame.php';