Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

ULTIMATE Seo Urls 5 - by FWR Media


Recommended Posts

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 by Flinspach
Link to comment
Share on other sites

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 by Gergely

:blink:
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

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 by Gergely

:blink:
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 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??

Link to comment
Share on other sites

@@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?

:blink:
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

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

Getting the Phoenix off the ground

Link to comment
Share on other sites

@ 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

Link to comment
Share on other sites

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 by epwork
Link to comment
Share on other sites

@@epwork

@@RWork

 

Thanks for the break point. I am debugging.

:blink:
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

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 by Gergely

:blink:
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

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

:blink:
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

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.

Link to comment
Share on other sites

:blink:
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

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!

Link to comment
Share on other sites

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....

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

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.

Link to comment
Share on other sites

  • 2 weeks later...

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?

Link to comment
Share on other sites

 

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...