Flinspach Posted September 12, 2013 Share Posted September 12, 2013 (edited) Hi, I installed the addon # 7704 SEO URL's 5 Pro r205on a osc 2.3.3 shop : worked perfect ! I updated from 2.3.3 to 2.3.3.1 : worked perfect ! I updated from 2.3.3.1 to 2.3.3.2 and got these errors : Warning: mysqli_real_escape_string() expects parameter 1 to be mysqli, null given in ../catalog/includes/functions/database.php on line 129 Warning: mysqli_query() expects parameter 1 to be mysqli, null given in ../catalog/includes/functions/database.php on line 42 INSERT INTO `usu_cache` (cache_name, cache_data, cache_date) VALUES ('', '', '2013-09-12 11:50:12') With SEO URL's 5 Pro r205 disabled the errors disappear, with this addon enabled the errors occur. Any ideas ? Martin Edited September 12, 2013 by Flinspach Quote Link to comment Share on other sites More sharing options...
Flinspach Posted September 12, 2013 Share Posted September 12, 2013 (edited) Hi, problem probably solved after setting the cache system to sqlite. Martin Edited September 12, 2013 by Flinspach Quote Link to comment Share on other sites More sharing options...
tgely Posted September 12, 2013 Share Posted September 12, 2013 (edited) I found temporary sql cache problem with ULTIMATE Seo Urls 5 PRO. The problem was similar than this issue. TEP STOP with INSERT INTO `usu_cache` (`cache_name`, `cache_data`, `cache_date`) VALUES('', '', '2013-09-12 16:34:10') Solution: 0. run as sql command: INSERT INTO `usu_cache` (cache_name, cache_data, cache_date) VALUES ('', '', '2013-09-12 17:29:05') at phpMyAdmin 1. reinstall old database.php where was no problem. 2. run website 3. copy new database.php with mysqli interface. 4. run website But if you reset the cache the problem will be appear again. Edited September 12, 2013 by Gergely Quote osCommerce based shop owner with minimal design and focused on background works. When the less is more.Email managment with tracking pixel, package managment for shipping, stock management, warehouse managment with bar code reader, parcel shops management on 3000 pickup points without local store. Link to comment Share on other sites More sharing options...
tgely Posted September 12, 2013 Share Posted September 12, 2013 (edited) Temporary fix for mysql cache when updates to v2.3.3.2 with tep_db_connect(); cache_system\mysql.php find: public function store( array $registry_vars = array() ) { if ( false !== self::$cache_on ) { if ( false !== $this->insert ) { $data = serialize( $registry_vars ); // Serialize the registry of data $rawdata = base64_encode( gzdeflate( $data ) ); // encode and deflate $targets = array( ':cache_name', ':cache_data', ':cache_date' ); $replacements = array( tep_db_input( self::$cache_name ), tep_db_input( $rawdata ), date( "Y-m-d H:i:s" ) ); $query = str_replace( $targets, $replacements, $this->insert_query ); Usu_Main::i()->query( $query ); } } } change: public function store( array $registry_vars = array() ) { tep_db_connect(); if ( false !== self::$cache_on ) { if ( false !== $this->insert ) { $data = serialize( $registry_vars ); // Serialize the registry of data $rawdata = base64_encode( gzdeflate( $data ) ); // encode and deflate $targets = array( ':cache_name', ':cache_data', ':cache_date' ); $replacements = array( tep_db_input( self::$cache_name ), tep_db_input( $rawdata ), date( "Y-m-d H:i:s" ) ); $query = str_replace( $targets, $replacements, $this->insert_query ); Usu_Main::i()->query( $query ); } } } Edited September 12, 2013 by Gergely Psytanium 1 Quote osCommerce based shop owner with minimal design and focused on background works. When the less is more.Email managment with tracking pixel, package managment for shipping, stock management, warehouse managment with bar code reader, parcel shops management on 3000 pickup points without local store. Link to comment Share on other sites More sharing options...
RWork Posted September 13, 2013 Share Posted September 13, 2013 More issues with Ultimate Seo Urls 5 pro since updating from version 2.3.3.1 to version 2.3.3.2 cache to mysql gave errors and also 404 redirect messages (from removed product) are giving an error: Warning: Invalid argument supplied for foreach() in /home/xxxxxxx/public_html/includes/modules/ultimate_seo_urls5/page_modules/product_info.php on line 102 Catchable fatal error: Argument 1 passed to aPage_Modules::linkText() must be an array, null given, called in /home/xxxxxxx/public_html/includes/modules/ultimate_seo_urls5/page_modules/product_info.php on line 170 and defined in /home/xxxxxxx/public_html/includes/modules/ultimate_seo_urls5/abstracts/page_modules.php on line 338. Maybe there are more issues with this contribution not noticed yet. Any solutions?? Quote Link to comment Share on other sites More sharing options...
tgely Posted September 13, 2013 Share Posted September 13, 2013 @@RWork Probably you have got this error by other modifications. Could you post here the /home/xxxxxxx/public_html/includes/modules/ultimate_seo_urls5/page_modules/product_info.php? Quote osCommerce based shop owner with minimal design and focused on background works. When the less is more.Email managment with tracking pixel, package managment for shipping, stock management, warehouse managment with bar code reader, parcel shops management on 3000 pickup points without local store. Link to comment Share on other sites More sharing options...
Peper Posted September 13, 2013 Share Posted September 13, 2013 Some fine tuning consideration to help with seo Taken from Google advice for description tag = <meta name="Description" content="Author: A.N. Author, Illustrator: P. Picture, Category: Books, Price: $17.99, Length: 784 pages"> How to get similar output for products using header_tags.php file - echo ' <meta name="Description" content="' . $header_tags_array['desc'] . '" >' . "\n"; Maybe to include price or so? Any advice Quote Getting the Phoenix off the ground Link to comment Share on other sites More sharing options...
RWork Posted September 13, 2013 Share Posted September 13, 2013 @@Gergely Quote Link to comment Share on other sites More sharing options...
RWork Posted September 13, 2013 Share Posted September 13, 2013 @ gergely for testing i did a fresh install of the 2.3.3.2 and installed ultimate seo urls 5 on it, wich gives the same errors. u can initiate the error by changing eg: samsung-galaxy-tab-p-28.html to samsung-galaxy-tab-p-280.html (wich must give an 404 error message) i post my /home/xxxxxxx/public_html/includes/modules/ultimate_seo_urls5/page_modules/product_info.php here: <?php /** * * ULTIMATE Seo Urls 5 PRO ( version 1.1 ) * * * @package USU5_PRO * @@licensed2kill http://www.opensource.org/licenses/gpl-2.0.php GNU Public License * @@Link http://www.fwrmedia.co.uk * @@copyright Copyright 2008-2009 FWR Media * @@copyright Portions Copyright 2005 ( rewrite uri concept ) Bobby Easland * @@author Robert Fisher, FWR Media, http://www.fwrmedia.co.uk * @lastdev $Author:: Rob $: Author of last commit * @lastmod $Date:: 2011-01-26 15:27:34 +0000 (Wed, 26 Jan 2011) $: Date of last commit * @version $Rev:: 199 $: Revision of last commit * @Id $Id:: product_info.php 199 2011-01-26 15:27:34Z Rob $: Full Details */ /** * Page module for product_info * * @package USU5_PRO */ class Product_Info_Page_Module extends aPage_Modules { private static $_singleton = null; /** * Array of _GET key dependencies for this page * - marker is the seo url replacement for the _GET key ( e.g. -c-1 replaces cPath=1 ) * - query is the query used to extract the link text from the database * - to_replace is an array of texts that are to be replace with real values in the query * * @var array $dependencies */ protected $dependencies = array( 'products_id' => array( 'marker' => '-p-', 'query' => "SELECT pd.products_name, m.manufacturers_name, cd.categories_name, p.products_model, p2c.categories_id FROM :TABLE_PRODUCTS_DESCRIPTION pd INNER JOIN :TABLE_PRODUCTS_TO_CATEGORIES p2c ON p2c.products_id = pd.products_id INNER JOIN :TABLE_PRODUCTS p ON pd.products_id = p.products_id LEFT JOIN :TABLE_MANUFACTURERS m ON m.manufacturers_id = p.manufacturers_id INNER JOIN :TABLE_CATEGORIES_DESCRIPTION cd ON p2c.categories_id = cd.categories_id AND cd.language_id=':languages_id' WHERE pd.products_id=':pid' AND pd.language_id=':languages_id' LIMIT 1", 'to_replace' => array( ':TABLE_PRODUCTS_DESCRIPTION', ':TABLE_PRODUCTS_TO_CATEGORIES', ':TABLE_PRODUCTS', ':TABLE_MANUFACTURERS', ':TABLE_CATEGORIES_DESCRIPTION', ':languages_id', ':pid' ) ) ); /** * The current dependency key extracted from the incoming parameters * * @var string $key - dependency key */ protected $key = null; /** * extracts the key => value pairs from the querystring in order to build a unique cache name for the loaded page * * @var array $cache_name_builder */ protected $cache_name_builder = array( 'products_id' => 1, 'page' => 1 ); /** * Class constructor * @access private */ private function __construct() { } // end constructor /** * Returns a singleton instance of this object * * @access public * @return Product_Info_Page_Module */ public static function i() { if ( !self::$_singleton instanceof self ) { self::$_singleton = new self; } return self::$_singleton; } // end method /** * Retrieve the dependencies array for this page module * * @access public * @return array $dependencies */ public function retrieveDependencies() { return $this->dependencies; } /** * 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; } /** * The main method of this class that receives input needed to build a link * then finally returns a fully built seo link if it has not previousluy returned false. * * @see Usu_Main::getVar() * @see Usu_Main::setVar() * @see aPage_Modules::stripPathToLastNumber() * @see aPage_Modules::setQuery() * @see aPage_Modules::unsetProperties() * @see aPage_Modules::getDependencyKey() * @see aPage_Modules::setAllParams() * @see aPage_Modules::validRequest() * @see aPage_Modules::returnFinalLink() * @param string $page - valid osCommerce page name * @param string $parameters - querystring parameters * @param bool $add_session_id - true / false * @param string $connection - NONSSL / SSL * @param array $extract - array of _GET keys to remove from the querystring or bool false to do nothing * @uses trigger_error() * @throws - triggers an error of type E_USER_WARNING for an incorrect or inexistant dependency key * @access public * @return bool false - forces the system to return the standard osCommerce link wrapper * @return string - fully built seo url */ public function buildLink( $page, $parameters, $add_session_id, $connection ) { $extract = ( defined( 'USU5_ADD_CPATH_TO_PRODUCT_URLS' ) && ( USU5_ADD_CPATH_TO_PRODUCT_URLS == 'false' ) ) ? array( 'cPath', 'manufacturers_id' ) : array( 'manufacturers_id' ); $this->setAllParams( $page, $parameters, $add_session_id, $connection, $extract ); if ( false === $this->validRequest() ) { return false; } $this->key = $this->getDependencyKey(); /** * If the shop has issues it may pass in null values, in this case return false to force the standard osCommerce link wrapper */ if ( !array_key_exists( $this->key, $this->keys_index ) || !tep_not_null( $this->keys_index[$this->key] ) ) { return false; } // Switch statement where the correct query and query marker replacements to use are selected via the _GET key detected switch ( true ) { case $this->key == 'products_id': // This array contains replacements for the to_replace array $this->setQuery( array( TABLE_PRODUCTS_DESCRIPTION, TABLE_PRODUCTS_TO_CATEGORIES, TABLE_PRODUCTS, TABLE_MANUFACTURERS, TABLE_CATEGORIES_DESCRIPTION, Usu_Main::i()->getVar( 'languages_id' ), $this->keys_index[$this->key] ) ); break; default: trigger_error( __CLASS__ . '::' . __FUNCTION__ . ' Incorrect or inexistant dependency key.', E_USER_WARNING ); break; } // end switch $link_text = $this->acquireLinkText(); // If the query returned no results then we return false forcing the use of the standard osCommerce link wrapper Usu_Main::i()->setVar( 'page_not_found', false ); if ( false === $link_text ) { Usu_Main::i()->setVar( 'page_not_found', true ); $this->unsetProperties(); return; } return $this->returnFinalLink( Usu_Main::i() ->getVar( 'uri_modules', USU5_URLS_TYPE ) ->createLinkString( $this->page, Usu_Main::i() ->getVar( 'uri_modules', USU5_URLS_TYPE ) ->separateUriText( $this->linktext( $this->linkTextOrder( $link_text ) ) ), $this->dependencies[$this->key]['marker'], $this->keys_index[$this->key] ) ); } // end method /** * Like text options offered by b,c,m,p * * Builds the link text based on the settings chosen in admin .. products name must be present or the script adds it regardless. * * @uses array_key_exists() * @uses stripos() * @uses str_split() * @uses array_flip() * @uses array_intersect_key() * @uses count() * @param array $details - link text key=>value pairs * * @access private * @return array $to_seperate - array of link text options in the correct order */ private function linkTextOrder( array $details = array() ) { $text_types = array( 'p' => $details['products_name'], 'c' => $details['categories_name'], 'm' => $details['products_model'] ); // manufacturers_name is gained through a left join and may not exist array_key_exists( 'manufacturers_name', $details ) ? $text_types['b'] = $details['manufacturers_name'] : null; // Products name MUST be present, if not we force it to the end if ( false === stripos( USU5_PRODUCTS_LINK_TEXT_ORDER, 'p' ) ) { $admin_order = str_split( USU5_PRODUCTS_LINK_TEXT_ORDER . 'p' ); } else $admin_order = str_split( USU5_PRODUCTS_LINK_TEXT_ORDER ); // Split the string value entered in admin ( like mcp etc ) to an array $text_order = array_flip( $admin_order ); // Flip key => value to value => key $text_to_format = array_intersect_key( $text_types, $text_order ); // return only those key => value pairs that match the admin selection $link_text_count = count( $admin_order ); $ordered_array = array(); for ( $i=0; $i<$link_text_count; $i++ ) { if ( ( array_key_exists( $admin_order[$i], $text_to_format ) && tep_not_null( $text_to_format[$admin_order[$i]] ) ) ) { // If a value is empty then we don't want to add it to the link text $to_seperate[] = $text_to_format[$admin_order[$i]]; // Create an array where the link text is in the same order as the admin selection } } return $to_seperate; } // End method } // end class Quote Link to comment Share on other sites More sharing options...
Tiff13 Posted September 14, 2013 Share Posted September 14, 2013 (edited) Hi @@newburns Did you ever get an answer to this? I'm getting the same error - it's very annoying. Thanks and let me know. Tiffany I just had an error. Any idea? PHP Fatal error: Call to a member function store() on a non-object in /catalog/includes/modules/ultimate_seo_urls5/main/usu5.php on line 78 Edited September 14, 2013 by epwork Quote Link to comment Share on other sites More sharing options...
tgely Posted September 14, 2013 Share Posted September 14, 2013 @@epwork @@RWork Thanks for the break point. I am debugging. Quote osCommerce based shop owner with minimal design and focused on background works. When the less is more.Email managment with tracking pixel, package managment for shipping, stock management, warehouse managment with bar code reader, parcel shops management on 3000 pickup points without local store. Link to comment Share on other sites More sharing options...
tgely Posted September 14, 2013 Share Posted September 14, 2013 (edited) Temporary fix for 404 page handler after v2.3.3.2 updates page_modules/product_info.php (about in 98 line) change: if ( false === $text_array ) { to: if ( is_Null($text_array) || false === $text_array ) { I see that mySqli_query gives back different returns by queries so would be better to use v2.4 core database philosophy... Example: if (tep_db_num_rows() > 0) { than do something } I hope @@FWR Media Robert asap will give right directions Edited September 14, 2013 by Gergely altoid 1 Quote osCommerce based shop owner with minimal design and focused on background works. When the less is more.Email managment with tracking pixel, package managment for shipping, stock management, warehouse managment with bar code reader, parcel shops management on 3000 pickup points without local store. Link to comment Share on other sites More sharing options...
tgely Posted September 14, 2013 Share Posted September 14, 2013 Hi Robert! As I hoped all of the page modules failed. In all page_modules need to do the previous temporary fix. I hope @FWR Media Robert asap will give right directions. Regards, Gergely Quote osCommerce based shop owner with minimal design and focused on background works. When the less is more.Email managment with tracking pixel, package managment for shipping, stock management, warehouse managment with bar code reader, parcel shops management on 3000 pickup points without local store. Link to comment Share on other sites More sharing options...
RWork Posted September 14, 2013 Share Posted September 14, 2013 @@Gergely the error is fixed now thank you very much for your help Quote Link to comment Share on other sites More sharing options...
jasondmc84 Posted September 17, 2013 Share Posted September 17, 2013 I have Ultimate SEO URLs 5 pro and header tags SEO and since installing them my product links on the homepage no longer work? I am using rewrite method as otherwise header tags dont work anymore. I have products on my homepage and if i click on the images/links it just returns to my homepage. How can I solve this? I am running oscommerce 2.3.31. Quote Link to comment Share on other sites More sharing options...
cnrwholesale Posted September 18, 2013 Share Posted September 18, 2013 This is perfect, Everyone needs to know how to handle this issue.. Thanks! Takes care of all category issues where multiple pages are being indexed like www.mysite.com/something-somewhere-c-4_32_234_2_23_5_6_245 _624.html Kudos!!! Quote Link to comment Share on other sites More sharing options...
tgely Posted September 19, 2013 Share Posted September 19, 2013 @@cnrwholesale here is a solution: https://github.com/Gergely/oscommerce2-1/commit/8206e3997762eacb4434d968383dfa6c9124104b Quote osCommerce based shop owner with minimal design and focused on background works. When the less is more.Email managment with tracking pixel, package managment for shipping, stock management, warehouse managment with bar code reader, parcel shops management on 3000 pickup points without local store. Link to comment Share on other sites More sharing options...
jasondmc84 Posted September 22, 2013 Share Posted September 22, 2013 Hi, can somebody please point me in the right direction as to how to fix my issue? my specials.php page works fine along with all the products and categories etc. all urls are being rewritten except for products on my homepage and in my whats new page(products_new.php) i copied the code from specials.php and renamed stuff to work with new products but still when i hover over links and images, it shows my homepage url and just goes straight to my homepage. when i turn usu5 pro off it all works again? there is no javascript in header or footer or column left as previously mentioned by others, i am stuck! Quote Link to comment Share on other sites More sharing options...
jasondmc84 Posted September 22, 2013 Share Posted September 22, 2013 and yes it is a template monster template but it is not a redirecting script that is happening, the actual urls are being written as the homepage urls? Quote Link to comment Share on other sites More sharing options...
greasemonkey Posted September 22, 2013 Share Posted September 22, 2013 @@jasondmc84 can u confirm the products in question are attached to a category? I'm not sure your setup... I presume you have categories. Quote Link to comment Share on other sites More sharing options...
♥altoid Posted September 27, 2013 Share Posted September 27, 2013 Temporary fix for 404 page handler after v2.3.3.2 updates page_modules/product_info.php (about in 98 line) change: if ( false === $text_array ) { to: if ( is_Null($text_array) || false === $text_array ) { Thanks for this fix @@Gergely In my case I think this was only showing up when google was recrawling cached pages that no longer exist. These are soft 404 errors in webmaster tools. My problem product pages are now going from an incorrect 200 status showing something like this: Warning: Invalid argument supplied for foreach() in /home/myusername/public_html/includes/modules/ultimate_seo_urls5/page_modules/product_info.php on line 102 Catchable fatal error: Argument 1 passed to aPage_Modules::linkText() must be an array, null given, called in /home/myusername/public_html/includes/modules/ultimate_seo_urls5/page_modules/product_info.php on line 170 and defined in /home/myusername/public_html/includes/modules/ultimate_seo_urls5/abstracts/page_modules.php on line 338 To a correct 404 status page generated by FWR Media looking something like this: Page not found The page you were looking for could not be found. Please click the below link to return to My Shop Name Posting this here so others with the same issue can see what occurs.... multimixer 1 Quote I am not a professional webmaster or PHP coder by background or training but I will try to help as best I can. I remember what it was like when I first started with osC. It can be overwhelming. However, I strongly recommend considering hiring a professional for extensive site modifications, site cleaning, etc. There are several good pros here on osCommerce. Look around, you'll figure out who they are. Link to comment Share on other sites More sharing options...
fgwapo Posted October 1, 2013 Share Posted October 1, 2013 Hello, Everything is working well in this addon except that my sort drop down feature is not working on the product listing page. I am using additional product sort addon. Any help is highly apprecaited. Quote Link to comment Share on other sites More sharing options...
timfel Posted October 13, 2013 Share Posted October 13, 2013 Hello, Trying to install this contribution but I've fallen at the first hurdle! Instructions say: 2) catalog/index.php Find ( this is within a block of code ) ... tep_draw_form('filter', FILENAME_DEFAULT, 'get') Replace with ... tep_draw_form('filter', tep_href_link( FILENAME_DEFAULT ), 'get') But this line of code doesn't exist in my index.php! I'm running osCommerce Online Merchant v2.3.1 It hasn't been modified at all. Does this matter? Should I abandon the installation and restore to previous? Quote Link to comment Share on other sites More sharing options...
knifeman Posted October 17, 2013 Share Posted October 17, 2013 Hi Robert, I have been using this mod for awhile and now for pci compliance I need to update to php 4. The mod specifically states PHP 5.2/5.3 ( PHP 4 will NOT work ) My host attempted upgrade to php4 and told me this: It seems there is some incompatibilities between the php version 5.4 and php sqlite module and seems your code is using the same. So we are getting a 500 Internal Server Error while accessing your site My question is can I use MySQL for the cache and run on php4 or are there other incompatibilities? Tim Quote Link to comment Share on other sites More sharing options...
oliverlyf Posted October 23, 2013 Share Posted October 23, 2013 Hi there, I have come across with some errors in my website and I contacted my hosting provider and they said that it's not a web server issue. This is the response by my hosting provider. Here is the error: [18-Oct-2013 04:55:53] PHP Catchable fatal error: Argument 1 passed to aPage_Modules::link Text() must be an array, null given, called in /hsphere/local/home/intellig/xxxxxxxxx.com.au/catalog/includes/modules/ultimate_seo_urls5/page_modules/product_info.php on line 170 and defined in /hsphere/local/home/intellig/xxxxxxxxx.com.au/catalog/includes/modules/ultimate_seo_urls5/abstracts/page_modules.php on line 338 The issue will be related to the mod_rewrite rules in the .htaccess, or the settings in the ultimate_seo_urls5 plugin.” Anyone can help me figure out what should be done to correct this problem? Regards, Oliver Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.