-
Posts
308 -
Joined
-
Last visited
-
Days Won
1
Everything posted by bhbilbao
-
Is there a way to create diferent wishlists based on session_id?? what about? CREATE TABLE `customers_wishlist` ( `wishlist_id` tinytext collate latin1_spanish_ci NOT NULL, `products_id` tinytext collate latin1_spanish_ci NOT NULL, `customers_id` int(13) NOT NULL default '0' ) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_spanish_ci; and then manage them like screen account_history.php but in this case for the wishlist. In other hand I need to extract the total price of the items in whislist. Something like this cart code: <?php echo SUB_TITLE_SUB_TOTAL; ?><?php echo $currencies->format($cart->show_total()); ?>
-
Need help with: 2- Fast Update to Shopping Cart Quantity http://addons.oscommerce.com/info/4209 I need to work with SSL, when clicking plus or minus buttons it goes-out from ssl to non-ssl page with a warning message. How can I fix this??
-
Need help to work 2 contributions together in includes/aplication_top.php: 1.from Product Quantity Drop Down Box in Product Info // customer adds a product from the products page case 'add_product' : if (isset($_POST['products_id']) && is_numeric($_POST['products_id'])) { if (tep_has_product_attributes($_POST['products_id']) && PRODUCT_LIST_OPTIONS != 'true' && basename($PHP_SELF) != FILENAME_PRODUCT_INFO) tep_redirect(tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $_POST['products_id'])); $add_quantity = (isset($_POST['cart_quantity']) ? (int)$_POST['cart_quantity'] : 1); $cart->add_cart($_POST['products_id'], $cart->get_quantity(tep_get_uprid($_POST['products_id'], $_POST['id']))+$add_quantity, $_POST['id']); } tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters))); break; 2.from XSELL add_recommended product // customer adds a product from the products page case 'add_products' : if (isset($HTTP_POST_VARS['products_id']) && is_numeric($HTTP_POST_VARS['products_id'])) { $cart->add_cart($HTTP_POST_VARS['products_id'], $cart->get_quantity(tep_get_uprid($HTTP_POST_VARS['products_id'], $HTTP_POST_VARS['id']))+1, $HTTP_POST_VARS['id']); $add_quantity = (isset($_POST['cart_quantity']) ? (int)$_POST['cart_quantity'] : 1); if (isset($HTTP_POST_VARS['add_recommended'])) { foreach ($HTTP_POST_VARS['add_recommended'] as $value) { if (ereg('^[0-9]+$', $value)) { $cart->add_cart($value, $cart->get_quantity(tep_get_uprid($value, $HTTP_POST_VARS['id']))+1, $HTTP_POST_VARS['id']); } } } } tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters))); break; Does anyone get these two to work together?. What could be the correct code??
-
Also need support for the last Article Manager contribution. In the last release introduces article_blog.php USU5 dont change the links, and remains as ... article_blog.php?articles_id=1028 I dont know if addind to .htaccess RewriteRule ^([a-z0-9/-]+)-t-([0-9_]+).html$ articles.php [NC,L,QSA] RewriteRule ^([a-z0-9/-]+)-au-([0-9]+).html$ articles.php [NC,L,QSA] RewriteRule ^([a-z0-9/-]+)-a-([0-9]+).html$ article_info.php [NC,L,QSA] RewriteRule ^([a-z0-9/-]+)-a-([0-9]+).html$ article_blog.php [NC,L,QSA] Thanks in advance.
-
**sorry. wrong post. deleted***
-
With PDF Upload contribution, in product_info.php: <a href="' . tep_href_link(DIR_WS_MANUALS . $product_info['products_pdfupload']) . '"target="_blank"><b>' . TEXT_CLICK_TO_PDFUPLOAD . '</b></a>'; USU5 gives an incorrect url with diferent languages: http://www. myweb .com/manuals/manualx.pdf/eu
-
I jet fixed like adding a line in the diferent languajes: // Global entries for the <html> tag define('HTML_PARAMS','dir="LTR" lang="eu"'); // definir codigo meta del lenguaje define('METACODE', 'eu'); // charset for web pages and emails define('CHARSET', 'iso-8859-1'); And replacing to: // if ($defaultTags['meta_language']) { $langName = explode(",", $_SERVER["HTTP_ACCEPT_LANGUAGE"]); echo ' <meta http-equiv="Content-Language" content="' . $langName[0] . '" >'."\n"; } if ($defaultTags['meta_language']) echo ' <meta http-equiv="Content-Language" content="' . METACODE . '" >' . "\n"; Is this right??
-
Hi again Jack, now im trying to change the headers manager to KissMT for the other languages based on the language selected by user and the users browser language. But I dont know how to make works. If anyone? // ****BOF Laguage Redirect *********************** if (!isset($langue_user) && !isset($_SESSION["ch_langue"])){ $langue_user=substr($_SERVER["HTTP_ACCEPT_LANGUAGE"], 0, 2); switch($langue_user){ // Browser English case "en": $_SESSION["ch_langue"] = "es"; header ("Location: http://www. myweb .com/web.php/es"); // include_once(DIR_WS_MODULES . 'kiss_meta_tags/kiss_meta_tags.php'); break; // Browser Euskara case "eu": $_SESSION["ch_langue"] = "eu"; header ("Location: http://www. myweb .com/web.php/eu"); // include_once(DIR_WS_MODULES . 'kiss_meta_tags/kiss_meta_tags.php'); break; // DEFAULT - Browser Caso del navegador cuya lengua no es ninguna en los casos precedents default: $_SESSION["ch_langue"] = "en"; header ("http://www. myweb .com/web.php"); // require(DIR_WS_INCLUDES . 'header_tags.php'); break; } } //***************EOF Language Redirect******************************** In other hand I have a problem with one meta generated by Header tags Seo 3. <meta http-equiv="Content-Language" content="en" > This meta is suposed to be acordingly to the page content. Is refered to this code: if ($defaultTags['meta_language']) { $langName = explode(",", $_SERVER["HTTP_ACCEPT_LANGUAGE"]); echo ' <meta http-equiv="Content-Language" content="' . $langName[0] . '" >'."\n"; } This meta (en, es, or eu codes) only changes when the browser language of the customers is diferent. It dont change acording to the page language is intended to!!! :o Is this right??
-
KissMT Dynamic SEO Meta & Canonical Header Tags
bhbilbao replied to FWR Media's topic in General Add-Ons Support
OK. Thanks. I need a solution for the USU5 + HEADER TAGS SEO V.3 For that I started to use USU5 + HEADER TAGS SEO V.3 + KISS DINAMIC META TAGS Im thinking on change the header tags manager based on the language of the page (or maybe the browser language): But this fix dont work for me, if anyone could help me , i´ll be very apreciated: <!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN"> <html <?php echo HTML_PARAMS; ?>> <head> <?php // if ( $langue_user = "en" ) { // define tu lenguaje por defecto if ($_SESSION["ch_langue"] = "en") { require(DIR_WS_INCLUDES . 'header_tags.php'); } else { ?> require(DIR_WS_MODULES . 'kiss_meta_tags/kiss_meta_tags.php'); <?php } ?> -
KissMT Dynamic SEO Meta & Canonical Header Tags
bhbilbao replied to FWR Media's topic in General Add-Ons Support
Hi again Robert, i need help again. Ref: * Output the final meta tags */ public function output() { echo '<title>' . $this->title . '</title>' . PHP_EOL . '<meta name="description" content="' . $this->description . '"' . $this->html_end . PHP_EOL . '<meta name="keywords" content="' . $this->keywords . '"' . $this->html_end . PHP_EOL; $this->canonical(); } // end method This example is that I get: And this that I want: Im deleting header tags seo v.3 for static pages because the USU5 issue. Also I have an issue with the articles contribution(when creating the pseudo_tags), for that I use now this contribution. Is very , very EASY to install. But I dont know how to manage the code above. Where is the text I must modify?? what archive?? I looked and see add extra descriptions for categories and manufacturers, but what about ARTICLES contrib?? I dont want the extra description. This is the article_info.php inside Kissmt module (modified to take other fields): <?php final class KissMT_Module extends KissMT_Modules { private $article_query; protected $noindex_follow = array(); public function __construct() { $this->article_query = "SELECT articles_head_title_tag as name, articles_head_desc_tag as description FROM " . TABLE_ARTICLES_DESCRIPTION . " WHERE articles_id = :articles_id AND language_id = :languages_id LIMIT 1"; } // end constructor 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 ) ); } // end method } // End class ?> In other hands the breadcumb trail didnt worked for me: My archive working with Header Tags Seo3 and SPPC for products ..products_info.php: catalog/includes/classes/breadcrumb.php <?php /* $Id: breadcrumb.php 1739 2007-12-20 00:52:16Z hpdl $ */ class breadcrumb { var $_trail; function breadcrumb() { $this->reset(); } function reset() { $this->_trail = array(); } function add($title, $link = '') { $this->_trail[] = array('title' => $title, 'link' => $link); } function trail($separator = ' - ') { $trail_string = ''; for ($i=0, $n=sizeof($this->_trail); $i<$n; $i++) { if (isset($this->_trail[$i]['link']) && tep_not_null($this->_trail[$i]['link'])) { $trail_string .= '<a href="' . $this->_trail[$i]['link'] . '" class="headerNavigation">' . $this->_trail[$i]['title'] . '</a>'; } else { $trail_string .= $this->_trail[$i]['title']; } if (($i+1) < $n) $trail_string .= $separator; } return $trail_string; } } ?> Thanks in advance. -
No the page control panel is right. All the languages panel right. I inserted the info for the three languages but only works for english(default language). For example: ------------------------------------------ www. myweb .com/notebooks.php header tag:notebooks description tag:we sell notebooks .. bla .. bla keywords:notebooks canonical:www. myweb .com/notebooks.en In spanish bad: www. myweb .com/notebooks.php/es header tag: description tag: keywords: canonical:www. myweb .com/notebooks.php/es/es In german bad: www. myweb .com/notebooks.php/ge header tag: description tag: keywords: canonical:www. myweb .com/notebooks.php/ge/ge -------------------------------- In control panel all info is right. I dont know if problem here is with Header Tags V.3 or USU5 Pro. I asked Robert for it and said I I probably could problem with Header Tags. I also entered in phpmyadmin > tables > headertags modify languages 2 & 3 (spanish and german) as: 1 notebooks.php 2 notebooks.php/es 3 notebooks.php/ge But nothing. Where is the code i should looking for?? I created new pages duplicating info page shipping.php and modifying it (..new filename, ..new languaje file, etc). In Configuration > HeaderTags > Automatically add new pages. Then refressing the page, and look for folder includes/header_tags.php (chmod777) and see new line notebooks.php ref: // notebooks.php case (basename($_SERVER['PHP_SELF']) === FILENAME_NOTEBOOKS): $header_tags_array = tep_header_tag_page(FILENAME_NOTEBOOKS); break; Any suggestion??
-
I need some help or suggestion here: For the products_info.php pages all works fine. But creating any other page with multilanguage doesnt work. For example creating a page notebooks.php english(good): <head> <title>NOTEBOOKS | at best price !</title> <meta name="Description" content="Samsung Galaxy Tablet on sale, best price." > <meta name="Keywords" content="notebooks,Galaxy Tab,buy,sale,price,accessories,reviews" > <meta http-equiv="Content-Language" content="en" > <meta name="robots" content="noodp" > <meta name="slurp" content="noydir" > <link rel="canonical" href="http://www.www.myweb.com/notebooks.php" > <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" > spanish(bad): <head> <title>at best price !</title> <meta name="Description" content="on sale, best price." > <meta name="Keywords" content="buy,sale,price,accessories,reviews" > <meta http-equiv="Content-Language" content="en" > <meta name="robots" content="noodp" > <meta name="slurp" content="noydir" > <link rel="canonical" href="http://www.myweb.com/es/es" > <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" > All info of the other fields are empty and the canonical is also wrong (like myweb . com/es/es) ¿? Speaking with Robert Fisher "FWR" said me that the problem would be in the Header Tags contribution. I have USU5 PRO and Header Tags v.3, I dont know these are multilenguage compatibles.
-
The newsdesk_info.php works fine. If I write an article f.e "New notebooks on may" USU gives me a correct url: http://www. myweb .com /new-notebooks-may-n-8013.html But the index doesnt work, it goes to the index page. I remember worked fine with the previous USU versión (not PRO)
-
Thanks I will post in the Header Tags contrib. For the second problem it remains going to the index page. I have tried it in diferent ways: # Newsdesk contribution # RewriteRule ^(.*)-n-([0-9]+).html$ newsdesk_info.php?newsdesk_id=$2&%{QUERY_STRING} # RewriteRule ^(.*)-nc-([0-9]+).html$ newsdesk_index.php?newsPath=$2&%{QUERY_STRING} # RewriteRule ^(.*)-nri-([0-9]+).html$ newsdesk_reviews_info.php?newsdesk_id=$2&%{QUERY_STRING} # RewriteRule ^(.*)-nra-([0-9]+).html$ newsdesk_reviews_article.php?newsdesk_id=$2&%{QUERY_STRING} # RewriteRule ^([a-z0-9-/]+)-n-([0-9]+).html$ newsdesk_info.php [NC,L,QSA] # RewriteRule ^([a-z0-9-/]+)-nc-([0-9]+).html$ newsdesk_index.php [NC,L,QSA] # RewriteRule ^([a-z0-9-/]+)-nri-([0-9]+).html$ newsdesk_reviews_info.php [NC,L,QSA] # RewriteRule ^([a-z0-9-/]+)-nra-([0-9]+).html$ newsdesk_reviews_article.php [NC,L,QSA] RewriteRule ^([a-z0-9/-]+)-n-([0-9]+).html$ newsdesk_info.php [NC,L,QSA] # RewriteRule ^([a-z0-9/-]+)-nc-([0-9]+).html$ newsdesk_index.php [NC,L,QSA] RewriteRule ^([a-z0-9/-]+)-nri-([0-9]+).html$ newsdesk_reviews_info.php [NC,L,QSA] RewriteRule ^([a-z0-9/-]+)-nra-([0-9]+).html$ newsdesk_reviews_article.php [NC,L,QSA] # RewriteRule ^([a-z0-9\-\/]+)-nc-([0-9]+).html$ newsdesk_index.php [NC,L,QSA] RewriteRule ^([a-z0-9/-]+)-nc-([0-9]+).html$ newsdesk_index.php [NC,L,QSA] Should I modify some lines in catalog\includes\modules\ultimate_seo_urls5\page_modules\newsdesk_index.php ???
-
I have other problem with the .httaccess file: Options +SymLinksIfOwnerMatch <IfModule mod_rewrite.c> RewriteEngine On # RFI protection RewriteCond %{QUERY_STRING} ^.*=(ht|f)tp\://.*$ [NC] RewriteRule .* - [F,L] RewriteCond %{HTTP_HOST} ^myweb\.com [NC] RewriteRule ^(.*)$ http://www.myweb.com/$1 [R=301,L] # RewriteCond %{HTTPS} off # RewriteRule ^(.*)$ https://%{SERVER_NAME}%{REQUEST_URI} [R=301,L] ErrorDocument 404 http://www.myweb.com/404.html ErrorDocument 500 http://www.myweb.com/500.html RewriteBase / RewriteRule ^([a-z]+).html$ /index.php?$1 [R,L] RewriteRule ^([a-z0-9/-]+)-p-([0-9]+).html$ product_info.php [NC,L,QSA] RewriteRule ^([a-z0-9/-]+)-c-([0-9_]+).html$ index.php [NC,L,QSA] RewriteRule ^([a-z0-9/-]+)-m-([0-9]+).html$ index.php [NC,L,QSA] RewriteRule ^([a-z0-9/-]+)-pi-([0-9]+).html$ popup_image.php [NC,L,QSA] RewriteRule ^([a-z0-9/-]+)-pr-([0-9]+).html$ product_reviews.php [NC,L,QSA] RewriteRule ^([a-z0-9/-]+)-pri-([0-9]+).html$ product_reviews_info.php [NC,L,QSA] RewriteRule ^([a-z0-9/-]+)-t-([0-9_]+).html$ articles.php [NC,L,QSA] RewriteRule ^([a-z0-9/-]+)-au-([0-9]+).html$ articles.php [NC,L,QSA] RewriteRule ^([a-z0-9/-]+)-a-([0-9]+).html$ article_info.php [NC,L,QSA] RewriteRule ^([a-z0-9/-]+)-i-([0-9]+).html$ information.php [NC,L,QSA] RewriteRule ^([a-z0-9/-]+)-links-([0-9_]+).html$ links.php [NC,L,QSA] # Newsdesk contribution RewriteRule ^([a-z0-9/-]+)-n-([0-9]+).html$ newsdesk_info.php [NC,L,QSA] RewriteRule ^([a-z0-9/-]+)-nc-([0-9]+).html$ newsdesk_index.php [NC,L,QSA] # RewriteRule ^([a-z0-9\-\/]+)-p-([0-9]+).html$ newsdesk_index.php [NC,L,QSA] RewriteRule ^([a-z0-9/-]+)-nri-([0-9]+).html$ newsdesk_reviews_info.php [NC,L,QSA] RewriteRule ^([a-z0-9/-]+)-nra-([0-9]+).html$ newsdesk_reviews_article.php [NC,L,QSA] </IfModule> The problem here is the newsdesk_index.php file. When navigating to it, always goes to the index page. I dont know why the rewrite doesnt work for it. For example articles.php works fine and newsdesk_info.php also good.
-
Hi again Robert, I have similar problem like Biancoblue. For the products_info.php pages all works fine. But creating any other page with multilanguage doesnt work. For example creating a page notebooks.php english(good): <head> <title>NOTEBOOKS | at best price !</title> <meta name="Description" content="Samsung Galaxy Tablet on sale, best price." > <meta name="Keywords" content="notebooks,Galaxy Tab,buy,sale,price,accessories,reviews" > <meta http-equiv="Content-Language" content="en" > <meta name="robots" content="noodp" > <meta name="slurp" content="noydir" > <link rel="canonical" href="http://www.www.myweb.com/notebooks.php" > <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" > spanish(bad): <head> <title>at best price !</title> <meta name="Description" content="on sale, best price." > <meta name="Keywords" content="buy,sale,price,accessories,reviews" > <meta http-equiv="Content-Language" content="en" > <meta name="robots" content="noodp" > <meta name="slurp" content="noydir" > <link rel="canonical" href="http://www.myweb.com/es/es" > <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" > The languages seo urls only works here with the default language. I have HEADER TAGS installed. All info of the other fields are empty and the canonical is also wrong (like myweb . com/es/es) ¿?
-
http://addons.oscommerce.com/info/3713 I need to place a banner on product_info.php after products description. <td> <?php if ($banner = tep_banner_exists('dynamic', '468x50')) { ?> <?php echo tep_display_banner('static', $banner); ?></td> <?php } ?> </td> But nothing happens. If I place the code before include (DIR_WS_INCLUDES . 'products_next_previous.php'); the banner works fine. why??
-
Hi again Robert, working at 99%. I have an issue with one module. /includes/modules/sitemap_category.php I use it as SILO on column_left.php Entering in index.php > product_listing.php all goes right on the left side but the category links are incorrect. Link(incorrect): http://www. myweb .com/gpu-nvidia-pci-xpress-c-_53.html Link(should be): http://www. myweb .com/gpu-nvidia-pci-xpress-c-105_53.html I reseted the cache but nothing. The c_path are incorrect(..c-_53) why?
-
Hi Jan, i correct installed SPPC 4.2.2 on OSC 2.2RC2A My new problem is on integrate the price filter contribution with this. I readed your documentation and there is any info about this. http://addons.oscommerce.com/info/5572 This is my code in index.php (where I get error): // show the products of a specified manufacturer if (isset($HTTP_GET_VARS['manufacturers_id'])) { if (isset($HTTP_GET_VARS['filter_id']) && tep_not_null($HTTP_GET_VARS['filter_id'])) { // We are asked to show only a specific category if (isset($HTTP_GET_VARS['filter_price']) && tep_not_null($HTTP_GET_VARS['filter_price'])) { // We are asked to show only a specific price range $get_range = $HTTP_GET_VARS['filter_price']; // p.products_date_added to query for New Product Icon contribution // BOF Separate Pricing Per Customer if ($status_product_prices_table == true) { // changed for SPPC hide categories -- ok in mysql 5 $listing_sql = "select " . $select_column_list . " p.products_date_added, p.products_id, p.manufacturers_id, p.products_price, tmp_pp.products_price, p.products_msrp, p.products_tax_class_id, IF(tmp_pp.status, tmp_pp.specials_new_products_price, NULL) as specials_new_products_price, IF(tmp_pp.status, tmp_pp.specials_new_products_price, tmp_pp.products_price) as final_price from " . TABLE_PRODUCTS . " p left join " . $product_prices_table . " as tmp_pp using(products_id), " . TABLE_PRODUCTS_DESCRIPTION . " pd left join " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c using(products_id) left join " . TABLE_CATEGORIES . " c using(categories_id), " . TABLE_MANUFACTURERS . " m where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$HTTP_GET_VARS['filter_id'] . "' and " . $price_ranges_sql[$get_range] . "'"; } else { // either retail or no need to get correct special prices -- changed for mysql 5 and // $listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS_RETAIL_PRICES . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$HTTP_GET_VARS['filter_id'] . "'"; // SPPC hide categories for groups // $listing_sql = "select " . $select_column_list . " p.products_date_added, p.products_id, p.manufacturers_id, p.products_price, p.products_msrp, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS_RETAIL_PRICES . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c left join " . TABLE_CATEGORIES . " c using(categories_id) where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$HTTP_GET_VARS['filter_id'] . "' and " . $price_ranges_sql[$get_range] . "'"; // $listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$HTTP_GET_VARS['filter_id'] . "'"; $listing_sql = "select " . $select_column_list . " p.products_date_added, p.products_id, p.manufacturers_id, p.products_price, p.products_msrp, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS_RETAIL_PRICES . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$HTTP_GET_VARS['filter_id'] . "'"; } // end else { // either retail... // EOF Separate Pricing Per Customer } else { // We show them all if (isset($HTTP_GET_VARS['filter_price']) && tep_not_null($HTTP_GET_VARS['filter_price'])) { // We are asked to show only a specific price range $get_range = $HTTP_GET_VARS['filter_price']; // p.products_date_added to query for New Product Icon contribution // BOF Separate Pricing Per Customer if ($status_product_prices_table == true) { // $listing_sql = "select " . $select_column_list . " p.products_date_added, p.products_id, p.manufacturers_id, tmp_pp.products_price, p.products_msrp, p.products_tax_class_id, IF(tmp_pp.status, tmp_pp.specials_new_products_price, NULL) as specials_new_products_price, IF(tmp_pp.status, tmp_pp.specials_new_products_price, tmp_pp.products_price) as final_price from " . TABLE_PRODUCTS . " p left join " . $product_prices_table . " as tmp_pp using(products_id) left join " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c on p.products_id = p2c.products_id left join " . TABLE_CATEGORIES . " c using(categories_id), " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m where p.products_status = '1' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'"; $listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, tmp_pp.products_price, p.products_tax_class_id, IF(tmp_pp.status, tmp_pp.specials_new_products_price, NULL) as specials_new_products_price, IF(tmp_pp.status, tmp_pp.specials_new_products_price, tmp_pp.products_price) as final_price from " . TABLE_PRODUCTS . " p left join " . $product_prices_table . " as tmp_pp using(products_id), " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m where p.products_status = '1' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'"; } else { // either retail or no need to get correct special prices -- changed for mysql 5 & SPPC hide categories // $listing_sql = "select " . $select_column_list . " p.products_date_added, p.products_id, p.products_recent_sales, p.manufacturers_id, p.products_price, p.products_msrp, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_status = '1' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "' and p.products_id = p2c.products_id " . $new_products_where . " and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'"; // $listing_sql = "select " . $select_column_list . " p.products_date_added, p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS_RETAIL_PRICES . " s on p.products_id = s.products_id left join " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c on p.products_id = p2c.products_id left join " . TABLE_CATEGORIES . " c using(categories_id), " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m where p.products_status = '1' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'"; // $listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m where p.products_status = '1' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'"; $listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS_RETAIL_PRICES . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m where p.products_status = '1' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'"; } // end else { // either retail... // EOF Separate Pricing Per Customer } } else { // show the products in a given categorie // p.products_date_added to query for New Product Icon contribution if (isset($HTTP_GET_VARS['filter_id']) && tep_not_null($HTTP_GET_VARS['filter_id'])) { // We are asked to show only specific catgeory // BOF Separate Pricing Per Customer if ($status_product_prices_table == true) { // ok for mysql 5, SPPC hide categories for groups added if (isset($HTTP_GET_VARS['filter_price']) && tep_not_null($HTTP_GET_VARS['filter_price'])) { // We are asked to show only a specific price range $get_range = $HTTP_GET_VARS['filter_price']; // $listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['filter_id'] . "' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$current_category_id . "' and " . $price_ranges_sql[$get_range]; $listing_sql = "select " . $select_column_list . " p.products_date_added, p.products_id, p.manufacturers_id, p.products_price, tmp_pp.products_price, p.products_msrp, p.products_tax_class_id, IF(tmp_pp.status, tmp_pp.specials_new_products_price, NULL) as specials_new_products_price, IF(tmp_pp.status, tmp_pp.specials_new_products_price, tmp_pp.products_price) as final_price from " . TABLE_PRODUCTS . " p left join " . $product_prices_table . " as tmp_pp using(products_id), " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c left join " . TABLE_CATEGORIES . " c using(categories_id) where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['filter_id'] . "' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$current_category_id . "'"; } } else { // either retail or no need to get correct special prices -- ok for mysql 5 // $listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['filter_id'] . "' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$current_category_id . "'"; // $listing_sql = "select " . $select_column_list . " p.products_date_added, p.products_id, p.products_recent_sales, p.manufacturers_id, p.products_price, p.products_msrp, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['filter_id'] . "' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$current_category_id . "'" . $new_products_where . ""; // SPPC hide categories for groups added $listing_sql = "select " . $select_column_list . " p.products_date_added, p.products_id, p.manufacturers_id, p.products_price, p.products_msrp, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c left join " . TABLE_SPECIALS_RETAIL_PRICES . " s using(products_id) left join " . TABLE_CATEGORIES . " c on p2c.categories_id = c.categories_id where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['filter_id'] . "' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$current_category_id . "'"; } // end else { // either retail... // EOF Separate Pricing Per Customer } else { // We show them all // p.products_date_added to query for New Product Icon contribution // BOF Separate Pricing Per Customer --last query changed for mysql 5 compatibility if ($status_product_prices_table == true) { // ok in mysql 5 if (isset($HTTP_GET_VARS['filter_price']) && tep_not_null($HTTP_GET_VARS['filter_price'])) { // We are asked to show only a specific price range $get_range = $HTTP_GET_VARS['filter_price']; // original, no need to change for mysql 5 // SPPC hide categories for groups added // $listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_status = '1' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$current_category_id . "' and " . $price_ranges_sql[$get_range]; $listing_sql = "select " . $select_column_list . " p.products_date_added, p.products_id, p.manufacturers_id, p.products_price, tmp_pp.products_price, p.products_msrp, p.products_tax_class_id, IF(tmp_pp.status, tmp_pp.specials_new_products_price, NULL) as specials_new_products_price, IF(tmp_pp.status, tmp_pp.specials_new_products_price, tmp_pp.products_price) as final_price from " . TABLE_PRODUCTS_DESCRIPTION . " pd left join " . $product_prices_table . " as tmp_pp using(products_id), " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c left join " . TABLE_CATEGORIES . " c using(categories_id) where p.products_status = '1' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$current_category_id . "'"; } } else { // either retail or no need to get correct special prices -- changed for mysql 5 // $listing_sql = "select " . $select_column_list . " p.products_date_added, p.products_id, p.products_recent_sales, p.manufacturers_id, p.products_price, p.products_msrp, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_status = '1' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$current_category_id . "'" . $new_products_where . ""; // SPPC hide categories for groups added // $listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_status = '1' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$current_category_id . "'"; $listing_sql = "select " . $select_column_list . " p.products_date_added, p.products_id, p.manufacturers_id, p.products_price, p.products_msrp, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id left join " . TABLE_SPECIALS_RETAIL_PRICES . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c left join " . TABLE_CATEGORIES . " c using(categories_id) where p.products_status = '1' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$current_category_id . "'"; } // end else { // either retail... // EOF Separate Pricing per Customer } } } The problem are the continuos "If" estatements, and i dont kwow what could be the correct order and correct "}" closed tags. ref: or Thanks in advance.
-
Need this working urgent. It was working awesome good but after changing to a new server began to stop working. The admin side works well with Ajax. My problem is in product_info.php, there isn´t any product set. (All white) In product info there is only a stupid piece of code to change. if ((USE_CACHE == 'true') && empty($SID)) { echo tep_cache_also_purchased(3600); } else { include(DIR_WS_MODULES . FILENAME_ALSO_PURCHASED_PRODUCTS); } and replace it with: if ((USE_CACHE == 'true') && empty($SID)) { echo tep_cache_also_purchased(3600); } else { include(DIR_WS_MODULES . FILENAME_ALSO_PURCHASED_PRODUCTS); } include(DIR_WS_MODULES . FILENAME_PRODUCT_SETS); For that I think the problem is the module itself (/includes/modules/produtcs_set.php) I need this working because the family produtcs contrin only works with 2 tablebases.
-
Finally working again. I dont know but If I comment these lines all works. # rewritecond %{http_host} ^myweb .com [nc] # rewriterule ^(.*)$ http://www. myweb .com/$1 [r=301,nc]
-
I forgot to comment. With the googlesitemap/index.php and googlesitemap/sitemap.class.php of your last release didnt work in any maner (standard or alternative). I downloaded other archives, these are: index.php <?php /** * Google XML Sitemap Feed Cron Script * * The Google sitemap service was announced on 2 June 2005 and represents * a huge development in terms of crawler technology. This contribution is * designed to create the sitemap XML feed per the specification delineated * by Google. This cron script will call the code to create the scripts and * eliminate the session auto start issues. * @package Google-XML-Sitemap-Feed * @license http://opensource.org/licenses/gpl-license.php GNU Public License * @version 1.2 * @link http://www.oscommerce-freelancers.com/ osCommerce-Freelancers * @link http://www.google.com/webmasters/sitemaps/docs/en/about.html About Google Sitemap * @copyright Copyright 2005, Bobby Easland * @author Bobby Easland * @filesource */ chdir('../'); /** * Option to compress the files */ define('GOOGLE_SITEMAP_COMPRESS', 'false'); /** * Option for change frequency of products */ define('GOOGLE_SITEMAP_PROD_CHANGE_FREQ', 'weekly'); /** * Option for change frequency of categories */ define('GOOGLE_SITEMAP_CAT_CHANGE_FREQ', 'weekly'); /** * Carried over from application_top.php for compatibility */ define('GOOGLE_SITEMAP_MAN_CHANGE_FREQ', 'weekly'); /** * Carried over from application_top.php for compatibility */ define('GOOGLE_SITEMAP_SPECIALS_CHANGE_FREQ', 'weekly'); /** * Carried over from application_top.php for compatibility */ include_once 'includes/application_top.php'; require_once('googlesitemap/sitemap.class.php'); $google = new GoogleSitemap(DB_SERVER, DB_SERVER_USERNAME, DB_DATABASE, DB_SERVER_PASSWORD); $submit = true; echo '<pre>'; if ($google->GenerateProductSitemap()){ echo 'Generated Google Product Sitemap Successfully' . "\n\n"; } else { $submit = false; echo 'ERROR: Google Product Sitemap Generation FAILED!' . "\n\n"; } if ($google->GenerateCategorySitemap()){ echo 'Generated Google Category Sitemap Successfully' . "\n\n"; } else { $submit = false; echo 'ERROR: Google Category Sitemap Generation FAILED!' . "\n\n"; } $showManufacturers = true; if ($google->GenerateManufacturerSitemap()){ echo 'Generated Google Manufacturers Sitemap Successfully' . "\n\n"; } else { $manufacturers_query = tep_db_query("select manufacturers_id from " . TABLE_MANUFACTURERS . " limit 1"); if (tep_db_num_rows($manufacturers_query) > 0) { $submit = false; echo 'ERROR: Google Manufacturers Sitemap Generation FAILED!' . "\n\n"; } else { $showManufacturers = false; echo 'Google Sitemap Manufacturers not generated - no Manufacturers found!' . "\n\n"; } } $showSpecials = true; if ($google->GenerateSpecialsSitemap()){ echo 'Generated Google Specials Sitemap Successfully' . "\n\n"; } else { $specials_query = tep_db_query("select p.products_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_SPECIALS . " s where p.products_status = '1' and p.products_id = s.products_id and pd.products_id = s.products_id and pd.language_id = '" . (int)$languages_id . "' and s.status = '1' limit 1"); if (tep_db_num_rows($specials_query) > 0) { $submit = false; echo 'ERROR: Google Specials Sitemap Generation FAILED!' . "\n\n"; } else { $showSpecials = false; echo 'Google Sitemap Specials not generated - no specials found!' . "\n\n"; } } if ($google->GenerateSitemapIndex()){ echo 'Generated Google Sitemap Index Successfully' . "\n\n"; } else { $submit = false; echo 'ERROR: Google Sitemap Index Generation FAILED!' . "\n\n"; } if ($submit){ echo 'CONGRATULATIONS! All files generated successfully.' . "\n\n"; echo 'If you have not already submitted the sitemap index to Google click the link below.' . "\n"; echo 'Before you do I HIGHLY recommend that you view the XML files to make sure the data is correct.' . "\n\n"; echo $google->GenerateSubmitURL() . "\n\n"; echo 'For your convenience here is the CRON command for your site:' . "\n"; echo 'php ' . dirname($_SERVER['SCRIPT_FILENAME']) . '/index.php' . "\n\n"; echo 'Here is your sitemap index: ' . $google->base_url . 'sitemapindex.xml' . "\n"; echo 'Here is your product sitemap: ' . $google->base_url . 'sitemapproducts.xml' . "\n"; echo 'Here is your category sitemap: ' . $google->base_url . 'sitemapcategories.xml' . "\n"; if ($showManufacturers) echo 'Here is your manufacturers sitemap: ' . $google->base_url . 'sitemapmanufacturers.xml' . "\n"; if ($showSpecials) echo 'Here is your specials sitemap: ' . $google->base_url . 'sitemapspecials.xml' . "\n"; } else { print_r($google->debug); } echo '</pre>'; include_once 'includes/application_top.php'; ?> and sitemap.class.php: <?php /** * Google XML Sitemap Feed * * The Google sitemap service was announced on 2 June 2005 and represents * a huge development in terms of crawler technology. This contribution is * designed to create the sitemap XML feed per the specification delineated * by Google. * @package Google-XML-Sitemap-Feed * @license http://opensource.org/licenses/gpl-license.php GNU Public License * @version 1.0 * @link http://www.oscommerce-freelancers.com/ osCommerce-Freelancers * @link http://www.google.com/webmasters/sitemaps/docs/en/about.html About Google Sitemap * @copyright Copyright 2005, Bobby Easland * @author Bobby Easland * @filesource */ /** * MySQL_Database Class * * The MySQL_Database class provides abstraction so the databaes can be accessed * without having to use tep API functions. This class has minimal error handling * so make sure your code is tight! * @package Google-XML-Sitemap-Feed * @license http://opensource.org/licenses/gpl-license.php GNU Public License * @version 1.1 * @link http://www.oscommerce-freelancers.com/ osCommerce-Freelancers * @copyright Copyright 2005, Bobby Easland * @author Bobby Easland */ /** * Google Sitemap Base Class * * The MySQL_Database class provides abstraction so the databaes can be accessed * @package Google-XML-Sitemap-Feed * @license http://opensource.org/licenses/gpl-license.php GNU Public License * @version 1.2 * @link http://www.oscommerce-freelancers.com/ osCommerce-Freelancers * @link http://www.google.com/webmasters/sitemaps/docs/en/about.html About Google Sitemap * @copyright Copyright 2005, Bobby Easland * @author Bobby Easland */ class GoogleSitemap{ /** * $filename is the base name of the feeds (i.e. - 'sitemap') * @var string */ var $filename; /** * $savepath is the path where the feeds will be saved - store root * @var string */ var $savepath; /** * $base_url is the URL for the catalog * @var string */ var $base_url; /** * $debug holds all the debug data * @var array */ var $debug; /** * GoogleSitemap class constructor * @author Bobby Easland * @version 1.0 * @param string $host Database host setting (i.e. - localhost) * @param string $user Database user * @param string $db Database name * @param string $pass Database password */ function GoogleSitemap(){ $this->filename = "sitemap"; $this->savepath = DIR_FS_CATALOG; $this->base_url = HTTP_SERVER . DIR_WS_HTTP_CATALOG; $this->debug = array(); } # end class constructor /** * Function to save the sitemap data to file as either XML or XML.GZ format * @author Bobby Easland * @version 1.1 * @param string $data XML data * @param string $type Feed type (index, products, categories) * @return boolean */ function SaveFile($data, $type){ $filename = $this->savepath . $this->filename . $type; $compress = defined('GOOGLE_SITEMAP_COMPRESS') ? GOOGLE_SITEMAP_COMPRESS : 'false'; if ($type == 'index') $compress = 'false'; switch($compress){ case 'true': $filename .= '.xml.gz'; if ($gz = gzopen($filename,'wb9')){ gzwrite($gz, $data); gzclose($gz); $this->debug['SAVE_FILE_COMPRESS'][] = array('file' => $filename, 'status' => 'success', 'file_exists' => 'true'); return true; } else { $file_check = file_exists($filename) ? 'true' : 'false'; $this->debug['SAVE_FILE_COMPRESS'][] = array('file' => $filename, 'status' => 'failure', 'file_exists' => $file_check); return false; } break; default: $filename .= '.xml'; if ($fp = fopen($filename, 'w+')){ echo 'Write '.$filename.'<br>'; fwrite($fp, $data); fclose($fp); $this->debug['SAVE_FILE_XML'][] = array('file' => $filename, 'status' => 'success', 'file_exists' => 'true'); return true; } else { $file_check = file_exists($filename) ? 'true' : 'false'; $this->debug['SAVE_FILE_XML'][] = array('file' => $filename, 'status' => 'failure', 'file_exists' => $file_check); return false; } break; } # end switch } # end function /** * Function to compress a normal file * @author Bobby Easland * @version 1.0 * @param string $file * @return boolean */ function CompressFile($file){ $source = $this->savepath . $file . '.xml'; $filename = $this->savepath . $file . '.xml.gz'; $error_encountered = false; if( $gz_out = gzopen($filename, 'wb9') ){ if($fp_in = fopen($source,'rb')){ while(!feof($fp_in)) gzwrite($gz_out, fread($fp_in, 1024*512)); fclose($fp_in); } else { $error_encountered = true; } gzclose($gz_out); } else { $error_encountered = true; } if($error_encountered){ return false; } else { return true; } } # end function /** * Function to generate sitemap file from data * @author Bobby Easland * @version 1.0 * @param array $data * @param string $file * @return boolean */ function GenerateSitemap($data, $file){ $content = '<?xml version="1.0" encoding="UTF-8"?>' . "\n"; $content = '<?xml-stylesheet type="text/xsl" href="gss.xsl"?>' . "\n"; $content .= '<urlset xmlns="http://www.google.com/schemas/sitemap/0.84">' . "\n"; foreach ($data as $url){ $content .= "\t" . '<url>' . "\n"; $content .= "\t\t" . '<loc>'.$url['loc'].'</loc>' . "\n"; $content .= "\t\t" . '<lastmod>'.$url['lastmod'].'</lastmod>' . "\n"; $content .= "\t\t" . '<changefreq>'.$url['changefreq'].'</changefreq>' . "\n"; $content .= "\t\t" . '<priority>'.$url['priority'].'</priority>' . "\n"; $content .= "\t" . '</url>' . "\n"; } # end foreach $content .= '</urlset>'; return $this->SaveFile($content, $file); } # end function /** * Function to generate sitemap index file * @author Bobby Easland * @version 1.1 * @return boolean */ function GenerateSitemapIndex(){ $content = '<?xml version="1.0" encoding="UTF-8"?>' . "\n"; $content = '<?xml-stylesheet type="text/xsl" href="gss.xsl"?>' . "\n"; //human readable $content .= '<sitemapindex xmlns="http://www.google.com/schemas/sitemap/0.84">' . "\n"; $pattern = defined('GOOGLE_SITEMAP_COMPRESS') ? GOOGLE_SITEMAP_COMPRESS == 'true' ? "{sitemap*.xml.gz}" : "{sitemap*.xml}" : "{sitemap*.xml}"; foreach ( glob($this->savepath . $pattern, GLOB_BRACE) as $filename ) { if ( eregi('index', $filename) ) continue; $content .= "\t" . '<sitemap>' . "\n"; $content .= "\t\t" . '<loc>'.$this->base_url . basename($filename).'</loc>' . "\n"; $content .= "\t\t" . '<lastmod>'.date ("Y-m-d", filemtime($filename)).'</lastmod>' . "\n"; $content .= "\t" . '</sitemap>' . "\n"; } # end foreach $content .= '</sitemapindex>'; return $this->SaveFile($content, 'index'); } # end function /** * Function to generate product sitemap data * @author Bobby Easland * @version 1.1 * @return boolean */ function GenerateProductSitemap(){ $sql = "SELECT products_id as pID, products_date_added as date_added, products_last_modified as last_mod, products_ordered FROM " . TABLE_PRODUCTS . " WHERE products_status='1' ORDER BY products_ordered DESC"; if ( $products_query = tep_db_query($sql) ){ $this->debug['QUERY']['PRODUCTS']['STATUS'] = 'success'; $this->debug['QUERY']['PRODUCTS']['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 = tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $result['pID'], 'NONSSL', false); $lastmod = tep_not_null($result['last_mod']) ? $result['last_mod'] : $result['date_added']; $changefreq = GOOGLE_SITEMAP_PROD_CHANGE_FREQ; $ratio = $top > 0 ? $result['products_ordered']/$top : 0; $priority = $ratio < .1 ? .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 ? 'products' : 'products' . $number; $this->GenerateSitemap($container, $type); $container = array(); $number++; } } # end while tep_db_free_result($products_query); if ( sizeof($container) > 1 ) { $type = $number == 0 ? 'products' : 'products' . $number; return $this->GenerateSitemap($container, $type); } # end if } else { $this->debug['QUERY']['PRODUCTS']['STATUS'] = 'false'; $this->debug['QUERY']['PRODUCTS']['NUM_ROWS'] = '0'; } } # end function /** * Funciton to generate category sitemap data * @author Bobby Easland * @version 1.1 * @return boolean */ function GenerateCategorySitemap(){ $sql = "SELECT categories_id as cID, date_added, last_modified as last_mod FROM " . TABLE_CATEGORIES . " ORDER BY parent_id ASC, sort_order ASC, categories_id ASC"; if ( $categories_query = tep_db_query($sql) ){ $this->debug['QUERY']['CATEOGRY']['STATUS'] = 'success'; $this->debug['QUERY']['CATEOGRY']['NUM_ROWS'] = tep_db_num_rows($categories_query); $container = array(); $number = 0; while( $result = tep_db_fetch_array($categories_query) ){ $location =tep_href_link(FILENAME_DEFAULT, 'cPath=' . $this->GetFullcPath($result['cID']), 'NONSSL', false); $lastmod = tep_not_null($result['last_mod']) ? $result['last_mod'] : $result['date_added']; $changefreq = GOOGLE_SITEMAP_CAT_CHANGE_FREQ; $priority = .5; $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 ? 'categories' : 'categories' . $number; $this->GenerateSitemap($container, $type); $container = array(); $number++; } } # end while tep_db_free_result($categories_query); if ( sizeof($container) > 1 ) { $type = $number == 0 ? 'categories' : 'categories' . $number; return $this->GenerateSitemap($container, $type); } # end if } else { $this->debug['QUERY']['CATEOGRY']['STATUS'] = 'false'; $this->debug['QUERY']['CATEOGRY']['NUM_ROWS'] = '0'; } } # end function /** * Funciton to generate manufacturer sitemap data * @author Jack_mcs from Bobbys code * @version 1.1 * @return boolean */ function GenerateManufacturerSitemap(){ $sql = "SELECT manufacturers_id as mID, date_added, last_modified as last_mod, manufacturers_name FROM " . TABLE_MANUFACTURERS . " order by manufacturers_name DESC"; if ( $manufacturers_query = tep_db_query($sql) ){ $this->debug['QUERY']['MANUFACTURERS']['STATUS'] = 'success'; $this->debug['QUERY']['MANUFACTURERS']['NUM_ROWS'] = tep_db_num_rows($manufacturers_query); $container = array(); $number = 0; while( $result = tep_db_fetch_array($manufacturers_query) ){ $location = tep_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $result['mID'], 'NONSSL', false); $lastmod = tep_not_null($result['last_mod']) ? $result['last_mod'] : $result['date_added']; $changefreq = GOOGLE_SITEMAP_MAN_CHANGE_FREQ; $priority = .5; $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 ? 'manufacturers' : 'manufacturers' . $number; $this->GenerateSitemap($container, $type); $container = array(); $number++; } } # end while tep_db_free_result($manufacturers_query); if ( sizeof($container) > 1 ) { $type = $number == 0 ? 'manufacturers' : 'manufacturers' . $number; return $this->GenerateSitemap($container, $type); } # end if } else { $this->debug['QUERY']['MANUFACTURERS']['STATUS'] = 'false'; $this->debug['QUERY']['MANUFACTURERS']['NUM_ROWS'] = '0'; } } # end function /** * Funciton to generate manufacturer sitemap data * @author Jack_mcs from Bobbys code * @version 1.1 * @return boolean */ function GenerateSpecialsSitemap(){ $sql = "SELECT p.products_id as pID, s.specials_date_added as date_added, s.specials_last_modified as last_mod, p.products_ordered 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 where p.products_status = '1' and s.status = '1' order by s.specials_date_added desc "; if ( $products_query = tep_db_query($sql) ){ $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 = tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $result['pID'], 'NONSSL', false); $lastmod = tep_not_null($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 < .1 ? .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++; } } # end while tep_db_free_result($products_query); if ( sizeof($container) > 1 ) { $type = $number == 0 ? 'specials' : 'specials' . $number; return $this->GenerateSitemap($container, $type); } # end if } else { $this->debug['QUERY']['SPECIALS']['STATUS'] = 'false'; $this->debug['QUERY']['SPECIALS']['NUM_ROWS'] = '0'; } } # end function /** * Function to retrieve full cPath from category ID * @author Bobby Easland * @version 1.0 * @param mixed $cID Could contain cPath or single category_id * @return string Full cPath string */ function GetFullcPath($cID){ if ( ereg('_', $cID) ){ return $cID; } else { $c = array(); $this->GetParentCategories($c, $cID); $c = array_reverse($c); $c[] = $cID; $cID = sizeof($c) > 1 ? implode('_', $c) : $cID; return $cID; } } # end function /** * Recursion function to retrieve parent categories from category ID * @author Bobby Easland * @version 1.0 * @param mixed $categories Passed by reference * @param integer $categories_id */ function GetParentCategories(&$categories, $categories_id) { $sql = "SELECT parent_id FROM " . TABLE_CATEGORIES . " WHERE categories_id='" . (int)$categories_id . "'"; $parent_categories_query = tep_db_query($sql); while ($parent_categories = tep_db_fetch_array($parent_categories_query)) { if ($parent_categories['parent_id'] == 0) return true; $categories[sizeof($categories)] = $parent_categories['parent_id']; if ($parent_categories['parent_id'] != $categories_id) { $this->GetParentCategories($categories, $parent_categories['parent_id']); } } } # end function /** * Utility function to read and return the contents of a GZ formatted file * @author Bobby Easland * @version 1.0 * @param string $file File to open * @return string */ function ReadGZ( $file ){ $file = $this->savepath . $file; $lines = gzfile($file); return implode('', $lines); } # end function /** * Utility function to generate the submit URL * @author Bobby Easland * @version 1.0 * @return string */ function GenerateSubmitURL(){ $url = urlencode($this->base_url . 'sitemapindex.xml'); return htmlspecialchars(utf8_encode('http://www.google.com/webmasters/sitemaps/ping?sitemap=' . $url)); } # end function } # end class ?>
-
This is my configuration for Google XML SEO Then i go to: http://www. myweb .com/googlesitemap/index.php I use mozilla, it stays about 10seconds loading the script and then a white page. For that I do a sql query (I have more than 50000products): DELETE FROM products WHERE products_id > '17203'; DELETE FROM products WHERE products_id = '0'; DELETE FROM products_description WHERE products_id > '17203'; DELETE FROM products_description WHERE language_id = '0'; DELETE FROM products_to_categories WHERE products_id > '17203'; It generates the file: 2,00 MB (2.097.421 bytes) but opening the file I see there is not url info (empty) <loc>*here is nothing*</loc> For that I remove more products, all categories, and disable&delete the specials, manufacturers and 1 categories : DELETE FROM products WHERE products_id > '8000'; DELETE FROM products WHERE products_id = '0'; DELETE FROM products_description WHERE products_id > '8000'; DELETE FROM products_description WHERE language_id = '0'; DELETE FROM products_to_categories WHERE products_id > '8000'; but again there is not information inside <loc></loc> this is the log: Im generating the sitemaps on blocks of 10000products(+ - by supplier) and then modifing the sitemapindex.xml adding the different blocks. Sometimes works fine and I dont know why or where is the problem. Also see in the log: [CATEOGRY] what are the requirements to generate the products sitemaps? I also have HeaderTagasSeo contrib and Robert´s USU5 PRO.
-
I changed to a new and powerfull server. Th first time I used again /with the standar products that comes with osc, all right). After adding about 50000products I get this: sitemapproducts.xml <url> <loc></loc> <lastmod>2011-01-12</lastmod> <changefreq>weekly</changefreq> <priority>1.0</priority> </url> All <locs> with empty url.