Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

ULTIMATE Seo Urls 5 - by FWR Media


Recommended Posts

If your images are broken after installing USU5 then you are probably using tep_href_link incorrectly within tep_image like ..

 

tep_image( tep_href_link( DIR_WS_IMAGES . 'myimage.jpg' ) );

 

Or as plain html like ..

 

<img src="<?php echo tep_href_link( DIR_WS_IMAGES . 'myimage.jpg' ); ?>">

 

Whereas the correct method is to pass the relative path like ..

 

tep_image(DIR_WS_IMAGES . 'myimage.jpg');

 

 

I did the drop on top install, was there anything else I was supposed to edit besides just uploading the files within the drop on top folder?

 

For example was I supposed to edit the files in the install documentation?

 

Like below...

 

 

Installation

Catalog Files

catalog/includes/functions/compatibility.php

1- At the very bottom before the closing ?> .. add ..

 

/**

* USU5 function to return the base filename

*/

function usu5_base_filename() {

// Probably won't get past SCRIPT_NAME unless this is reporting cgi location

$base = new ArrayIterator( array( 'SCRIPT_NAME', 'PHP_SELF', 'REQUEST_URI', 'ORIG_PATH_INFO', 'HTTP_X_ORIGINAL_URL', 'HTTP_X_REWRITE_URL' ) );

while ( $base->valid() ) {

if ( array_key_exists( $base->current(), $_SERVER ) && !empty( $_SERVER[$base->current()] ) ) {

if ( false !== strpos( $_SERVER[$base->current()], '.php' ) ) {

preg_match( '@[a-z0-9_]+\.php@i', $_SERVER[$base->current()], $matches );

if ( is_array( $matches ) && ( array_key_exists( 0, $matches ) )

&& ( substr( $matches[0], -4, 4 ) == '.php' )

&& ( is_readable( $matches[0] ) ) ) {

return $matches[0];

}

}

}

$base->next();

}

trigger_error( 'USU5 could not find a valid base filename, please inform the developer.', E_USER_WARNING );

} // End function

catalog/includes/application_top.php

2- Find ...

 

// include the language translations

require(DIR_WS_LANGUAGES . $language . '.php');

Add immediately below ...

 

// ULTIMATE Seo Urls 5 by FWR Media

if ( !isset($seo_urls) || !is_object($seo_urls) ){

include_once DIR_WS_MODULES . 'ultimate_seo_urls5' . DIRECTORY_SEPARATOR . 'classes' . DIRECTORY_SEPARATOR . 'usu.php';

$seo_urls = new usu($languages_id, $request_type, $session_started, $SID);

}

$seo_urls->initiate($SID, $languages_id, $language);

3- Find ...

 

// set php_self in the local scope

if (!isset($PHP_SELF)) $PHP_SELF = $HTTP_SERVER_VARS['PHP_SELF'];

Replace with ...

 

// set php_self in the local scope

$PHP_SELF = usu5_base_filename();

Link to comment
Share on other sites

I did the drop on top install, was there anything else I was supposed to edit besides just uploading the files within the drop on top folder?

 

For example was I supposed to edit the files in the install documentation?

 

Like below...

 

 

Installation

Catalog Files

catalog/includes/functions/compatibility.php

1- At the very bottom before the closing ?> .. add ..

 

/**

* USU5 function to return the base filename

*/

function usu5_base_filename() {

// Probably won't get past SCRIPT_NAME unless this is reporting cgi location

$base = new ArrayIterator( array( 'SCRIPT_NAME', 'PHP_SELF', 'REQUEST_URI', 'ORIG_PATH_INFO', 'HTTP_X_ORIGINAL_URL', 'HTTP_X_REWRITE_URL' ) );

while ( $base->valid() ) {

if ( array_key_exists( $base->current(), $_SERVER ) && !empty( $_SERVER[$base->current()] ) ) {

if ( false !== strpos( $_SERVER[$base->current()], '.php' ) ) {

preg_match( '@[a-z0-9_]+\.php@i', $_SERVER[$base->current()], $matches );

if ( is_array( $matches ) && ( array_key_exists( 0, $matches ) )

&& ( substr( $matches[0], -4, 4 ) == '.php' )

&& ( is_readable( $matches[0] ) ) ) {

return $matches[0];

}

}

}

$base->next();

}

trigger_error( 'USU5 could not find a valid base filename, please inform the developer.', E_USER_WARNING );

} // End function

catalog/includes/application_top.php

2- Find ...

 

// include the language translations

require(DIR_WS_LANGUAGES . $language . '.php');

Add immediately below ...

 

// ULTIMATE Seo Urls 5 by FWR Media

if ( !isset($seo_urls) || !is_object($seo_urls) ){

include_once DIR_WS_MODULES . 'ultimate_seo_urls5' . DIRECTORY_SEPARATOR . 'classes' . DIRECTORY_SEPARATOR . 'usu.php';

$seo_urls = new usu($languages_id, $request_type, $session_started, $SID);

}

$seo_urls->initiate($SID, $languages_id, $language);

3- Find ...

 

// set php_self in the local scope

if (!isset($PHP_SELF)) $PHP_SELF = $HTTP_SERVER_VARS['PHP_SELF'];

Replace with ...

 

// set php_self in the local scope

$PHP_SELF = usu5_base_filename();

 

Aaaaah sorry .. if you did the drop on top install then it should work straight away with no problem at all.

 

Did you install on top of a TOTALLY fresh install of RC2a?

Link to comment
Share on other sites

Yes I did it on a fresh install of osc

 

Post the url you see when you right click a broken image.

 

USU5 does not suffer this problem though so it must be your end. Probably the configure.php file or base href

Edited by FWR Media
Link to comment
Share on other sites

I installed this over after backing up my database from a previous time and now I get this message....

 

Installer Messages: Stage - 1

Below you will see some checks - if none are red then we are ready to install.

 

•All configuration values look good.

•Configuration Group auto increment to start at 16

•At least one of the tables to insert already exists!

•No tables to alter it seems.

•No fields to insert it seems.

•No fields to alter it seems.

 

There was at least one error, we therefore cannot install.

Database nolan1123_IC_20091129_090334 has not been touched.

 

Please check database ******************************* against the contribution for conflicts.

 

Please help

 

 

Thanks

Link to comment
Share on other sites

I'm at the section of the install where it says:

 

The base install is complete .. you should now be able to visit your site and it will be producing "standard" seo urls.

 

and I get this error when viewing the catalog:

 

Fatal error: Cannot instantiate non-existent class: arrayiterator in /home/content/11/4848511/html/ShoppingCart/includes/application_top.php on line 53

 

ideas?

Link to comment
Share on other sites

I'm at the section of the install where it says:

 

The base install is complete .. you should now be able to visit your site and it will be producing "standard" seo urls.

 

and I get this error when viewing the catalog:

 

Fatal error: Cannot instantiate non-existent class: arrayiterator in /home/content/11/4848511/html/ShoppingCart/includes/application_top.php on line 53

 

ideas?

 

I get the same error. Also, my installer didn't work.

Link to comment
Share on other sites

I'm at the section of the install where it says:

 

The base install is complete .. you should now be able to visit your site and it will be producing "standard" seo urls.

 

and I get this error when viewing the catalog:

 

Fatal error: Cannot instantiate non-existent class: arrayiterator in /home/content/11/4848511/html/ShoppingCart/includes/application_top.php on line 53

 

ideas?

 

USU5 requires PHP5.2

Link to comment
Share on other sites

I installed this over after backing up my database from a previous time and now I get this message....

 

Installer Messages: Stage - 1

Below you will see some checks - if none are red then we are ready to install.

 

•All configuration values look good.

•Configuration Group auto increment to start at 16

•At least one of the tables to insert already exists!

•No tables to alter it seems.

•No fields to insert it seems.

•No fields to alter it seems.

 

There was at least one error, we therefore cannot install.

Database nolan1123_IC_20091129_090334 has not been touched.

 

Please check database ******************************* against the contribution for conflicts.

 

Please help

 

 

Thanks

 

usu_cache is already present .. drop table usu_cache.

 

also there is a DB removal tool in the package ..

extras/usu5_updates/r96_to_r119/usu5_db_removal.php

Edited by FWR Media
Link to comment
Share on other sites

FWR - A big thankyou, a very tidy piece of work, runs sweet as a nut on iis6. What is the best xml sitemap contribution for search engines to run with this?

 

My pleasure and good to hear from a Windows user.

 

You can use the rewrite method btw if you install ISAPI rewrite v3.0 by helicontech.

 

You can run Google XML Sitemap SEO but you'll have to use the files in the extras folder in the USU5 download, you will also need to use wget in the cron to access the files via http (it's in the instructions).

Edited by FWR Media
Link to comment
Share on other sites

After installing r119 my paypal IPN stopped working, the payments go though but i don't get the replies from paypal to confirm the order.

 

Any Ideas?

 

Andy

 

Yup

 

Usually this would be the W3C setting of USU5. If the payment module is sent a uri the uri should be modified like ..

$uri = str_replace( '&', '&', $uri );

 

The alternative is to turn off the W3C option in admin.

Link to comment
Share on other sites

Yup

 

Usually this would be the W3C setting of USU5. If the payment module is sent a uri the uri should be modified like ..

$uri = str_replace( '&', '&', $uri );

 

The alternative is to turn off the W3C option in admin.

 

Example: one of the PayPal payment modules has the following: -

 

$params['RETURNURL'] = tep_href_link('ext/modules/payment/paypal/express.php', 'osC_Action=retrieve', 'SSL', true, false);

 

you would modify it like ..

 

  $params['RETURNURL'] = str_replace( '&', '&', tep_href_link('ext/modules/payment/paypal/express.php', 'osC_Action=retrieve', 'SSL', true, false) );

Link to comment
Share on other sites

Which file do I need to add/edit this line?

 

Thanks for your help

 

Andy

 

Don't know it depends on the payment module you are using.

Link to comment
Share on other sites

I am using Paypal IPN,

 

I changed

 

      $parameters['notify_url'] = tep_href_link('ext/modules/payment/paypal_ipn/ipn.php', 'language=' . $_SESSION['language'], 'SSL', false, false);

 

to

 

      $parameters['notify_url'] = str_replace( '&', '&', tep_href_link('ext/modules/payment/paypal_ipn/ipn.php', 'language=' . $_SESSION['language'], 'SSL', false, false));

 

But still no IPN reply

 

Andy

Link to comment
Share on other sites

Link to comment
Share on other sites

When I open my IPN return file directly I get this message.

 

Warning: USU5 could not find a valid base filename, please inform the developer. in /home/t/r/****/public_html/includes/application_top.php  on line 65

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/t/r/****/public_html/includes/application_top.php:65) in /home/t/r/****/public_html/includes/functions/sessions.php on line 102

Warning: USU5 could not find a valid base filename, please inform the developer. in /home/t/r/****/public_html/includes/application_top.php on line 65

Link to comment
Share on other sites

ok those modules are passing a path to tep_href_link() instead of a filename, odd thing to do as it's wrong.

 

Anyway open file ..

 

catalog/includes/modules/ultimate_seo_urls5/classes/usu.php

 

Find ..

 

    private function patchPhpSelf( &$page ) {

 

Change to ..

 

    private function patchPhpSelf( &$page ) {
     if ( false !== strpos( $page, 'ext/modules/payment/' ) ) {
       return;
     }

Edited by FWR Media
Link to comment
Share on other sites

My apologies Andrew I was looking at version 1.1 not 1.0

 

BUGFIX

 

Bug description:

tep_href_link should be passed a filename but some payment systems (like PayPal IPN) pass a path, this was caught by the USU5 system and caused the link to fail.

 

Bug fix:

 

catalog/includes/modules/ultimate_seo_urls5/classes/usu.php

 

Find ..

 

    if( ( false !== strpos( $page, '/' ) ) || ( substr( $page, -4, 4 ) != '.php' ) ) {
     preg_match( '@\b[a-z_]+\.php\b@i', $page, $matches ); // Is our filename in there somewhere??
     if ( array_key_exists( '0', $matches ) && ( substr( $matches[0], -4, 4 ) == '.php' ) ) {
       $page = $matches[0]; 
     } else {
       $tags_to_files = $this->getTagsToFiles();
       foreach ( $tags_to_files as $marker => $filename ) {
         if ( false !== strpos( $page, $marker ) ) {  // is there a seo url marker in the page name?
           $page = $filename; // Grab the correct page name from the registry
         }
       }
     }
   }

 

Change to ..

   if ( false === strpos( $page, 'ext/modules/payment/' ) ) {
     if( ( false !== strpos( $page, '/' ) ) || ( substr( $page, -4, 4 ) != '.php' ) ) {
       preg_match( '@\b[a-z_]+\.php\b@i', $page, $matches ); // Is our filename in there somewhere??
       if ( array_key_exists( '0', $matches ) && ( substr( $matches[0], -4, 4 ) == '.php' ) ) {
         $page = $matches[0]; 
       } else {
         $tags_to_files = $this->getTagsToFiles();
         foreach ( $tags_to_files as $marker => $filename ) {
           if ( false !== strpos( $page, $marker ) ) {  // is there a seo url marker in the page name?
             $page = $filename; // Grab the correct page name from the registry
           }
         }
       }
     }
   }

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