本文整理汇总了PHP中smarty::fetch方法的典型用法代码示例。如果您正苦于以下问题:PHP smarty::fetch方法的具体用法?PHP smarty::fetch怎么用?PHP smarty::fetch使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类smarty
的用法示例。
在下文中一共展示了smarty::fetch方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: render
public function render()
{
$this->_getContext($this->controller);
$path = get_class($this->controller);
$file = $this->_parseTemplatePath($path);
if (!file_exists(APP_TEMPLATE_PATH . DS . $file)) {
throw new AXION_EXCEPTION('没有找到模板文件');
}
foreach ($this->context as $k => $v) {
$this->templateInstance->assign($k, $v);
}
$_str_resultHTML = $this->templateInstance->fetch($file);
return $_str_resultHTML;
}
示例2: genHtml
/**
* @param $template
* @param $ary
* @return mixed
*/
public static function genHtml($template, $ary)
{
$smarty = new smarty();
$smarty->settemplatedir(BASE_PATH . '/resources/email/');
$smarty->setcompiledir(BASE_PATH . '/storage/framework/smarty/compile/');
$smarty->setcachedir(BASE_PATH . '/storage/framework/smarty/cache/');
// add config
$smarty->assign('config', Config::getPublicConfig());
$smarty->assign('analyticsCode', DbConfig::get('analytics-code'));
foreach ($ary as $key => $value) {
$smarty->assign($key, $value);
}
return $smarty->fetch($template);
}
示例3: strpos
$box_smarty->assign('UST', $_SESSION['cart']->show_tax());
$box_smarty->assign('SHIPPING_INFO', SHOW_SHIPPING == 'true' ? $main->getShippingLink() : '');
}
$box_smarty->assign('deny_cart', strpos($PHP_SELF, 'checkout') !== false ? 'true' : 'false');
// no cart at the checkout
$box_smarty->assign('products', $products_in_cart);
$box_smarty->assign('PRODUCTS', $qty);
$box_smarty->assign('empty', $qty > 0 ? 'false' : 'true');
$box_smarty->assign('ACTIVATE_GIFT', ACTIVATE_GIFT_SYSTEM == 'true' ? 'true' : false);
// GV Code
if (isset($_SESSION['customer_id'])) {
$gv_query = xtc_db_query("-- /templates/" . CURRENT_TEMPLATE . "/source/boxes/shopping_cart.php\n SELECT amount\n FROM " . TABLE_COUPON_GV_CUSTOMER . "\n WHERE customer_id = '" . (int) $_SESSION['customer_id'] . "'");
$gv_result = xtc_db_fetch_array($gv_query);
if ($gv_result['amount'] > 0) {
$box_smarty->assign('GV_AMOUNT', $xtPrice->xtcFormat($gv_result['amount'], true, 0, true));
$box_smarty->assign('GV_SEND_TO_FRIEND_LINK', '<a href="' . xtc_href_link(FILENAME_GV_SEND) . '">');
}
if (isset($_SESSION['gv_id'])) {
$gv_query = xtc_db_query("-- /templates/" . CURRENT_TEMPLATE . "/source/boxes/shopping_cart.php\n SELECT coupon_amount\n FROM " . TABLE_COUPONS . "\n WHERE coupon_id = '" . (int) $_SESSION['gv_id'] . "'");
$coupon = xtc_db_fetch_array($gv_query);
$box_smarty->assign('COUPON_AMOUNT2', $xtPrice->xtcFormat($coupon['coupon_amount'], true, 0, true));
}
if (isset($_SESSION['cc_id'])) {
$box_smarty->assign('COUPON_HELP_LINK', '<a target="_blank" class="thickbox" title="Information" href="' . xtc_href_link(FILENAME_POPUP_COUPON_HELP, 'cID=' . $_SESSION['cc_id'] . '&KeepThis=true&TB_iframe=true&height=400&width=600', $request_type) . '">Information</a>');
}
}
$box_smarty->assign('LINK_CART', xtc_href_link(FILENAME_SHOPPING_CART, '', 'NONSSL'));
$box_smarty->caching = 0;
$box_smarty->assign('language', $_SESSION['language']);
$box_shopping_cart = $box_smarty->fetch(CURRENT_TEMPLATE . '/boxes/box_cart.html');
$smarty->assign('box_CART', $box_shopping_cart);
示例4: language
if (!isset($lng) || !is_object($lng)) {
//EOF - 2010-02-28 - Fix Undefined variable: lng
include DIR_WS_CLASSES . 'language.php';
$lng = new language();
}
$languages_string = '';
$count_lng = '';
reset($lng->catalog_languages);
while (list($key, $value) = each($lng->catalog_languages)) {
$count_lng++;
//BOF - Dokuman - 2010-01-29 - code optimization
//$languages_string .= ' <a href="' . xtc_href_link(basename($PHP_SELF), 'language=' . $key.'&'.xtc_get_all_get_params(array('language', 'currency')), $request_type) . '">' . xtc_image('lang/' . $value['directory'] .'/' . $value['image'], $value['name']) . '</a> ';
if (SEARCH_ENGINE_FRIENDLY_URLS == 'true') {
$languages_string .= ' <a href="' . xtc_href_link(basename($PHP_SELF), 'language=' . $key . '&' . xtc_get_all_get_params(array('language', 'currency')), $request_type) . '">' . xtc_image('lang/' . $value['directory'] . '/' . $value['image'], $value['name']) . '</a> ';
} else {
$languages_string .= ' <a href="' . xtc_href_link(basename($PHP_SELF), 'language=' . $key . '&' . xtc_get_all_get_params(array('language', 'currency')), $request_type) . '">' . xtc_image('lang/' . $value['directory'] . '/' . $value['image'], $value['name']) . '</a> ';
}
//EOF - Dokuman - 2010-01-29 - code optimization
}
// dont show box if there's only 1 language
if ($count_lng > 1) {
$box_smarty = new smarty();
$box_smarty->assign('tpl_path', 'templates/' . CURRENT_TEMPLATE . '/');
$box_content = '';
$box_smarty->assign('BOX_CONTENT', $languages_string);
$box_smarty->assign('language', $_SESSION['language']);
// set cache ID
$box_smarty->caching = 0;
$box_languages = $box_smarty->fetch(CURRENT_TEMPLATE . '/boxes/box_languages.html');
$smarty->assign('box_LANGUAGES', $box_languages);
}
示例5:
break;
}
}
}
//BOF - DokuMan - 2011-01-21 - Fix a notice when there is no category
//xtc_show_category($first_element);
if (!empty($first_element)) {
xtc_show_category($first_element);
}
//BOF - DokuMan - 2011-01-21 - Fix a notice when there is no category
$box_smarty->assign('BOX_CONTENT', $categories_string);
//DokuMan - 2010-03-02 - BOX_CONTENT on wrong position
}
// set cache ID
//BOF - DokuMan - 2010-02-28 - fix Smarty cache error on unlink
/*
if (!$cache || $rebuild) {
$box_smarty->assign('BOX_CONTENT', $categories_string);
if ($rebuild) $box_smarty->clear_cache(CURRENT_TEMPLATE.'/boxes/box_categories.html', $cache_id);
$box_categories = $box_smarty->fetch(CURRENT_TEMPLATE.'/boxes/box_categories.html',$cache_id);
} else {
$box_categories = $box_smarty->fetch(CURRENT_TEMPLATE.'/boxes/box_categories.html', $cache_id);
}
*/
if (!$cache) {
$box_categories = $box_smarty->fetch(CURRENT_TEMPLATE . '/boxes/box_categories.html');
} else {
$box_categories = $box_smarty->fetch(CURRENT_TEMPLATE . '/boxes/box_categories.html', $cache_id);
}
//EOF - DokuMan - 2010-02-28 - fix Smarty cache error on unlink
$smarty->assign('box_CATEGORIES', $box_categories);
示例6: Copyright
http://www.xt-commerce.com
Copyright (c) 2003 XT-Commerce
-----------------------------------------------------------------------------------------
based on:
(c) 2000-2001 The Exchange Project (earlier name of osCommerce)
(c) 2002-2003 osCommerce(add_a_quickie.php,v 1.10 2001/12/19); www.oscommerce.com
Released under the GNU General Public License
-----------------------------------------------------------------------------------------
Third Party contribution:
Add A Quickie v1.0 Autor Harald Ponce de Leon
Released under the GNU General Public License
---------------------------------------------------------------------------------------*/
// reset var
$box_smarty = new smarty();
$box_content = '';
$box_smarty->assign('tpl_path', 'templates/' . CURRENT_TEMPLATE . '/');
// BOF - GTB - 2010-09-20 - correct the Formular in dependences of the request type SSL / NONSSL
$box_smarty->assign('FORM_ACTION', '<form id="quick_add" method="post" action="' . xtc_href_link(basename($PHP_SELF), xtc_get_all_get_params(array('action')) . 'action=add_a_quickie', $request_type) . '">');
//$box_smarty->assign('FORM_ACTION','<form id="quick_add" method="post" action="' . xtc_href_link(basename($PHP_SELF), xtc_get_all_get_params(array ('action')) . 'action=add_a_quickie', 'NONSSL') . '">');
// EOF - GTB - 2010-09-20 - correct the Formular in dependences of the request type SSL / NONSSL
$box_smarty->assign('INPUT_FIELD', xtc_draw_input_field('quickie', '', 'style="width:170px"'));
$box_smarty->assign('SUBMIT_BUTTON', xtc_image_submit('button_add_quick.gif', BOX_HEADING_ADD_PRODUCT_ID));
$box_smarty->assign('FORM_END', '</form>');
$box_smarty->assign('BOX_CONTENT', $box_content);
$box_smarty->assign('language', $_SESSION['language']);
$box_smarty->caching = 0;
$box_add_a_quickie = $box_smarty->fetch(CURRENT_TEMPLATE . '/boxes/box_add_a_quickie.html');
$smarty->assign('box_ADD_QUICKIE', $box_add_a_quickie);
示例7: smarty
function prepare_wsdl_data($savefile = false)
{
$smarty = new smarty();
$smarty->compile_dir = find_best_location_in_include_path("templates_c");
$smarty->assign('WS_SERVICE_NAMESPACE', SW_SOAP_NAMESPACE);
$smarty->assign('WS_SERVICE_CODE', SW_SOAP_SERVICECODE);
$smarty->assign('WS_SERVICE_NAME', SW_SOAP_SERVICENAME);
$smarty->assign('WS_SERVICE_URL', SW_SOAP_SERVICEURL);
$smarty->debugging = true;
$cols = array();
$cols[] = array("name" => "ReportName", "type" => "char", "length" => 0);
foreach ($this->query->columns as $col) {
$cols[] = array("name" => $col->query_name, "type" => $col->column_type, "length" => $col->column_length);
}
$smarty->assign("COLUMN_ITEMS", $cols);
$crits = array();
foreach ($this->query->lookup_queries as $lq) {
$crits[] = array("name" => $lq->query_name);
}
$smarty->assign("CRITERIA_ITEMS", $crits);
header('Content-Type: text/xml');
if ($savefile) {
$data = $smarty->fetch('wsdl.tpl', null, null, false);
$this->write_report_file($savefile, $data);
} else {
$smarty->display('wsdl.tpl');
}
}
示例8: Copyright
osCommerce, Open Source E-Commerce Solutions
http://www.oscommerce.com
Copyright (c) 2002 - 2003 osCommerce
Released under the GNU General Public License
---------------------------------------------------------------------------*/
$box_smarty = new smarty();
$box_content = '';
$box_smarty->assign('tpl_path', DIR_WS_CATALOG . 'templates/' . CURRENT_TEMPLATE . '/');
if (isset($_SESSION['affiliate_id'])) {
$box_content .= '<a href="' . xtc_href_link(FILENAME_AFFILIATE_SUMMARY, '', 'SSL') . '">' . BOX_AFFILIATE_SUMMARY . '</a><br>';
$box_content .= '<a href="' . xtc_href_link(FILENAME_AFFILIATE_ACCOUNT, '', 'SSL') . '">' . BOX_AFFILIATE_ACCOUNT . '</a><br>';
$box_content .= '<a href="' . xtc_href_link(FILENAME_AFFILIATE_PAYMENT, '', 'SSL') . '">' . BOX_AFFILIATE_PAYMENT . '</a><br>';
$box_content .= '<a href="' . xtc_href_link(FILENAME_AFFILIATE_CLICKS, '', 'SSL') . '">' . BOX_AFFILIATE_CLICKRATE . '</a><br>';
$box_content .= '<a href="' . xtc_href_link(FILENAME_AFFILIATE_SALES, '', 'SSL') . '">' . BOX_AFFILIATE_SALES . '</a><br>';
$box_content .= '<a href="' . xtc_href_link(FILENAME_AFFILIATE_BANNERS) . '">' . BOX_AFFILIATE_BANNERS . '</a><br>';
$box_content .= '<a href="' . xtc_href_link(FILENAME_AFFILIATE_CONTACT) . '">' . BOX_AFFILIATE_CONTACT . '</a><br>';
$box_content .= '<a href="' . xtc_href_link(FILENAME_CONTENT, 'coID=902') . '">' . BOX_AFFILIATE_FAQ . '</a><br>';
$box_content .= '<a href="' . xtc_href_link(FILENAME_AFFILIATE_LOGOUT) . '">' . BOX_AFFILIATE_LOGOUT . '</a>';
} else {
$box_content .= '<a href="' . xtc_href_link(FILENAME_CONTENT, 'coID=901') . '">' . BOX_AFFILIATE_INFO . '</a><br>';
$box_content .= '<a href="' . xtc_href_link(FILENAME_AFFILIATE, '', 'SSL') . '">' . BOX_AFFILIATE_LOGIN . '</a>';
}
//$box_smarty->assign('BOX_TITLE', BOX_HEADING_ADD_PRODUCT_ID);
$box_smarty->assign('BOX_CONTENT', $box_content);
$box_smarty->assign('language', $_SESSION['language']);
// set cache ID
$box_smarty->caching = 0;
$box_affiliate = $box_smarty->fetch(CURRENT_TEMPLATE . '/boxes/box_affiliate.html');
$smarty->assign('box_AFFILIATE', $box_affiliate);
示例9: substr
//web28 - 2010-06-23 change unnecessary SSL to NONSSL
}
$orders_contents = substr($orders_contents, 0, -6);
$customers_query = xtc_db_query("select count(*) as count from " . TABLE_CUSTOMERS);
$customers = xtc_db_fetch_array($customers_query);
$products_query = xtc_db_query("select count(*) as count from " . TABLE_PRODUCTS . " where products_status = '1'");
$products = xtc_db_fetch_array($products_query);
$reviews_query = xtc_db_query("select count(*) as count from " . TABLE_REVIEWS);
$reviews = xtc_db_fetch_array($reviews_query);
$admin_image = '<a href="' . xtc_href_link_admin(FILENAME_START, '', 'NONSSL') . '">' . xtc_image_button('button_admin.gif', IMAGE_BUTTON_ADMIN) . '</a>';
//web28 - 2010-06-23 change unnecessary SSL to NONSSL
if ($product->isProduct()) {
$admin_link = '<a href="' . xtc_href_link_admin(FILENAME_EDIT_PRODUCTS, 'cPath=' . $cPath . '&pID=' . $product->data['products_id']) . '&action=new_product' . '" onclick="window.open(this.href); return false;">' . xtc_image_button('edit_product.gif', IMAGE_BUTTON_PRODUCT_EDIT) . '</a>';
} else {
$admin_link = '';
//DokuMan - 2010-03-23 - set undefinded variable
}
$box_content = '<strong>' . BOX_TITLE_STATISTICS . '</strong><br />' . $orders_contents . '<br />' . BOX_ENTRY_CUSTOMERS . ' ' . $customers['count'] . '<br />' . BOX_ENTRY_PRODUCTS . ' ' . $products['count'] . '<br />' . BOX_ENTRY_REVIEWS . ' ' . $reviews['count'] . '<br />' . $admin_image . '<br />' . $admin_link;
$box_content = '';
$box_content .= '<li><a href="' . xtc_href_link_admin(FILENAME_START, '', 'NONSSL') . '">' . IMAGE_BUTTON_ADMIN . '</a></li>';
if ($product->isProduct()) {
$box_content .= '<li><a href="' . xtc_href_link_admin(FILENAME_EDIT_PRODUCTS, 'cPath=' . $cPath . '&pID=' . $product->data['products_id']) . '&action=new_product' . '" onclick="window.open(this.href); return false;">' . IMAGE_BUTTON_PRODUCT_EDIT . '</a></li>';
}
if ($flag == true) {
define('SEARCH_ENGINE_FRIENDLY_URLS', true);
}
$box_smarty->assign('BOX_CONTENT', $box_content);
$box_smarty->caching = 0;
$box_smarty->assign('language', $_SESSION['language']);
$box_admin = $box_smarty->fetch(CURRENT_TEMPLATE . '/boxes/box_admin.html');
$smarty->assign('box_ADMIN', $box_admin);
示例10: xtDBquery
// get category name
$categories_query = xtDBquery("select
cd.categories_name
from ".TABLE_CATEGORIES_DESCRIPTION." cd,
".TABLE_CATEGORIES." c,
" . TABLE_PRODUCTS_TO_CATEGORIES . " p2c
WHERE c.categories_id=cd.categories_id
and p2c.products_id = '".(int) $_SESSION['tracking']['products_history'][$random_last_viewed]."'
and cd.language_id='".(int) $_SESSION['languages_id']."'");
$categories_data = xtc_db_fetch_array($categories_query,true);
*/
//EOF - Dokuman - 2010-01-29 - category name selection included in one select statement
$random_products_price = $xtPrice->xtcGetPrice($random_product['products_id'], $format = true, 1, $random_product['products_tax_class_id'], $random_product['products_price']);
$category_path = xtc_get_path($random_product['categories_id']);
if ($random_product['products_name'] != '') {
$box_smarty->assign('box_content', $product->buildDataArray($random_product));
$box_smarty->assign('MY_PAGE', 'TEXT_MY_PAGE');
$box_smarty->assign('WATCH_CATGORY', 'TEXT_WATCH_CATEGORY');
$box_smarty->assign('MY_PERSONAL_PAGE', xtc_href_link(FILENAME_ACCOUNT));
//BOF - Dokuman - 2010-01-29 - category name selection included in one select statement
//$box_smarty->assign('CATEGORY_LINK', xtc_href_link(FILENAME_DEFAULT, xtc_category_link($categories_data['categories_id'], $categories_data['categories_name'])));
//$box_smarty->assign('CATEGORY_NAME', $categories_data['categories_name']);
$box_smarty->assign('CATEGORY_LINK', xtc_href_link(FILENAME_DEFAULT, xtc_category_link($random_product['categories_id'], $random_product['categories_name'])));
$box_smarty->assign('CATEGORY_NAME', $random_product['categories_name']);
//BOF - Dokuman - 2010-01-29 - category name selection included in one select statement
$box_smarty->assign('language', $_SESSION['language']);
$box_smarty->caching = 0;
$box_last_viewed = $box_smarty->fetch(CURRENT_TEMPLATE . '/boxes/box_last_viewed.html');
$smarty->assign('box_LAST_VIEWED', $box_last_viewed);
}
}
示例11: reset
// include functions
require_once DIR_FS_INC . 'xtc_hide_session_id.inc.php';
if (isset($xtPrice) && is_object($xtPrice)) {
$count_cur = '';
reset($xtPrice->currencies);
$currencies_array = array();
while (list($key, $value) = each($xtPrice->currencies)) {
$count_cur++;
$currencies_array[] = array('id' => $key, 'text' => $value['title']);
}
$hidden_get_variables = '';
reset($_GET);
while (list($key, $value) = each($_GET)) {
if ($key != 'currency' && $key != xtc_session_name() && $key != 'x' && $key != 'y') {
$hidden_get_variables .= xtc_draw_hidden_field($key, $value);
}
}
}
// dont show box if there's only 1 currency
if ($count_cur > 1) {
// reset var
$box_smarty = new smarty();
$box_smarty->assign('tpl_path', 'templates/' . CURRENT_TEMPLATE . '/');
$box_content = '';
$box_content = xtc_draw_form('currencies', xtc_href_link(basename($PHP_SELF), '', $request_type, false), 'get') . xtc_draw_pull_down_menu('currency', $currencies_array, $_SESSION['currency'], 'onChange="this.form.submit();" style="width: 100%"') . $hidden_get_variables . xtc_hide_session_id() . '</form>';
$box_smarty->assign('BOX_CONTENT', $box_content);
$box_smarty->assign('language', $_SESSION['language']);
$box_smarty->caching = 0;
$box_currencies = $box_smarty->fetch(CURRENT_TEMPLATE . '/boxes/box_currencies.html');
$smarty->assign('box_CURRENCIES', $box_currencies);
}
示例12: smarty
-----------------------------------------------------------------------------------------
Released under the GNU General Public License
---------------------------------------------------------------------------------------*/
$box_smarty = new smarty();
$box_content = '';
$box_smarty->assign('language', $_SESSION['language']);
// set cache ID
if (!CacheCheck()) {
$cache = false;
$box_smarty->caching = 0;
} else {
$cache = true;
$box_smarty->caching = 1;
$box_smarty->cache_lifetime = CACHE_LIFETIME;
$box_smarty->cache_modified_check = CACHE_CHECK;
$cache_id = $_SESSION['language'] . (isset($_GET['manufacturers_id']) ? (int) $_GET['manufacturers_id'] : 0);
}
if (!$box_smarty->is_cached(CURRENT_TEMPLATE . '/boxes/box_content_templatebox1.html', $cache_id) || !$cache) {
$box_smarty->assign('tpl_path', 'templates/' . CURRENT_TEMPLATE . '/');
$content_manager_qry = xtDBquery("SELECT content_title, content_heading, content_text FROM " . TABLE_CONTENT_MANAGER . " WHERE content_group = '12' AND languages_id = '" . $_SESSION["languages_id"] . "'");
$content_manager_ary = xtc_db_fetch_array($content_manager_qry);
$box_smarty->assign('BOX_TITLE', !empty($content_manager_ary["content_heading"]) ? $content_manager_ary["content_heading"] : $content_manager_ary["content_title"]);
$box_smarty->assign('BOX_CONTENT', $content_manager_ary["content_text"]);
}
// set cache ID
if (!$cache) {
$box_content_templatebox1 = $box_smarty->fetch(CURRENT_TEMPLATE . '/boxes/box_content_templatebox1.html');
} else {
$box_content_templatebox1 = $box_smarty->fetch(CURRENT_TEMPLATE . '/boxes/box_content_templatebox1.html', $cache_id);
}
$smarty->assign('box_CONTENT_TEMPLATEBOX1', $box_content_templatebox1);
示例13:
$box_smarty->assign('tpl_path', 'templates/' . CURRENT_TEMPLATE . '/');
$box_content = '';
// include needed functions
require_once DIR_FS_INC . 'xtc_random_select.inc.php';
//fsk18 lock
$fsk_lock = '';
if ($_SESSION['customers_status']['customers_fsk18_display'] == '0') {
$fsk_lock = ' and p.products_fsk18!=1';
}
if (GROUP_CHECK == 'true') {
$group_check = " and p.group_permission_" . $_SESSION['customers_status']['customers_status_id'] . "=1 ";
}
if ($random_product = xtc_random_select("select\n p.products_id,\n pd.products_name,\n p.products_price,\n p.products_tax_class_id,\n p.products_image,\n s.expires_date,\n p.products_vpe,\n\t\t\t\t p.products_vpe_status,\n\t\t\t\t p.products_vpe_value,\n s.specials_new_products_price\n from " . TABLE_PRODUCTS . " p,\n " . TABLE_PRODUCTS_DESCRIPTION . " pd,\n " . TABLE_SPECIALS . " s where p.products_status = '1'\n and p.products_id = s.products_id\n and pd.products_id = s.products_id\n and pd.language_id = '" . $_SESSION['languages_id'] . "'\n and s.status = '1'\n " . $group_check . "\n " . $fsk_lock . " \n order by s.specials_date_added\n desc limit " . MAX_RANDOM_SELECT_SPECIALS)) {
$box_smarty->assign('box_content', $product->buildDataArray($random_product));
$box_smarty->assign('SPECIALS_LINK', xtc_href_link(FILENAME_SPECIALS));
$box_smarty->assign('language', $_SESSION['language']);
if ($random_product["products_id"] != '') {
// set cache ID
if (!CacheCheck()) {
$box_smarty->caching = 0;
$box_specials = $box_smarty->fetch(CURRENT_TEMPLATE . '/boxes/box_specials.html');
} else {
$box_smarty->caching = 1;
$box_smarty->cache_lifetime = CACHE_LIFETIME;
$box_smarty->cache_modified_check = CACHE_CHECK;
$cache_id = $_SESSION['language'] . $random_product["products_id"] . $_SESSION['customers_status']['customers_status_name'];
$box_specials = $box_smarty->fetch(CURRENT_TEMPLATE . '/boxes/box_specials.html', $cache_id);
}
$smarty->assign('box_SPECIALS', $box_specials);
}
}
示例14: sprintf
$review = xtc_db_fetch_array($review_query, true);
$review = encode_htmlspecialchars($review['reviews_text']);
$review = xtc_break_string($review, 15, '-<br />');
//BOF - Dokuman - 2010-01-29 - show review stars in box
//$box_content = '<div align="center" class="bewert"><a href="' . xtc_href_link(FILENAME_PRODUCT_REVIEWS_INFO, 'products_id=' . $random_product['products_id'] . '&reviews_id=' . $random_product['reviews_id']) . '">' . xtc_image(DIR_WS_THUMBNAIL_IMAGES . $random_product['products_image'], $random_product['products_name']) . '</a></div><a href="' . xtc_href_link(FILENAME_PRODUCT_REVIEWS_INFO, 'products_id=' . $random_product['products_id'] . '&reviews_id=' . $random_product['reviews_id']) . '">' . $review . ' ..</a><br />';
$box_content = '<div align="center" class="bewert"><a href="' . xtc_href_link(FILENAME_PRODUCT_REVIEWS_INFO, 'products_id=' . $random_product['products_id'] . '&reviews_id=' . $random_product['reviews_id']) . '">' . xtc_image(DIR_WS_THUMBNAIL_IMAGES . $random_product['products_image'], $random_product['products_name']) . '</a></div><a href="' . xtc_href_link(FILENAME_PRODUCT_REVIEWS_INFO, 'products_id=' . $random_product['products_id'] . '&reviews_id=' . $random_product['reviews_id']) . '">' . $review . ' ..</a><br /><div align="center">' . xtc_image('templates/' . CURRENT_TEMPLATE . '/img/stars_' . $random_product['reviews_rating'] . '.gif', sprintf(BOX_REVIEWS_TEXT_OF_5_STARS, $random_product['reviews_rating'])) . '</div>';
//EOF - Dokuman - 2010-01-29 - show review stars in box
} elseif ($product->isProduct()) {
// Verhindern das Gäste oder Spamer bewerten können. www.aranowa.de
if (isset($_SESSION['customer_id'])) {
// display 'write a review' box
$box_content = '<table border="0" cellspacing="0" cellpadding="2"><tr><td align="left" class="infoBoxContents"><a href="' . xtc_href_link(FILENAME_PRODUCT_REVIEWS_WRITE, xtc_product_link($product->data['products_id'], $product->data['products_name'])) . '">' . BOX_REVIEWS_WRITE_REVIEW . '</a></td></tr></table>';
}
}
if ($box_content != '') {
$box_smarty->assign('REVIEWS_LINK', xtc_href_link(FILENAME_REVIEWS));
$box_smarty->assign('BOX_CONTENT', $box_content);
$box_smarty->assign('language', $_SESSION['language']);
// set cache ID
if (!CacheCheck()) {
$box_smarty->caching = 0;
$box_reviews = $box_smarty->fetch(CURRENT_TEMPLATE . '/boxes/box_reviews.html');
} else {
$box_smarty->caching = 1;
$box_smarty->cache_lifetime = CACHE_LIFETIME;
$box_smarty->cache_modified_check = CACHE_CHECK;
$cache_id = $_SESSION['language'] . $random_product['reviews_id'] . $product->data['products_id'] . $_SESSION['language'];
$box_reviews = $box_smarty->fetch(CURRENT_TEMPLATE . '/boxes/box_reviews.html', $cache_id);
}
$smarty->assign('box_REVIEWS', $box_reviews);
}
示例15: xtDBquery
if (!$box_smarty->is_cached(CURRENT_TEMPLATE . '/boxes/box_content.html', $cache_id) || !$cache) {
$box_smarty->assign('tpl_path', 'templates/' . CURRENT_TEMPLATE . '/');
//$rebuild = true; //DokuMan - 2010-02-28 - fix Smarty cache error on unlink
if (GROUP_CHECK == 'true') {
$group_check = "and group_ids LIKE '%c_" . $_SESSION['customers_status']['customers_status_id'] . "_group%'";
}
$content_query = "SELECT\n\t \t\t\t\t\tcontent_id,\n\t \t\t\t\t\tcategories_id,\n\t \t\t\t\t\tparent_id,\n\t \t\t\t\t\tcontent_title,\n\t \t\t\t\t\tcontent_group\n\t \t\t\t\t\tFROM " . TABLE_CONTENT_MANAGER . "\n\t \t\t\t\t\tWHERE languages_id='" . (int) $_SESSION['languages_id'] . "'\n\t \t\t\t\t\tand file_flag=1 " . $group_check . " and content_status=1 order by sort_order";
$content_query = xtDBquery($content_query);
$content_string = '<ul class="list-unstyled">';
while ($content_data = xtc_db_fetch_array($content_query, true)) {
$SEF_parameter = '';
if (SEARCH_ENGINE_FRIENDLY_URLS == 'true') {
$SEF_parameter = '&content=' . xtc_cleanName($content_data['content_title']);
}
$content_string .= '<li><a href="' . xtc_href_link(FILENAME_CONTENT, 'coID=' . $content_data['content_group'] . $SEF_parameter) . '">' . $content_data['content_title'] . '</a></li>';
}
if ($content_string != '') {
$content_string .= '</ul>';
$box_smarty->assign('BOX_CONTENT', $content_string);
}
}
//BOF - DokuMan - 2010-02-28 - fix Smarty cache error on unlink
//if ($rebuild) $box_smarty->clear_cache(CURRENT_TEMPLATE.'/boxes/box_content.html', $cache_id);
//$box_content = $box_smarty->fetch(CURRENT_TEMPLATE.'/boxes/box_content.html',$cache_id);
if (!$cache) {
$box_content = $box_smarty->fetch(CURRENT_TEMPLATE . '/boxes/box_content.html');
} else {
$box_content = $box_smarty->fetch(CURRENT_TEMPLATE . '/boxes/box_content.html', $cache_id);
}
//EOF - DokuMan - 2010-02-28 - fix Smarty cache error on unlink
$smarty->assign('box_CONTENT', $box_content);