本文整理汇总了PHP中tep_db_free_result函数 的典型用法代码示例。如果您正苦于以下问题:PHP tep_db_free_result函数的具体用法?PHP tep_db_free_result怎么用?PHP tep_db_free_result使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了tep_db_free_result函数 的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: process
public function process()
{
$this->get_value = $this->parsePath($_GET['articles_id']);
$this->original_get = (int) $_GET['articles_id'];
$this->cache_name = $this->setCacheString(__FILE__, 'article_info', $this->original_get);
if (false !== $this->retrieve($this->cache_name)) {
KissMT::init()->setCanonical($this->checkCanonical('articles_id'));
return;
}
$query_replacements = array(':articles_id' => (int) $this->get_value, ':languages_id' => (int) KissMT::init()->retrieve('languages_id'));
$query = str_replace(array_keys($query_replacements), array_values($query_replacements), $this->article_query);
$result = KissMT::init()->query($query);
$article_details = tep_db_fetch_array($result);
tep_db_free_result($result);
$name = trim($article_details['name']);
$description = trim($article_details['description']);
$breadcrumb = array_flip(KissMT::init()->retrieve('breadcrumb'));
if (array_key_exists($name, $breadcrumb)) {
unset($breadcrumb[$name]);
}
$breadcrumb = array_flip($breadcrumb);
$leading_values = $name . (!empty($breadcrumb) ? '[-separator-]' . implode('[-separator-]', $breadcrumb) : '');
KissMT::init()->setCanonical($this->checkCanonical('articles_id'));
$this->parse(KissMT::init()->entities($leading_values, $decode = true), KissMT::init()->entities($description, $decode = true));
}
开发者ID:tapwag, 项目名称:oscommerce_deutsch, 代码行数:25, 代码来源:article_info.php
示例2: process
public function process()
{
$this->get_value = '';
$this->original_get = '';
$this->cache_name = $this->setCacheString(__FILE__, 'listing', 'general');
if (false !== $this->retrieve($this->cache_name)) {
KissMT::init()->setCanonical($this->checkCanonical());
return;
}
$query_replacements = array(':languages_id' => (int) KissMT::init()->retrieve('languages_id'));
$query = str_replace(array_keys($query_replacements), array_values($query_replacements), $this->reviews_query);
$result = KissMT::init()->query($query);
$list_array = array();
while ($reviews_products_results = tep_db_fetch_array($result)) {
if (tep_not_null($reviews_products_results['products_name'])) {
$list_array[] = trim($reviews_products_results['products_name']);
}
}
$list_string = implode('[-separator-]', $this->removeArrayDuplicates($list_array));
tep_db_free_result($result);
$list_string = tep_not_null($list_string) ? $list_string : false;
$leading_values = implode('[-separator-]', KissMT::init()->retrieve('breadcrumb'));
KissMT::init()->setCanonical($this->checkCanonical());
$this->parse(KissMT::init()->entities(sprintf(KISSMT_REVIEWS_TEXT, $leading_values), $decode = true), KissMT::init()->entities($list_string, $decode = true));
}
开发者ID:tapwag, 项目名称:oscommerce_deutsch, 代码行数:25, 代码来源:reviews.php
示例3: retrieve
public function retrieve()
{
if (SEO_URLS_ENABLED != 'false') {
$query = str_replace(':cache_name', $this->cachename, $this->extract_query);
$result = usu::query($query);
$row = tep_db_fetch_array($result);
tep_db_free_result($result);
if (!empty($row)) {
$cache_seconds = usu::$cachedays * 24 * 60 * 60;
if (time() > strtotime($row['cache_date']) + $cache_seconds) {
$this->gc();
} else {
usu::$cachefile_size = number_format(strlen($row['cache_data']) / 1024, 2) . ' kb';
usu::$performance['time'] = microtime(true);
$this->md5check = md5($row['cache_data']);
$rawdata = gzinflate(base64_decode($row['cache_data']));
usu::$registry = unserialize($rawdata);
usu::$performance['time'] = round(microtime(true) - usu::$performance['time'], 4);
$this->retrieved = true;
return true;
}
}
}
usu::$registry = Usu_Registry::getInstance();
}
开发者ID:digideskio, 项目名称:oscmax2, 代码行数:25, 代码来源:Usu_Cache_Database.php
示例4: acquire
protected function acquire($dependency, $fullpath)
{
$this->products_id = (int) $dependency;
// Bypass the query if already in the registry
if (false !== isset(usu::$registry->{$this->dependency}[$this->products_id])) {
usu::$performance['queries_saved']++;
return true;
}
$placeholders = array(':pid', ':languages_id');
// $values are already type cast
$values = array($this->products_id, usu::$languages_id);
$this->query = str_replace($placeholders, $values, $this->base_query);
$result = usu::query($this->query);
$this->query = null;
$row = tep_db_fetch_array($result);
tep_db_free_result($result);
if (false === $row) {
return false;
}
$this->link_text = $this->linkText($row['products_name']);
if (false === isset(usu::$registry->{$this->dependency})) {
usu::$registry->{$this->dependency} = array();
}
usu::$registry->attach($this->dependency, $this->products_id, $this->getProperties());
}
开发者ID:digideskio, 项目名称:oscmax2, 代码行数:25, 代码来源:Usu_Products.php
示例5: process
public function process()
{
$this->cache_name = false;
if (array_key_exists('tPath', $_GET)) {
$this->get_value = $this->parsePath($_GET['tPath']);
$this->original_get = is_numeric(str_replace('_', '', $_GET['tPath'])) ? $_GET['tPath'] : '1';
$this->cache_name = $this->setCacheString(__FILE__, 'articles_topic', $this->original_get);
$get_key = 'tPath';
$query = $this->topics_query;
} elseif (array_key_exists('authors_id', $_GET)) {
$this->get_value = $this->parsePath($_GET['authors_id']);
$this->original_get = (int) $_GET['authors_id'];
$this->cache_name = $this->setCacheString(__FILE__, 'articles_author', $this->original_get);
$get_key = 'authors_id';
$query = $this->authors_query;
} else {
$this->get_value = false;
$this->original_get = false;
$this->cache_name = $this->setCacheString(__FILE__, 'articles_all', 'general');
$get_key = false;
$query = $this->all_topics_query;
}
if (false !== ($this->cache_name && $this->retrieve($this->cache_name))) {
KissMT::init()->setCanonical($this->checkCanonical($get_key));
return;
}
if (false === $this->get_value) {
$query_replacements = array(':languages_id' => (int) KissMT::init()->retrieve('languages_id'));
$query = str_replace(array_keys($query_replacements), array_values($query_replacements), $query);
$result = KissMT::init()->query($query);
$description = '';
while ($row = tep_db_fetch_array($result)) {
if (tep_not_null($row['name'])) {
$description .= trim($row['name']) . '[-separator-]';
}
}
$description = tep_not_null($description) ? $description : false;
$name = defined('HEADING_TITLE') ? HEADING_TITLE : ucfirst(str_replace('_', ' ', substr(KissMT::init()->retrieve('basename'), 0, strlen(KissMT::init()->retrieve('basename')) - 4)));
} else {
$query_replacements = array(':' . $get_key => $this->get_value, ':languages_id' => (int) KissMT::init()->retrieve('languages_id'));
$query = str_replace(array_keys($query_replacements), array_values($query_replacements), $query);
$result = KissMT::init()->query($query);
$detail = tep_db_fetch_array($result);
$name = trim($detail['name']);
$description = tep_not_null($detail['description']) ? trim($detail['description']) : false;
}
tep_db_free_result($result);
$breadcrumb = array_flip(KissMT::init()->retrieve('breadcrumb'));
if (array_key_exists($name, $breadcrumb)) {
unset($breadcrumb[$name]);
}
if (array_key_exists($description, $breadcrumb)) {
unset($breadcrumb[$description]);
}
$breadcrumb = array_flip($breadcrumb);
$leading_values = $name . (!empty($breadcrumb) ? '[-separator-]' . implode('[-separator-]', $breadcrumb) : '');
KissMT::init()->setCanonical($this->checkCanonical($get_key));
$this->parse(KissMT::init()->entities($leading_values, $decode = true), KissMT::init()->entities($description, $decode = true));
}
开发者ID:tapwag, 项目名称:oscommerce_deutsch, 代码行数:59, 代码来源:articles.php
示例6: process
public function process()
{
$this->get_value = $this->parsePath($_GET['products_id']);
$this->original_get = (int) $_GET['products_id'];
$this->cache_name = $this->setCacheString(__FILE__, 'reviews_id', $this->original_get);
if (false !== $this->retrieve($this->cache_name)) {
$reviews_string = isset($_GET['reviews_id']) && is_numeric($_GET['reviews_id']) ? '&reviews_id=' . $_GET['reviews_id'] : '';
KissMT::init()->setCanonical($this->checkCanonical('products_id', $reviews_string));
return;
}
$query_replacements = array(':products_id' => (int) $this->get_value, ':languages_id' => (int) KissMT::init()->retrieve('languages_id'));
$query = str_replace(array_keys($query_replacements), array_values($query_replacements), $this->products_query);
$result = KissMT::init()->query($query);
$reviews_text = '';
$products_model = '';
$products_name = '';
$manufacturers_name = '';
while ($product_results = tep_db_fetch_array($result)) {
if (tep_not_null($product_results['products_model'])) {
$products_model = trim($product_results['products_model']);
}
if (tep_not_null($product_results['products_name'])) {
$products_name = trim($product_results['products_name']);
}
if (tep_not_null($product_results['manufacturers_name'])) {
$manufacturers_name = trim($product_results['manufacturers_name']);
}
if (tep_not_null($product_results['reviews_text'])) {
$reviews_text .= trim(rtrim($product_results['reviews_text'], '.') . '.') . '[-separator-]';
}
}
tep_db_free_result($result);
$breadcrumb = array_flip(KissMT::init()->retrieve('breadcrumb'));
if (array_key_exists($products_model, $breadcrumb)) {
unset($breadcrumb[$products_model]);
}
if (array_key_exists($products_name, $breadcrumb)) {
unset($breadcrumb[$products_name]);
}
if (array_key_exists(NAVBAR_TITLE, $breadcrumb)) {
unset($breadcrumb[NAVBAR_TITLE]);
}
$breadcrumb = array_flip($breadcrumb);
$leading_values = $products_name;
if (tep_not_null($products_model)) {
$leading_values .= '[-separator-]' . $products_model;
}
$leading_values .= '[-separator-]' . implode('[-separator-]', $breadcrumb);
if (tep_not_null($manufacturers_name)) {
$leading_values .= '[-separator-]' . sprintf(KISSMT_BRAND_TEXT, $manufacturers_name);
}
$reviews_string = isset($_GET['reviews_id']) && is_numeric($_GET['reviews_id']) ? '&reviews_id=' . $_GET['reviews_id'] : '';
KissMT::init()->setCanonical($this->checkCanonical('products_id', $reviews_string));
$this->parse(KissMT::init()->entities(sprintf(KISSMT_PRODUCT_REVIEWS_TEXT, $leading_values), $decode = true), KissMT::init()->entities($reviews_text, $decode = true));
}
开发者ID:tapwag, 项目名称:oscommerce_deutsch, 代码行数:55, 代码来源:product_reviews.php
示例7: process
public function process()
{
// Do we have a reviews_id
if (array_key_exists('reviews_id', $_GET) && tep_not_null($_GET['reviews_id'])) {
$this->get_value = $this->parsePath($_GET['reviews_id']);
$this->original_get = (int) $_GET['reviews_id'];
$this->cache_name = $this->setCacheString(__FILE__, 'ndesk_rev_info', $this->original_get);
if (false !== $this->retrieve($this->cache_name)) {
KissMT::init()->setCanonical($this->checkCanonical('newsPath'));
return;
}
$query_replacements = array(':reviews_id' => (int) $this->get_value, ':languages_id' => (int) KissMT::init()->retrieve('languages_id'));
$query = str_replace(array_keys($query_replacements), array_values($query_replacements), $this->query);
$result = KissMT::init()->query($query);
$description = '';
$name = '';
$details = tep_db_fetch_array($result);
$name = trim($details['name']);
$description .= trim($details['description']);
$newsdesk_name = trim($details['newsdesk_name']);
tep_db_free_result($result);
$description = isset($description) && tep_not_null($description) ? $description : false;
$name = isset($name) && tep_not_null($name) ? $name : '';
$newsdesk_name = isset($newsdesk_name) && tep_not_null($newsdesk_name) ? $newsdesk_name : '';
$breadcrumb = array_flip(KissMT::init()->retrieve('breadcrumb'));
if (array_key_exists($name, $breadcrumb)) {
unset($breadcrumb[$name]);
}
if (tep_not_null($breadcrumb)) {
// Is there still something in the breadcrumb array?
$breadcrumb = array_flip($breadcrumb);
$leading_values = implode('[-separator-]', $breadcrumb) . (tep_not_null($newsdesk_name) ? '[-separator-]' . $newsdesk_name : '') . (tep_not_null($name) ? '[-separator-]' . $name : '');
} else {
// Nothing in the breadcrumb array
$leading_values = (tep_not_null($newsdesk_name) ? '[-separator-]' . $newsdesk_name : '') . (tep_not_null($name) ? $name : HEADING_TITLE);
}
} else {
// No reviews_id so we'll work with what we have
$leading_values = implode('[-separator-]', KissMT::init()->retrieve('breadcrumb'));
$description = false;
}
KissMT::init()->setCanonical($this->checkCanonical('reviews_id'));
$this->parse(KissMT::init()->entities($leading_values, $decode = true), KissMT::init()->entities(trim($description), $decode = true));
}
开发者ID:tapwag, 项目名称:oscommerce_deutsch, 代码行数:44, 代码来源:newsdesk_reviews_info.php
示例8: gc
public function gc()
{
if (KISSMT_CACHE_RESET !== 'reset') {
return false;
}
foreach (glob(KissMT::init()->retrieve('cache_path') . "*.cache") as $filename) {
@unlink($filename);
}
$query = "SELECT configuration_id FROM " . TABLE_CONFIGURATION . " WHERE configuration_key = 'KISSMT_CACHE_RESET'";
$result = tep_db_query($query);
$db_installed = tep_db_fetch_array($result);
tep_db_free_result($result);
if (false !== $db_installed) {
$query = "UPDATE " . TABLE_CONFIGURATION . " SET configuration_value = 'false' WHERE configuration_key = 'KISSMT_CACHE_RESET'";
tep_db_query($query);
}
}
开发者ID:tapwag, 项目名称:oscommerce_deutsch, 代码行数:17, 代码来源:kiss_modules.php
示例9: acquireLinkText
/**
* Acquire an array of single or multiple link texts from the query
* this will be cached for later retrieval.
*
* @see Usu_Main::query()
* @uses trim()
*
* @access protected
* @return array array of link test
*/
protected function acquireLinkText()
{
$result = Usu_Main::i()->query($this->query);
$text_array = tep_db_fetch_array($result);
tep_db_free_result($result);
if (false === $text_array) {
return false;
}
$final_text_array = array();
foreach ($text_array as $key => $text) {
if (tep_not_null(trim($text))) {
$final_text_array[$key] = $text;
}
}
// We will cache this result
return $final_text_array;
}
开发者ID:tapwag, 项目名称:oscommerce_deutsch, 代码行数:27, 代码来源:product_reviews_info.php
示例10: tep_db_query
// # important to keep historical pricing / costs for inventory since this can fluctuate with time.
// # if no cost found in suppliers_products_groups, try the products table for old format
// # costing from suppliers_products_groups table
$cost_price_query = tep_db_query("SELECT suppliers_group_price FROM " . TABLE_SUPPLIERS_PRODUCTS_GROUPS . " WHERE products_id = '" . $orders_products['products_id'] . "' AND priority = '0' LIMIT 1");
$cost_price = tep_db_num_rows($cost_price_query) > 0 ? tep_db_result($cost_price_query, 0) : 0;
tep_db_free_result($cost_price_query);
// # costing from products table
$cost_old_query = tep_db_query("SELECT products_price_myself FROM " . TABLE_PRODUCTS . " WHERE products_id = '" . $orders_products['products_id'] . "'");
$cost_old = tep_db_num_rows($cost_old_query) > 0 ? tep_db_result($cost_old_query, 0) : 0;
tep_db_free_result($cost_old_query);
// # if supplier cost is empty, use old format
$cost = !empty($cost_price) ? $cost_price : $cost_old;
// # Retrieve price from products_groups table.
$pricing_query = tep_db_query("SELECT pg.customers_group_price \n\t\t\t\t\t\t\t\t\t\t FROM " . TABLE_PRODUCTS_GROUPS . " pg \n\t\t\t\t\t\t\t\t\t\t LEFT JOIN " . TABLE_CUSTOMERS . " c ON c.customers_group_id = pg.customers_group_id\n\t\t\t\t\t\t\t\t\t\t LEFT JOIN " . TABLE_ORDERS . " o ON o.customers_id = c.customers_id\n\t\t\t\t\t\t\t\t\t\t WHERE o.orders_id = '" . $oID . "'\n\t\t\t\t\t\t\t\t\t\t AND products_id = '" . $orders_products['products_id'] . "'\n\t\t\t\t\t\t\t\t\t\t ");
$price = tep_db_num_rows($pricing_query) > 0 ? tep_db_result($pricing_query, 0) : $orders_products['products_price'];
tep_db_free_result($pricing_query);
// # populate orders_products_data array
$order->products[$index] = array('qty' => $orders_products['products_quantity'], 'name' => str_replace("'", "'", $orders_products['products_name']), 'model' => $orders_products['products_model'], 'tax' => $orders_products['products_tax'], 'price' => (double) $price, 'cost' => (double) $cost, 'final_price' => $orders_products['final_price'], 'products_id' => $orders_products['products_id'], 'free_shipping' => $orders_products['free_shipping'], 'separate_shipping' => $orders_products['separate_shipping'], 'products_weight' => $orders_products['products_weight'], 'orders_products_id' => $orders_products['orders_products_id'], 'warehouse_id' => $orders_products['warehouse_id']);
$subindex = 0;
$attributes_query_string = "select * from " . TABLE_ORDERS_PRODUCTS_ATTRIBUTES . " where orders_id = '" . (int) $oID . "' and orders_products_id = '" . (int) $orders_products['orders_products_id'] . "'";
$attributes_query = tep_db_query($attributes_query_string);
if (tep_db_num_rows($attributes_query)) {
while ($attributes = tep_db_fetch_array($attributes_query)) {
$order->products[$index]['attributes'][$subindex] = array('option' => $attributes['products_options'], 'value' => $attributes['products_options_values'], 'prefix' => $attributes['price_prefix'], 'price' => $attributes['options_values_price'], 'orders_products_attributes_id' => $attributes['orders_products_attributes_id']);
$subindex++;
}
}
$index++;
}
// # END while
?>
开发者ID:rrecurse, 项目名称:IntenseCart, 代码行数:31, 代码来源:edit_orders.php
示例11: acquireLinkText
/**
* Acquire an array of single or multiple link texts from the query
* this will be cached for later retrieval.
*
* @see Usu_Main::query()
* @uses trim()
*
* @access protected
* @return array array of link test
*/
protected function acquireLinkText()
{
if (false !== ($final_text_array = Usu_Main::i()->getVar('registry')->retrieve($this->key, $this->keys_index[$this->key]))) {
if (Usu_Main::monitorPerformance()) {
Usu_Main::$performance['queries_saved']++;
}
return $final_text_array;
}
$result = Usu_Main::i()->query($this->query);
$text_array = tep_db_fetch_array($result);
tep_db_free_result($result);
if (false === $text_array) {
return false;
}
$final_text_array = array();
foreach ($text_array as $key => $text) {
if (tep_not_null(trim($text))) {
$final_text_array[$key] = $text;
}
}
// We will cache this result
Usu_Main::i()->getVar('registry')->attach($this->key, $this->keys_index[$this->key], $final_text_array);
return $final_text_array;
}
开发者ID:tapwag, 项目名称:oscommerce_deutsch, 代码行数:34, 代码来源:product_info.php
示例12: GenerateSpecialsSitemap
function GenerateSpecialsSitemap($languages_id)
{
global $languages_id;
$products_query = tep_db_query("SELECT p.products_id as pID, s.specials_date_added as date_added, s.specials_last_modified as last_mod, p.products_ordered\n FROM " . TABLE_PRODUCTS . " p left join " . TABLE_PRODUCTS_DESCRIPTION . " pd on p.products_id = pd.products_id left join " . TABLE_SPECIALS . " s on pd.products_id = s.products_id\n where p.products_status = '1' and s.status = '1' and pd.language_id = " . (int) $languages_id . " order by s.specials_date_added desc ");
if (tep_db_num_rows($products_query) > 0) {
$this->debug['QUERY']['SPECIALS']['STATUS'] = 'success';
$this->debug['QUERY']['SPECIALS']['NUM_ROWS'] = tep_db_num_rows($products_query);
$container = array();
$number = 0;
$top = 0;
while ($result = tep_db_fetch_array($products_query)) {
$top = max($top, $result['products_ordered']);
$location = $this->hrefLink(FILENAME_PRODUCT_INFO, 'products_id=' . $result['pID'], 'NONSSL');
$lastmod = $this->NotNull($result['last_mod']) ? $result['last_mod'] : $result['date_added'];
$changefreq = GOOGLE_SITEMAP_SPECIALS_CHANGE_FREQ;
$ratio = $top > 0 ? $result['products_ordered'] / $top : 0;
$priority = $ratio < 0.1 ? 0.1 : number_format($ratio, 1, '.', '');
$container[] = array('loc' => htmlspecialchars(utf8_encode($location)), 'lastmod' => date("Y-m-d", strtotime($lastmod)), 'changefreq' => $changefreq, 'priority' => $priority);
if (sizeof($container) >= 50000) {
$type = $number == 0 ? 'specials' : 'specials' . $number;
$this->GenerateSitemap($container, $type);
$container = array();
$number++;
}
}
tep_db_free_result($products_query);
if (sizeof($container) > 0) {
$type = $number == 0 ? 'specials' : 'specials' . $number;
return $this->GenerateSitemap($container, $type);
}
} else {
$this->debug['QUERY']['SPECIALS']['STATUS'] = 'false';
$this->debug['QUERY']['SPECIALS']['NUM_ROWS'] = '0';
return $this->GenerateSitemap(array(), 'specials');
}
}
开发者ID:CristianCCIT, 项目名称:shop4office, 代码行数:36, 代码来源:sitemap.php
示例13: buildCategoriesCache
/**
* * Building the $categories array
*
* @param $filepath - Full path to cache
* @param $order_by sort setting chosed in oscommerce admin
* @param $languages_id
* @return Returns the fully built $categories array as well as javascript
* Copyright for SuckerTree Vertical Menu 1.1
* @copyright Dynamic Drive: http://www.dynamicdrive.com/style/
*/
function buildCategoriesCache($filepath, $order_by, $languages_id)
{
$result = categoriesFullScan($order_by, $languages_id);
$javamenustring = '';
/**
* Loop through each row
* creating the raw $categories array
*/
while ($row = tep_db_fetch_array($result)) {
$categories[$row['categories_id']] = array('id' => $row['categories_id'], 'parent' => $row['parent_id'], 'sort' => $row['sort_order'], 'path' => '', 'name' => htmlentities($row['categories_name']));
}
tep_db_free_result($result);
// Housekeeping
/**
* Loop through the raw $categories array
* This time we are adding the following:
* $categories[<cat_id>]['children'] which is a comma seperated list of this categories children
* $categories[<cat_id>]['path'] which is the cPath but only for parent categories
* @param $javamenustring a comma seperated string which is later passed to $categories['menuid_string']
*/
foreach ($categories as $cat_id => $key) {
if ($key['parent'] != '0') {
isset($categories[$key['parent']]['children']) && $categories[$key['parent']]['children'] !== NULL ? NULL : ($categories[$key['parent']]['children'] = '');
$categories[$key['parent']]['children'] .= $key['id'] . ',';
} else {
$javamenustring .= '"menu_' . $key['id'] . '",';
$categories[$key['id']]['path'] .= $key['id'];
}
}
// added version 1.1.2
/**
* Loop through the $categories array yet again
* $categories[<cat_id>]['path'] is created for all categories EXCEPT parent categories
* Calls on function setCpath to generate muli layer cPaths
*
*/
foreach ($categories as $cat_id => $key) {
$fullcatpath = '';
if ($key['parent'] != '0') {
$fullcatpath = setCpath($categories, $key['id']);
$categories[$key['id']]['path'] = $fullcatpath;
}
}
$javamenustring = rtrim($javamenustring, ',');
$categories['menuid_string'] = $javamenustring;
$categories['menuid_js'] = <<<JSSCRIPT
<script language="javascript" type="text/javascript">
function get_menu_ids() {
var menuids=[{$javamenustring}] //Enter id(s) of SuckerTree UL menus, separated by commas
return menuids;
}
</script>
<script src="includes/javascript/suckertree.js" type="text/javascript"></script>
JSSCRIPT;
// Serialize and save the $categories array
$serialized = serialize($categories);
if (defined('FWR_MENU_RESET') && FWR_MENU_RESET == 'true' || defined('FWR_SUCKERTREE_MENU_ON') && 'true' === FWR_SUCKERTREE_MENU_ON && !file_exists($filepath . $languages_id . "_categories.ser")) {
/**
* We are deleting the old cache files so we will delete all files
* on the relevant directory path with a .ser filename
*/
foreach (glob($filepath . "*.ser") as $filename) {
unlink($filename);
}
// Write the new cache
saveSerializedFile($filepath, $serialized, $languages_id, "_categories.ser");
// FWR DOM XML - uncomment the line below to activate
//if( class_exists('DOMDocument') ) sitemapXML($filepath, $categories);
$sql = "\r\nUPDATE " . TABLE_CONFIGURATION . "\r\nSET `configuration_value` = 'false'\r\nWHERE `configuration_key` = 'FWR_MENU_RESET'";
//Reset the FWR Menu reset back to false
tep_db_query($sql) or die('Update failed ' . mysql_error());
}
return $categories;
}
开发者ID:digideskio, 项目名称:oscmax2, 代码行数:84, 代码来源:fwr_cat_functions.php
示例14: sk_set_language
function sk_set_language()
{
global $languages_id, $language_code;
$language_query = tep_db_query('select languages_id, code from ' . TABLE_LANGUAGES);
if (tep_db_num_rows($language_query) == 1 && ($language_row = tep_db_fetch_array($language_query))) {
// Wenn nur eine Sprache definiert ist, benutzen wir diese.
$languages_id = $language_row['languages_id'];
$language_code = $language_row['code'];
} else {
if (!defined('PROD_DEFAULT_LANGUAGE_ID')) {
trigger_error('Bitte setzen Sie in der Datei elmar_config.inc.php die Konstante PROD_DEFAULT_LANGUAGE_ID auf die in Ihrem Shop verwendete Sprach-ID.', E_USER_ERROR);
} else {
if (!defined('PROD_DEFAULT_LANGUAGE')) {
trigger_error('Bitte setzen Sie in der Datei elmar_config.inc.php die Konstante PROD_DEFAULT_LANGUAGE auf den in Ihrem Shop verwendeten Sprachcode.', E_USER_ERROR);
} else {
$languages_id = PROD_DEFAULT_LANGUAGE_ID;
$language_code = PROD_DEFAULT_LANGUAGE;
}
}
}
tep_db_free_result($language_query);
}
开发者ID:severnaya99, 项目名称:Sg-2010, 代码行数:22, 代码来源:elmar.inc.php
示例15: _get_attribute_values_list
function _get_attribute_values_list($products_id)
{
$res = tep_db_query("SELECT po.products_options_name, pov.products_options_values_name\n FROM " . TABLE_PRODUCTS_ATTRIBUTES . " pa\n INNER JOIN " . TABLE_PRODUCTS_OPTIONS . " po\n ON (pa.options_id = po.products_options_id\n AND po.language_id = {$GLOBALS['languages_id']})\n INNER JOIN " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov\n ON (pa.options_values_id = pov.products_options_values_id\n AND pov.language_id = {$GLOBALS['languages_id']})\n WHERE pa.products_id = {$products_id} ");
$values = array();
while ($row = tep_db_fetch_array($res)) {
$values[$row['products_options_name']][] = $row['products_options_values_name'];
}
reset($values);
while (list($id, $value) = each($values)) {
$result[$id] = implode(",", array_unique($value));
}
tep_db_free_result($res);
return $result;
}
开发者ID:rrecurse, 项目名称:IntenseCart, 代码行数:14, 代码来源:competitive_pricing_report.php
示例16: get_parents
private function get_parents(&$categories, $categories_id)
{
$query = "SELECT parent_id \r\n FROM " . TABLE_CATEGORIES . " \r\n WHERE categories_id='" . (int) $categories_id . "'";
$parent_category_query = usu::query($query);
$parent_category = tep_db_fetch_array($parent_category_query);
tep_db_free_result($parent_category_query);
if ($parent_category['parent_id'] == 0) {
return;
// We are at the top level so return ending the loop
}
$categories[count($categories)] = $parent_category['parent_id'];
if ($parent_category['parent_id'] != $categories_id) {
$this->get_parents($categories, $parent_category['parent_id']);
}
}
开发者ID:digideskio, 项目名称:oscmax2, 代码行数:15, 代码来源:Usu_Categories.php
示例17: combinations
$options[$i]['options_values_price'][$products_options_id . $option_value_seperator . $products_options_values['products_options_values_id']] = $products_options_values['options_values_price'];
}
++$i;
}
$combinations = combinations($options, $options_seperator);
foreach ($combinations as $combination_id => $combination) {
$combination['combination_id'] = $combination_id;
$i_rows[$language_id][$products_id][] = array_merge($combination, $products[$language_id][$products_id]);
}
}
}
}
}
echo 'products attributes array built' . "\n";
ob_flush();
tep_db_free_result($products_attributes_query);
}
//
echo 'feed generation in process...' . "\n";
ob_flush();
foreach ($feeds as $cur_feed_id => $cur_feed) {
foreach ($products[$cur_feed['language_id']] as $row) {
$rows = array();
if (isset($i_rows[$cur_feed['language_id']][$row['products_id']]) && $cur_feed['attributes_handling'] == 2) {
$rows =& $i_rows[$cur_feed['language_id']][$row['products_id']];
} else {
$rows[] =& $row;
}
foreach ($rows as $product) {
if (!empty($cur_feed['include_record_function'])) {
$include_record = call_user_func_array($cur_feed['include_record_function'], array(&$product));
开发者ID:digideskio, 项目名称:oscmax2, 代码行数:31, 代码来源:feedmachine.php
示例18: customers_returning
function customers_returning()
{
$customers_returning_query = tep_db_query("SELECT COUNT(0)\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t FROM (\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \tSELECT NULL\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tFROM orders\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tWHERE date_purchased >= ADDDATE(CURDATE(), INTERVAL 1 - DAYOFWEEK(CURDATE())DAY)\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tAND customers_id !=0\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGROUP BY customers_id\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tHAVING COUNT(*) > 1\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t) AS cnt");
$customers_returning = tep_db_num_rows($customers_new_query) > 0 ? tep_db_result($customers_returning_query, 0) : 0;
tep_db_free_result($customers_returning_query);
return $customers_returning;
}
开发者ID:rrecurse, 项目名称:IntenseCart, 代码行数:7, 代码来源:index-menu.php
示例19: extractCacheData
/**
* Factory to extract data from the various cache strategies
*
* @see Usu_Main::getVar()
* @see Data_Registry::load()
* @uses microtime()
* @uses str_replace()
* @uses number_format()
* @uses strlen()
* @uses gzinflate()
* @uses base64_decode()
* @uses unserialize()
* @uses is_readable()
* @uses file_get_contents()
* @param string $cache_name - cache name to extract
* @param string $cache_type - e.g. mysql, file etc.
* @param object $object iCache_System
*
* @access public
* @return bool
*/
public function extractCacheData($cache_name, $cache_type, iCache_System $object)
{
$cache_seconds = (int) USU5_CACHE_DAYS * 24 * 60 * 60;
$timestart = microtime(true);
switch (true) {
case $cache_type == 'mysql':
$query = str_replace(':cache_name', $cache_name, $object->extract_query);
$result = $this->query($query);
$row = tep_db_fetch_array($result);
tep_db_free_result($result);
if (false === $row) {
self::$performance['time_extracting_cache'] = number_format(microtime(true) - $timestart, 4);
// return insert = true as there is nothing in the database
return true;
}
if (time() > strtotime($row['cache_date']) + $cache_seconds) {
// If the cache has expired
$object->gc();
// Clear the cache
self::$performance['time_extracting_cache'] = number_format(microtime(true) - $timestart, 4);
// return insert = true as there is nothing in the database
return true;
} else {
// the cache hasn't expired so we retrieve it and set the registry
$cache_file_size = number_format(strlen($row['cache_data']) / 1024, 2) . ' kb';
$rawdata = gzinflate(base64_decode($row['cache_data']));
$this->getVar('registry')->load(unserialize($rawdata));
self::$performance['time_extracting_cache'] = number_format(microtime(true) - $timestart, 4);
self::$performance['cache_loaded'] = 'true';
// return insert = false as we have extracted data from the database
return false;
}
break;
case $cache_type == 'file':
if (is_readable($this->getVar('cache_system_path') . 'cache/' . $cache_name . '.cache')) {
$this->getVar('registry')->load(unserialize(gzinflate(file_get_contents($this->getVar('cache_system_path') . 'cache/' . $cache_name . '.cache'))));
self::$performance['cache_loaded'] = 'true';
self::$performance['time_extracting_cache'] = number_format(microtime(true) - $timestart, 4);
return false;
} else {
self::$performance['time_extracting_cache'] = number_format(microtime(true) - $timestart, 4);
return true;
}
break;
case $cache_type == 'memcache':
if (false === ($rawdata = $object->get($cache_name))) {
self::$performance['time_extracting_cache'] = number_format(microtime(true) - $timestart, 4);
// return insert = true as there is nothing in the database
return true;
}
$rawdata = gzinflate(base64_decode($rawdata));
$this->getVar('registry')->load(unserialize($rawdata));
self::$performance['time_extracting_cache'] = number_format(microtime(true) - $timestart, 4);
self::$performance['cache_loaded'] = 'true';
// return insert = false as we have extracted data from the database
return false;
break;
case $cache_type == 'sqlite':
$query = str_replace(':cache_name', $cache_name, $object->extract_query);
$result = $object->getDb()->query($query);
$row = $result->fetch();
if (empty($row)) {
self::$performance['time_extracting_cache'] = number_format(microtime(true) - $timestart, 4);
// return insert = true as there is nothing in the database
return true;
}
if (time() > strtotime($row['cache_date']) + $cache_seconds) {
// If the cache has expired
$object->gc();
// Clear the cache
self::$performance['time_extracting_cache'] = number_format(microtime(true) - $timestart, 4);
// return insert = true as there is nothing in the database
return true;
} else {
// the cache hasn't expired so we retrieve it and set the registry
$cache_file_size = number_format(strlen($row['cache_data']) / 1024, 2) . ' kb';
$rawdata = gzinflate(base64_decode($row['cache_data']));
$this->getVar('registry')->load(unserialize($rawdata));
self::$performance['time_extracting_cache'] = number_format(microtime(true) - $timestart, 4);
//.........这里部分代码省略.........
开发者ID:tapwag, 项目名称:oscommerce_deutsch, 代码行数:101, 代码来源:usu5.php
宝宝鼻子不通气,如果不是病毒感冒的话建议不要吃药,多喝温开水,注意观察体温。保持
阅读:942| 2022-07-30
dphi-official/Machine_Learning_Bootcamp
阅读:1361| 2022-08-18
juven/maven-bash-completion: Maven Bash Auto Completion
阅读:816| 2022-08-16
win7系统电脑使用过程中有不少朋友表示遇到过win7系统注册表编辑器打开的状况,当出现
阅读:760| 2022-11-06
route101/mastoinker: Quick image view assistant for Mastodon client
阅读:920| 2022-08-18
Delphi获取当前鼠标下的控件内容主要函数:GetCursorPos;//获取鼠标的位置WindowFrom
阅读:1117| 2022-07-18
Performance Counters for Windows Elevation of Privilege Vulnerability.
阅读:1193| 2022-07-29
0e0w · GitHub
阅读:427| 2022-08-15
tgreyuk/typedoc-plugin-markdown: A plugin for TypeDoc that enables TypeScript AP
阅读:757| 2022-08-18
台湾人的方言是“台湾话”,官方是“国语”,和普通话一样。小编一直觉得,大连话和台
阅读:315| 2022-11-06
请发表评论