function vam_product_link($pID, $name = '') { $pName = vam_cleanName($name); $link = 'products_id=' . $pID; if (SEARCH_ENGINE_FRIENDLY_URLS == 'true') { $link = 'info=p' . $pID . '_' . $pName . '.html'; } return $link; }
function vam_category_link($cID, $cName = '') { $cName = vam_cleanName($cName); $link = 'cat=' . $cID; if (SEARCH_ENGINE_FRIENDLY_URLS == 'true') { $link = 'cat=c' . $cID . '_' . $cName . '.html'; } return $link; }
function vam_show_topic($counter) { global $tree, $topics_string, $tPath_array; for ($i = 0; $i < $tree[$counter]['level']; $i++) { $topics_string .= " "; } $topics_string .= '<a href="'; if ($tree[$counter]['parent'] == 0) { $tPath_new = 'tPath=' . $counter; } else { $tPath_new = 'tPath=' . $tree[$counter]['path']; } $SEF_parameter_cat = ''; if (SEARCH_ENGINE_FRIENDLY_URLS == 'true') { $SEF_parameter_cat = '&category=' . vam_cleanName($tree[$counter]['name']); } $topics_string .= vam_href_link(FILENAME_ARTICLES, $tPath_new . $SEF_parameter_cat) . '">'; if (isset($tPath_array) && in_array($counter, $tPath_array)) { $topics_string .= '<b>'; } // display topic name $topics_string .= $tree[$counter]['name']; if (isset($tPath_array) && in_array($counter, $tPath_array)) { $topics_string .= '</b>'; } if (vam_has_topic_subtopics($counter)) { $topics_string .= ' ->'; } $topics_string .= '</a>'; if (SHOW_ARTICLE_COUNTS == 'true') { $articles_in_topic = vam_count_articles_in_topic($counter); if ($articles_in_topic > 0) { $topics_string .= ' (' . $articles_in_topic . ')'; } } $topics_string .= '<br />' . "\n"; if ($tree[$counter]['next_id'] != false) { vam_show_topic($tree[$counter]['next_id']); } }
function vam_manufacturer_link($mID, $mName = '') { $mName = vam_cleanName($mName); $link = 'manu=m' . $mID . '_' . $mName . '.html'; return $link; }
$module_content = array(); $query = vamDBquery($sql); while ($one = vam_db_fetch_array($query, true)) { // $qI = 0; $qIcon = ''; if ($qI = strpos($one['content'], 'src="')) { $qI = $qI + 5; $qIcon = substr($one['content'], $qI); $qI = strpos($qIcon, '"'); $qIcon = '<img class="newsImage" src="' . substr($qIcon, 0, $qI) . '" alt="Image" />'; } // $SEF_parameter = ''; if (SEARCH_ENGINE_FRIENDLY_URLS == 'true') { $SEF_parameter = '&headline=' . vam_cleanName($one['headline']); } $module_content[] = array('NEWS_HEADING' => $one['headline'], 'NEWS_CONTENT' => $one['content'], 'NEWS_ID' => $one['news_id'], 'NEWS_ICON' => $qIcon, 'NEWS_DATA' => vam_date_short($one['date_added']), 'NEWS_LINK_MORE' => vam_href_link(FILENAME_NEWS, 'news_id=' . $one['news_id'] . $SEF_parameter, 'NONSSL')); } if (sizeof($module_content) > 0) { $module->assign('NEWS_LINK', vam_href_link(FILENAME_NEWS)); $module->assign('language', $_SESSION['language']); $module->assign('module_content', $module_content); // set cache ID if (!CacheCheck()) { $module->caching = 0; $module = $module->fetch(CURRENT_TEMPLATE . '/module/latest_news_default.html'); } else { $module->caching = 1; $module->cache_lifetime = CACHE_LIFETIME; $module->cache_modified_check = CACHE_CHECK;
$qIcon=substr ($$articles['content'] , $qI); $qI=strpos($qIcon,'"'); $qIcon='<img class="newsImage" src="'.substr ($qIcon, 0,$qI).'" alt="Image" />'; } */ $SEF_parameter = ''; if (SEARCH_ENGINE_FRIENDLY_URLS == 'true') { $SEF_parameter = '&article=' . vam_cleanName($articles['articles_name']); } $SEF_parameter_author = ''; if (SEARCH_ENGINE_FRIENDLY_URLS == 'true') { $SEF_parameter_author = '&author=' . vam_cleanName($articles['authors_name']); } $SEF_parameter_category = ''; if (SEARCH_ENGINE_FRIENDLY_URLS == 'true') { $SEF_parameter_category = '&category=' . vam_cleanName($articles['topics_name']); } $module_content[] = array('ARTICLE_ID' => $articles['articles_id'], 'ARTICLE_NAME' => $articles['articles_name'], 'ARTICLE_IMAGE' => $articles['articles_image'], 'ARTICLE_SHORT_DESCRIPTION' => strip_tags($articles['articles_description']), 'ARTICLE_DATE' => vam_date_long($articles['articles_date_added']), 'ARTICLE_LINK' => vam_href_link(FILENAME_ARTICLE_INFO, 'articles_id=' . $articles['articles_id'] . $SEF_parameter), 'AUTHOR_NAME' => $articles['authors_name'], 'AUTHOR_LINK' => vam_href_link(FILENAME_ARTICLES, 'authors_id=' . $articles['authors_id'] . $SEF_parameter_author), 'ARTICLE_CATEGORY_NAME' => $articles['topics_name'], 'ARTICLE_CATEGORY_LINK' => vam_href_link(FILENAME_ARTICLES, 'tPath=' . $articles['topics_id'] . $SEF_parameter_category)); } } else { $vamTemplate->assign('no_articles', 'true'); } $vamTemplate->assign('language', $_SESSION['language']); $vamTemplate->caching = 0; $vamTemplate->assign('module_content', $module_content); $main_content = $vamTemplate->fetch(CURRENT_TEMPLATE . '/module/articles.html'); $vamTemplate->assign('main_content', $main_content); $vamTemplate->assign('language', $_SESSION['language']); $vamTemplate->caching = 0; if (!defined(RM)) { $vamTemplate->load_filter('output', 'note');
$box->caching = 1; $box->cache_lifetime = CACHE_LIFETIME; $box->cache_modified_check = CACHE_CHECK; $cache_id = $_SESSION['language'] . $_SESSION['customers_status']['customers_status_id']; } if (!$box->is_cached(CURRENT_TEMPLATE . '/boxes/box_information.html', $cache_id) || !$cache) { $box->assign('tpl_path', 'templates/' . CURRENT_TEMPLATE . '/'); if (GROUP_CHECK == 'true') { $group_check = "and group_ids LIKE '%c_" . $_SESSION['customers_status']['customers_status_id'] . "_group%'"; } $content_query = "SELECT\r\n\t \t\t\t\t\tcontent_id,\r\n\t \t\t\t\t\tcategories_id,\r\n\t \t\t\t\t\tparent_id,\r\n\t \t\t\t\t\tcontent_title,\r\n\t \t\t\t\t\tcontent_url,\r\n\t \t\t\t\t\tcontent_group\r\n\t \t\t\t\t\tFROM " . TABLE_CONTENT_MANAGER . "\r\n\t \t\t\t\t\tWHERE languages_id='" . (int) $_SESSION['languages_id'] . "'\r\n\t \t\t\t\t\tand file_flag=0 " . $group_check . " and content_status=1 order by sort_order"; $content_query = vamDBquery($content_query); while ($content_data = vam_db_fetch_array($content_query, true)) { $SEF_parameter = ''; if (SEARCH_ENGINE_FRIENDLY_URLS == 'true') { $SEF_parameter = '&product=' . vam_cleanName($content_data['content_title']); } if ($content_data['content_url'] != '') { $link = '<li class="menu"><a class="menu" href="' . $content_data['content_url'] . '">'; } else { $link = '<li class="menu"><a class="menu" href="' . vam_href_link(FILENAME_CONTENT, 'coID=' . $content_data['content_group'] . $SEF_parameter) . '">'; } $content_string .= $link . $content_data['content_title'] . '</a></li>' . "\n"; } if ($content_string != '') { $box->assign('BOX_CONTENT', $content_string); } } if (!$cache) { $box_information = $box->fetch(CURRENT_TEMPLATE . '/boxes/box_information.html'); } else {
function vam_rss_articles($sql_products) { global $db, $rss, $random; $sql_maxdate = "select max(articles_date_added) as max_date_added, max(articles_last_modified) as max_date_modified\n\t\t\t\t\t\t\t\t\t\tfrom " . TABLE_ARTICLES . "\n\t\t\t\t\t\t\t\t\t\twhere articles_status = 1"; $maxdate = vam_db_query($sql_maxdate); if (!$maxdate) { $rss->rss_feed_set('lastBuildDate', date('r', strtotime(max($maxdate['max_date_added'], $maxdate['max_date_modified'])))); } if (isset($_GET['limit']) && !$random) { $sql_products .= ' limit ' . $_GET['limit']; } $products_query = vam_db_query($sql_products); while ($products = vam_db_fetch_array($products_query)) { $SEF_parameter = ''; if (SEARCH_ENGINE_FRIENDLY_URLS == 'true') { $SEF_parameter = '&article=' . vam_cleanName($products['articles_name']); } $link = vam_href_link(FILENAME_ARTICLE_INFO, 'articles_id=' . $products['articles_id'] . $SEF_parameter . (isset($_GET['ref']) ? '&ref=' . $_GET['ref'] : null), 'NONSSL', false); $rss->rss_feed_item($products['articles_name'], $link, $link, date('r', strtotime(max($products['articles_date_added'], $products['articles_last_modified']))), $products['articles_description'], '', ''); } $rss->rss_feed_out(); }
$box->cache_modified_check = CACHE_CHECK; $cache_id = $_SESSION['language'] . $_SESSION['customers_status']['customers_status_id']; } $authors_query = "select authors_id, authors_name from " . TABLE_AUTHORS . " order by authors_name"; $authors_query = vamDBquery($authors_query); $number_of_author_rows = vam_db_num_rows($authors_query, true); if (!$box->is_cached(CURRENT_TEMPLATE . '/boxes/box_authors.html', $cache_id) || !$cache) { $box->assign('tpl_path', 'templates/' . CURRENT_TEMPLATE . '/'); if (vam_db_num_rows($authors_query, true) > 0) { if ($number_of_author_rows <= MAX_DISPLAY_AUTHORS_IN_A_LIST) { // Display a list $authors_list = ''; while ($authors = vam_db_fetch_array($authors_query, true)) { $SEF_parameter_author = ''; if (SEARCH_ENGINE_FRIENDLY_URLS == 'true') { $SEF_parameter_author = '&author=' . vam_cleanName($authors['authors_name']); } $authors_name = utf8_strlen($authors['authors_name']) > MAX_DISPLAY_AUTHOR_NAME_LEN ? utf8_substr($authors['authors_name'], 0, MAX_DISPLAY_AUTHOR_NAME_LEN) . '..' : $authors['authors_name']; if (isset($_GET['authors_id']) && $_GET['authors_id'] == $authors['authors_id']) { $authors_name = '<b>' . $authors_name . '</b>'; } $authors_list .= '<a href="' . vam_href_link(FILENAME_ARTICLES, 'authors_id=' . $authors['authors_id'] . $SEF_parameter_author) . '">' . $authors_name . '</a><br>'; } $authors_list = utf8_substr($authors_list, 0, -4); $content_string .= $authors_list; } else { // Display a drop-down $authors_array = array(); if (MAX_AUTHORS_LIST < 2) { $authors_array[] = array('id' => '0', 'text' => PULL_DOWN_DEFAULT); }
http://vamshop.ru http://vamshop.com Copyright (c) 2007 VaM Shop ----------------------------------------------------------------------------------------- Released under the GNU General Public License ---------------------------------------------------------------------------------------*/ $box = new vamTemplate(); $box->assign('tpl_path', 'templates/' . CURRENT_TEMPLATE . '/'); $sql = "\n SELECT\n faq_id,\n question,\n answer,\n date_added\n FROM " . TABLE_FAQ . "\n WHERE\n status = '1'\n and language = '" . (int) $_SESSION['languages_id'] . "'\n ORDER BY date_added DESC\n LIMIT " . MAX_DISPLAY_FAQ . "\n "; $module_content = array(); $query = vamDBquery($sql); while ($one = vam_db_fetch_array($query, true)) { $SEF_parameter = ''; if (SEARCH_ENGINE_FRIENDLY_URLS == 'true') { $SEF_parameter = '&question=' . vam_cleanName($one['question']); } $module_content[] = array('FAQ_QUESTION' => $one['question'], 'FAQ_ANSWER' => $one['answer'], 'FAQ_ID' => $one['faq_id'], 'FAQ_DATA' => vam_date_short($one['date_added']), 'FAQ_LINK_MORE' => vam_href_link(FILENAME_FAQ, 'faq_id=' . $one['faq_id'] . $SEF_parameter, 'NONSSL')); } if (sizeof($module_content) > 0) { $box->assign('FAQ_LINK', vam_href_link(FILENAME_FAQ)); $box->assign('language', $_SESSION['language']); $box->assign('module_content', $module_content); // set cache ID if (USE_CACHE == 'false') { $box->caching = 0; $module = $box->fetch(CURRENT_TEMPLATE . '/boxes/box_faq.html'); } else { $box->caching = 1; $box->cache_lifetime = CACHE_LIFETIME; $box->cache_modified_check = CACHE_CHECK;
function process_button() { global $customer_id, $order, $sendto, $vamPrice, $currencies, $cart_zpayment_id, $shipping; $process_button_string = ''; $purse = MODULE_PAYMENT_Z_PAYMENT_ID; $order_sum = $order->info['total']; $process_button_string = vam_draw_hidden_field('LMI_PAYMENT_NO', substr($cart_zpayment_id, strpos($cart_zpayment_id, '-') + 1)) . vam_draw_hidden_field('LMI_PAYEE_PURSE', $purse) . vam_draw_hidden_field('LMI_PAYMENT_DESC', vam_cleanName('Заказ номер: ' . substr($cart_zpayment_id, strpos($cart_zpayment_id, '-') + 1) . ', покупатель номер: ' . $_SESSION['customer_id'])) . vam_draw_hidden_field('LMI_PAYMENT_AMOUNT', $order_sum) . vam_draw_hidden_field('CLIENT_MAIL', $order->customer['email_address']) . vam_draw_hidden_field('LMI_SIM_MODE', '0'); return $process_button_string; }
require DIR_FS_CATALOG . 'templates/' . CURRENT_TEMPLATE . '/source/boxes.php'; // include needed function require_once DIR_FS_INC . 'vam_date_long.inc.php'; require DIR_WS_INCLUDES . 'header.php'; $article_check_query = "select count(*) as total from " . TABLE_ARTICLES . " a, " . TABLE_ARTICLES_DESCRIPTION . " ad where a.articles_status = '1' and a.articles_id = '" . (int) $_GET['articles_id'] . "' and ad.articles_id = a.articles_id and ad.language_id = '" . (int) $_SESSION['languages_id'] . "'"; $article_check_query = vamDBquery($article_check_query); $article_check = vam_db_fetch_array($article_check_query, true); $article_info_query = "select a.articles_id, a.articles_date_added, a.articles_date_available, a.authors_id, ad.articles_name, ad.articles_description, ad.articles_url, ad.articles_viewed, au.authors_name from " . TABLE_ARTICLES . " a left join " . TABLE_AUTHORS . " au on a.authors_id = au.authors_id, " . TABLE_ARTICLES_DESCRIPTION . " ad where a.articles_status = '1' and a.articles_id = '" . (int) $_GET['articles_id'] . "' and ad.articles_id = a.articles_id and ad.language_id = '" . (int) $_SESSION['languages_id'] . "'"; $article_info_query = vamDBquery($article_info_query); $article_info = vam_db_fetch_array($article_info_query, true); vam_db_query("update " . TABLE_ARTICLES_DESCRIPTION . " set articles_viewed = articles_viewed+1 where articles_id = '" . (int) $_GET['articles_id'] . "' and language_id = '" . (int) $_SESSION['languages_id'] . "'"); if ($article_check['total'] > 0) { $vamTemplate->assign('no_article', 'false'); $SEF_parameter_author = ''; if (SEARCH_ENGINE_FRIENDLY_URLS == 'true') { $SEF_parameter_author = '&author=' . vam_cleanName($article_info['authors_name']); } $vamTemplate->assign('ARTICLE_NAME', $article_info['articles_name']); $vamTemplate->assign('ARTICLE_DESCRIPTION', $article_info['articles_description']); $vamTemplate->assign('ARTICLE_VIEWED', $article_info['articles_viewed']); $vamTemplate->assign('ARTICLE_DATE', vam_date_long($article_info['articles_date_added'])); $vamTemplate->assign('ARTICLE_URL', $article_info['articles_url']); $vamTemplate->assign('AUTHOR_NAME', $article_info['authors_name']); $vamTemplate->assign('AUTHOR_LINK', vam_href_link(FILENAME_ARTICLES, 'authors_id=' . $article_info['authors_id'] . $SEF_parameter_author)); include DIR_WS_MODULES . FILENAME_ARTICLES_XSELL; } else { $vamTemplate->assign('no_article', 'true'); } $vamTemplate->assign('language', $_SESSION['language']); $vamTemplate->caching = 0; $vamTemplate->assign('module_content', $module_content);
http://vamshop.ru http://vamshop.com Copyright (c) 2007 VaM Shop ----------------------------------------------------------------------------------------- Released under the GNU General Public License ---------------------------------------------------------------------------------------*/ $box = new vamTemplate(); $box->assign('tpl_path', 'templates/' . CURRENT_TEMPLATE . '/'); $sql = "select a.articles_id, ad.articles_name, ad.articles_description from " . TABLE_ARTICLES . " a left join " . TABLE_ARTICLES_DESCRIPTION . " ad on ad.articles_id = a.articles_id where a.articles_status = '1' and ad.language_id = '" . (int) $_SESSION['languages_id'] . "' ORDER BY articles_date_added DESC LIMIT " . MAX_NEW_ARTICLES_PER_PAGE . ""; $articles_content = array(); $articles_query = vamDBquery($sql); while ($articles = vam_db_fetch_array($articles_query, true)) { $SEF_parameter = ''; if (SEARCH_ENGINE_FRIENDLY_URLS == 'true') { $SEF_parameter = '&article=' . vam_cleanName($articles['articles_name']); } $articles_content[] = array('ARTICLES_NAME' => $articles['articles_name'], 'ARTICLES_CONTENT' => $articles['articles_description'], 'ARTICLES_URL' => vam_href_link(FILENAME_ARTICLE_INFO, 'articles_id=' . $articles['articles_id'] . $SEF_parameter)); } if (sizeof($articles_content) > 0) { $box->assign('language', $_SESSION['language']); $box->assign('articles_content', $articles_content); // set cache ID if (USE_CACHE == 'false') { $box->caching = 0; $articiles_new = $box->fetch(CURRENT_TEMPLATE . '/boxes/box_articles_new.html'); } else { $box->caching = 1; $box->cache_lifetime = CACHE_LIFETIME; $box->cache_modified_check = CACHE_CHECK; $cache_id = $_SESSION['language'] . $_SESSION['customers_status']['customers_status_id'];