Jump to content
FWR Media

ULTIMATE Seo Urls 5 - by FWR Media

Recommended Posts

Possible Trouble in usu5.php

 

When checking validation via validator.w3.org - it complained of the use of '&' in links on the page. A few were found in other locations, but the "more information" link which uses redirect.php kept giving trouble.

 

I found that I had to do the following:

    public function hrefLink( $page, $parameters, $connection, $add_session_id, $search_engine_safe ) {
    // Badly coded shops often pass in odd characters
    // $parameters = str_replace( array( '&', 'amp;' ), array( '&', '', ), $parameters ); 

 

Note that the str_replace line is commented out, once I did that the & got passed as & and not '&'

 

Another trouble... Your security addon strips / out of the $_get which is killing "Product URL"s where they are "www.somesite.com/somefolder" - it comes back as www.somesite.comsomefolder

 

Which would be better? Changing product_info.php to just create a straight link, skipping the call to redirect.php or altering the $_get cleansing to allow / through??

Share this post


Link to post
Share on other sites

It really makes no difference whatsoever in my opinion.

 

Having said that a new URI module is in early beta testing ..

 

Seo urls without the -c-52 / -p-37 etc.

 

They look like ..

 

/hardware.htm

/software.htm

/dvd-movies.htm

/gadgets.htm

/simulation-sierra-swat-close-quarters-battle.htm

/simulation-sierra-swat-close-quarters-battle.htm

/action-warner-the-matrix.htm

/action-warner-the-matrix.htm

/theres-something-about-mary.htm?reviews_id=1

/theres-something-about-mary.htm?reviews_id=1

/gadgets-samsung-samsung-galaxy-tab.htm

/gadgets-samsung-samsung-galaxy-tab.htm

/printers-hewlett-packard-hewlett-packard-laserjet-1100xi.htm

/printers-hewlett-packard-hewlett-packard-laserjet-1100xi.htm

/mice-microsoft-microsoft-intellimouse-explorer.htm

/mice-microsoft-microsoft-intellimouse-explorer.htm

/keyboards-microsoft-microsoft-internet-keyboard-ps2.htm

/keyboards-microsoft-microsoft-internet-keyboard-ps2.htm

/strategy-interactive-disciples-sacred-lands.htm

/strategy-interactive-disciples-sacred-lands.htm

/strategy-interactive-the-wheel-time.htm

/strategy-interactive-the-wheel-time.htm

/action-interactive-unreal-tournament.htm

/action-interactive-unreal-tournament.htm

/simulation-sierra-swat-close-quarters-battle.htm

/simulation-sierra-swat-close-quarters-battle.htm

/drama-warner-beloved.htm

/drama-warner-beloved.htm

 

Thank you very much for the answer.

 

We will wait for your new module if she (my customer) is still convinced that there is a difference.

Share this post


Link to post
Share on other sites

No what I wrote is correct. Either it is an integer or it has underscores or it needs to generate an error as it is incorrect and the site has issues that need to be addressed, that's what errors are for.

 

 

 

Ok. I understand. But sometimes let's say cpath is missing for example if a product is orphan (category is deleted).

 

 

I found out another strange error in error log . The strange thing is that the error happens twice an hour at the same time xx:20 or xx:40 very strange.

 

[18-Jan-2011 20:40:02] PHP Fatal error: Call to a member function retrieveDependencies() on a non-object in /home/*******/public_html/includes/modules/ultimate_seo_urls5/uri_modules/osc_experimental.php on line 51

[18-Jan-2011 21:20:01] PHP Fatal error: Call to a member function retrieveDependencies() on a non-object in /home/*******/public_html/includes/modules/ultimate_seo_urls5/uri_modules/osc_experimental.php on line 51

[18-Jan-2011 21:40:01] PHP Fatal error: Call to a member function retrieveDependencies() on a non-object in /home/*******/public_html/includes/modules/ultimate_seo_urls5/uri_modules/osc_experimental.php on line 51

[18-Jan-2011 22:20:02] PHP Fatal error: Call to a member function retrieveDependencies() on a non-object in /home/*******/public_html/includes/modules/ultimate_seo_urls5/uri_modules/osc_experimental.php on line 51

[18-Jan-2011 22:40:01] PHP Fatal error: Call to a member function retrieveDependencies() on a non-object in /home/*******/public_html/includes/modules/ultimate_seo_urls5/uri_modules/osc_experimental.php on line 51

[18-Jan-2011 23:20:01] PHP Fatal error: Call to a member function retrieveDependencies() on a non-object in /home/*******/public_html/includes/modules/ultimate_seo_urls5/uri_modules/osc_experimental.php on line 51

[18-Jan-2011 23:40:01] PHP Fatal error: Call to a member function retrieveDependencies() on a non-object in /home/*******/public_html/includes/modules/ultimate_seo_urls5/uri_modules/osc_experimental.php on line 51

Share this post


Link to post
Share on other sites

Note that the str_replace line is commented out, once I did that the & got passed as & and not '&'

 

Yes well, if you read the comment text "Badly coded shops often pass in odd characters" yours is one of them.

 

& should not be written as & in the core osCommerce files, it is the link wrapper that should do the formatting.

 

This was an omission in the uploaded package but this was covered in this support thread.

 

Leave the code the way it was then do the following: -

 

catalog/includes/modules/ultimate_seo_urls5/includes/usu_general_functions.php

 

function osc_href_link()

 

Find ..

return $link;

 

Change to ..

 

switch ( defined( 'USU5_USE_W3C_VALID' ) && ( USU5_USE_W3C_VALID == 'true' ) ) {
 	case true:
   	return htmlspecialchars( utf8_encode( $link ) );
   	break;
 	default:
   	return $link;
   	break;
}

 

I will upload a new package with all the updates when I feel the product has had sufficient usage.

Edited by FWR Media

Share this post


Link to post
Share on other sites

Which would be better? Changing product_info.php to just create a straight link, skipping the call to redirect.php or altering the $_get cleansing to allow / through??

 

This should be posted in the Security Pro support thread as it has nothing to do with USU5/PRO.

 

But DON'T remove the forward slash / from cleansing stepping back through directories like /../../../../ is a nasty hack vector via querystring.

Share this post


Link to post
Share on other sites

Hello i use Simple Multiple Images (Unlimited) with Fancy Popups V1.25 and i just installed Ultimate_Seo_Urls_5_PRO_r197 & KissMT_1.0_r72_RC.

 

Ultimate_Seo_Urls_5_PRO_r197 & KissMT_1.0_r72_RC work great but i do have one major problem.

 

My problem is that when i Enable SEO URLs 5 my pop up images on the product info page open up in a new tab/window when i click on the image or when i choose click to enlarge.

 

and when i turn off SEO URLs 5 my pop ups work as they should. Is there anyway to fix this so my pop up images work with Ultimate_Seo_Urls_5_PRO_r197 enabled?

 

This is how i want my pop up images to work with Ultimate_Seo_Urls_5_PRO_r197 enabled/on.

 

My site

 

Right now it is disabled/off.

 

Thanks in advance for any help.

Share this post


Link to post
Share on other sites

Hello i use Simple Multiple Images (Unlimited) with Fancy Popups V1.25 and i just installed Ultimate_Seo_Urls_5_PRO_r197 & KissMT_1.0_r72_RC.

 

Ultimate_Seo_Urls_5_PRO_r197 & KissMT_1.0_r72_RC work great but i do have one major problem.

 

My problem is that when i Enable SEO URLs 5 my pop up images on the product info page open up in a new tab/window when i click on the image or when i choose click to enlarge.

 

and when i turn off SEO URLs 5 my pop ups work as they should. Is there anyway to fix this so my pop up images work with Ultimate_Seo_Urls_5_PRO_r197 enabled?

 

This is how i want my pop up images to work with Ultimate_Seo_Urls_5_PRO_r197 enabled/on.

 

My site

 

Right now it is disabled/off.

 

Thanks in advance for any help.

 

I have identified a bug where the standard pop up image does not function when it is the non default language ( the script will add the language marker to the image path like /de ) but not where it was the default language.

 

Could you post here the link that is produced that doesn't work along with the code to generate it please?

Share this post


Link to post
Share on other sites

I installed this contribution to a new (modified) osc 2.3.1

 

I'm getting the following error when accessing the admin section

 

Parse error: syntax error, unexpected T_OBJECT_OPERATOR in /home/xxxxxxx/public_html/xxxxxxxx.com/xxxxxxadmin/includes/functions/general.php on line 1502

 

This is the code I pasted into admin/includes/functions/general.php right before the closing php tag ?>

 

/**
 * ULTIMATE Seo Urls 5 PRO by FWR Media
 * Reset the various cache systems
 * @param string $action
 */
 function tep_reset_cache_data_usu5( $action = false ) {
   if ( $action == 'reset' ) {
     $usu5_path = realpath( dirname( __FILE__ ) . '/../../../' ) . '/' . DIR_WS_MODULES . 'ultimate_seo_urls5/';
     switch( USU5_CACHE_SYSTEM ) {
       case 'file': 
         $path_to_cache = $usu5_path . 'cache_system/cache/';
         $it = new DirectoryIterator( $path_to_cache );
         while( $it->valid() ) {
           if ( !$it->isDot() && is_readable( $path_to_cache . $it->getFilename() ) && ( substr( $it->getFilename(), -6 ) == '.cache' ) ) {
             @unlink( $path_to_cache . $it->getFilename() );
           }
           $it->next();
         }
         break;
       case 'mysql':
         tep_db_query( 'TRUNCATE TABLE `usu_cache`' );
         break;
       case 'memcache':
         if ( class_exists('Memcache') ){
           include_once $usu5_path . 'interfaces/cache_interface.php';
           include_once $usu5_path . 'cache_system/memcache.php';
           Memcache_Cache_Module::iAdmin()->initiate()
                                          ->flushOut();
         }
         break;
       case 'sqlite':
         $path_to_cache = $usu5_path . 'cache_system/sqlite/usu_cache.db';
         if ( file_exists( $path_to_cache ) ) {
           @unlink( $path_to_cache ); 
         } 
         break;
     }
     tep_db_query( "UPDATE " . TABLE_CONFIGURATION . " SET configuration_value='false' WHERE configuration_key='USU5_RESET_CACHE'" );
   }       
 } // end function

 

Line 1502 is

Memcache_Cache_Module::iAdmin()->initiate()

 

There is no blank line after the ?> tag. Anyone have any suggestions/solutions?

 

Thanks in advance for the contribution. I'd like to get it to work.

 

Dave

Edited by birdrockdesigns

Share this post


Link to post
Share on other sites

Thanks in advance for the contribution. I'd like to get it to work.

 

PHP4 is not supported, the code is PHP5.2+

Share this post


Link to post
Share on other sites

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]

Share this post


Link to post
Share on other sites

Yes well, if you read the comment text "Badly coded shops often pass in odd characters" yours is one of them.

 

& should not be written as & in the core osCommerce files, it is the link wrapper that should do the formatting.

 

This was an omission in the uploaded package but this was covered in this support thread.

 

Leave the code the way it was then do the following: -

 

catalog/includes/modules/ultimate_seo_urls5/includes/usu_general_functions.php

 

function osc_href_link()

 

Find ..

return $link;

 

Change to ..

 

switch ( defined( 'USU5_USE_W3C_VALID' ) && ( USU5_USE_W3C_VALID == 'true' ) ) {
 	case true:
   	return htmlspecialchars( utf8_encode( $link ) );
   	break;
 	default:
   	return $link;
   	break;
}

 

I will upload a new package with all the updates when I feel the product has had sufficient usage.

 

I switched to & in an attempt to get it to validate, but I missed this fix earlier in the thread. I'll patch and see how it goes.

 

POST PATCH: That seems to have fixed it, thanks.

Edited by TedThompson

Share this post


Link to post
Share on other sites

I have identified a bug where the standard pop up image does not function when it is the non default language ( the script will add the language marker to the image path like /de ) but not where it was the default language.

 

Could you post here the link that is produced that doesn't work along with the code to generate it please?

 

Here is the link to my site with Ultimate_Seo_Urls_5_PRO_r197 set to enabled/true see how the pop up images open in a new tab/window. How can i fix this?

Share this post


Link to post
Share on other sites

Here is the link to my site with Ultimate_Seo_Urls_5_PRO_r197 set to enabled/true see how the pop up images open in a new tab/window. How can i fix this?

 

The only URL being produced is ..

 

[DOMAIN]/images/BUG 304 BUG0 BLK RED.jpg?Bugs Bunny Kids Jacket

 

All of the others are relative paths.

Share this post


Link to post
Share on other sites

Date / Time: 20-01-2011 10:11:29

Error Type: [E_NOTICE] Undefined index: products_model

On line 183

File includes/modules/ultimate_seo_urls5/page_modules/product_info.php

 

How can I resolve this not to be thrown.

 

 

And one important thing: Force www.mysite.com/ when www.mysite.com/index.php this is a problem for those with affiliate links like www.mysite.com/index.php?affcode=zz it will redirect to www.mysite.com/ with no affiliate parameter send.

Share this post


Link to post
Share on other sites

Date / Time: 20-01-2011 10:11:29

Error Type: [E_NOTICE] Undefined index: products_model

On line 183

File includes/modules/ultimate_seo_urls5/page_modules/product_info.php

 

How can I resolve this not to be thrown.

 

This has been covered earlier and it means that you have a corrupt database, probably items have been manually dropped.

 

In this case you will have to change all instances of INNER JOIN to LEFT JOIN in the query.

 

And one important thing: Force www.mysite.com/ when www.mysite.com/index.php this is a problem for those with affiliate links like www.mysite.com/index.php?affcode=zz it will redirect to www.mysite.com/ with no affiliate parameter send.

 

It is a feature added for users convenience.

 

It doesn't work on some server set ups .. so .. if it doesn't work for you the answer is .. don't use the feature.

Edited by FWR Media

Share this post


Link to post
Share on other sites

And one important thing: Force www.mysite.com/ when www.mysite.com/index.php this is a problem for those with affiliate links like www.mysite.com/index.php?affcode=zz it will redirect to www.mysite.com/ with no affiliate parameter send.

 

This is untested but try this ..

 

includes/modules/ultimate_seo_urls5/main/validator.php Line 194

 

Find ..

 

   	$this->redirect( str_replace( FILENAME_DEFAULT, '',  htmlspecialchars_decode( tep_href_link( FILENAME_DEFAULT ) ) )  );

 

Change to ..

 

   	$this->redirect( str_replace( FILENAME_DEFAULT, '',  htmlspecialchars_decode( tep_href_link( FILENAME_DEFAULT,  http_build_query( $_GET ) ) ) ) );

Share this post


Link to post
Share on other sites

This has been covered earlier and it means that you have a corrupt database, probably items have been manually dropped.

 

In this case you will have to change all instances of INNER JOIN to LEFT JOIN in the query.

 

 

Thanks man.

 

I was able to find out what products caused the problem with this query. Hope will help somebody.

 

//Get all products_id from table description
$description_products_id_array = array();
$sql_query = tep_db_query ("select products_id from  products_description");
while ($sql = tep_db_fetch_array($sql_query)) {
array_push ($description_products_id_array, $sql['products_id']);
}

$sql_string = implode (',', $description_products_id_array);

//Check what products id not found in products description
$sql_query = tep_db_query ("select products_id from products where products_id NOT IN (" . $sql_string . ")");
while ($sql = tep_db_fetch_array($sql_query)) {
echo '<Br>Product: ' . $sql['products_id'] . " not found in products description";
}


//Get all products_id from table products_to_categories
$products_to_categories_products_id_array = array();
$sql_query = tep_db_query ("select products_id from  products_to_categories");
while ($sql = tep_db_fetch_array($sql_query)) {
array_push ($products_to_categories_products_id_array, $sql['products_id']);
}

$sql_string = implode (',', $products_to_categories_products_id_array);

//Check what products id not found in products_to_categories
$sql_query = tep_db_query ("select products_id from products where products_id NOT IN (" . $sql_string . ")");
while ($sql = tep_db_fetch_array($sql_query)) {
echo '<Br>Product: ' . $sql['products_id'] . " not found in products products_to_categories";
}

Share this post


Link to post
Share on other sites

Thanks man.

 

I was able to find out what products caused the problem with this query. Hope will help somebody.

 

Thanks Zip, appreciate you taking the time to post your code for the benefit of others.

 

Although I'm not sure if others will understand what you actually did :) I'll try to explain: -

 

In osCommerce a product ALWAYS has entries in certain tables, USU5 PRO expects these entries to exist. If one does not exists the query fails.

 

The code by Zip above allows you to find out which of your products relations are corrupt.

 

A product should have an entry in the following tables: -

products

products_description

products_to_categories

 

It may or may not have an entry in the manufacturers table

 

Because a product is linked to a category in products_to_categories there will also be entries in ..

categories

categories_description

Edited by FWR Media

Share this post


Link to post
Share on other sites

Hi Rob,

 

I posted a problem back in February last year, which you were looking at, but we never got to the bottom of.....

 

The info is below....I really need to get this resolved now.

 

Any chance of you having another look at it?

Would any of the updates since then resolve it?

If not, do you have any ideas how to resolve it?

 

Your help would be greatly appreciated.

 

Kevin Wilson

Ginger6 Ltd

http://www.ginger6.com

 

 

 

Hi Rob,

 

I have a problem I cant seem to figure out.....

 

I have upgraded from 2.1 to 5 and everything seemed to have gone well, however...

 

We offer custom built computers and use attribute sets to offer all the different options....

 

When a customer configures a system and adds it to cart everything seems fine.... if you click the link in the shopping cart for the product it takes you back to the product info page with the following in the address bar:

 

http://www.ginger6.c...0{31}455{15}346

 

now if you try to add that product to the cart again, or click on the 'reviews' button you get a page not found message...the url taht the add to cart button is generating is:

 

http://www.ginger6.c...ion=add_product

 

and the reviews button is producing the following url...

 

http://www.ginger6.c...7B15%7D346.html

 

everything works fine when you go into a product the first time, it only has a problem if you click on the product link in the shopping cart and try to add another to the cart, whether you change the options or not makes no difference to the end result...

 

Any ideas where it is going wrong?

 

Kevin Wilson

Ginger6 Ltd

http://www.ginger6.com

Share this post


Link to post
Share on other sites

Hi Rob,

 

I posted a problem back in February last year, which you were looking at, but we never got to the bottom of.....

 

The info is below....I really need to get this resolved now.

 

Any chance of you having another look at it?

Would any of the updates since then resolve it?

If not, do you have any ideas how to resolve it?

 

Your help would be greatly appreciated.

 

 

USU5 PRO will provide a standard link back to the product in the shopping cart, it will not include the attributes.

 

This should solve your issue but the attributes will not be preselected.

Share this post


Link to post
Share on other sites

Date / Time: 20-01-2011 10:11:29

Error Type: [E_NOTICE] Undefined index: products_model

On line 183

File includes/modules/ultimate_seo_urls5/page_modules/product_info.php

 

How can I resolve this not to be thrown.

 

 

 

Ok I saw the answer with INNER JOIN replaced with LEFT JOIN (this doesn't remove the erorr). That helped me repairing my database.

 

I was making a debugging and I went to line 183

 

$text_types = array( 'p' => $details['products_name'], 'c' => $details['categories_name'], 'm' => $details['products_model'] ); 

 

The problem

 

	echo '<pre>';
print_r ($details);

 

 

And the result was

 

Array
(
   [products_name] => a name
   [manufacturers_name] => a manufacturer
   [categories_name] => a category 
   [categories_id] => a category id
)

 

that line

'm' => $details['products_model']

... should that be

'm' => $details['manufacturers_name'] 

there is no index with products model

 

 

Sorry if bothering u

Edited by zipicip

Share this post


Link to post
Share on other sites

The only URL being produced is ..

 

[DOMAIN]/images/BUG 304 BUG0 BLK RED.jpg?Bugs Bunny Kids Jacket

 

All of the others are relative paths.

 

Ok how do i fix it so that when i have ULTIMATE Seo Urls 5 set to true/enabled for my popup images to work normally and not open up in a new tab/window. I really like this contribution and this is my only problem. i will leave it set to true/enabled for one more day to see if anyone can help after that i will just have to disable it. I really don't want to do that so any help will and is greatly appreciated.

 

Thank you in advance.

Share this post


Link to post
Share on other sites

Ok how do i fix it so that when i have ULTIMATE Seo Urls 5 set to true/enabled for my popup images to work normally and not open up in a new tab/window. I really like this contribution and this is my only problem. i will leave it set to true/enabled for one more day to see if anyone can help after that i will just have to disable it. I really don't want to do that so any help will and is greatly appreciated.

 

Thank you in advance.

 

Dunno, I'm not familiar with the contribution. USU5 is producing the url fine so perhaps you should ask in the support thread of that contribution.

 

Post the small piece of code that is producing the image here if you want, that would help.

Edited by FWR Media

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×