Upgrade from Ultimate Seo Urls 5 by FWR Media

What about the database entries that USU5 put in my database?

You don't have to worry about these, USU5 PRO installs automatically and will intelligently remove any earlier versions of Ultimate Seo Urls from your database.

1) Delete directory catalog/includes/modules/ultimate_seo_urls5/

Please be aware that this action will temporarily cause your links not to work and will generate errors on your web shop until you have completed this page of modifications ( should only take you a few minutes ).

Delete the directory and all files within from your server.

2) Uploads directory

Upload the files and directories in the "uploads" directory to your server maintaining the directory structure of osCommerce.

Please note that "catalog" refers to the root of your osCommerce install and probably won't actually exist.

Important: now ensure that the following two directories are writable. Dependent on your server this may be 0755 or 0777.

Now upload the files in additional_uploads .. again, maintaining the osCommerce directory structure.
Upload the correct files as below.

3) 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_linkFILENAME_DEFAULT ), 'get')

4) catalog/includes/functions/html_output.php

Find ( complete function ) ...

////
// ULTIMATE Seo Urls 5 by FWR Media
// The HTML href link wrapper function
  
function tep_href_link($page ''$parameters ''$connection 'NONSSL'$add_session_id true$search_engine_safe true) {
    global 
$seo_urls$languages_id$request_type$session_started$sid;                
    if ( !
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);
    }
    return 
$seo_urls->href_link($page$parameters$connection$add_session_id);
  }

Replace with ...

  /**
  * ULTIMATE Seo Urls 5 PRO by FWR Media
  * Replacement for osCommerce href link wrapper function
  */
  
require_once DIR_WS_MODULES 'ultimate_seo_urls5/main/usu5.php';
  
  function 
tep_href_link$page ''$parameters ''$connection 'NONSSL'$add_session_id true$search_engine_safe true ) {
    return 
Usu_Main::i()->hrefLink$page$parameters$connection$add_session_id$search_engine_safe );
  }

5) catalog/includes/application_top.php

Find ...

  /**
  * 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_exists0$matches ) )
                                    && ( 
substr$matches[0], -4) == '.php' )
                                    && ( 
is_readable$matches[0] ) || ( false !== strpos$_SERVER[$base->current()], 'ext/modules/' ) ) ) ) {
            return 
$matches[0];
          } 
        } 
      }
      
$base->next();
    }
    
// Some odd server set ups return / for SCRIPT_NAME and PHP_SELF when accessed as mysite.com (no index.php) where they usually return /index.php
    
if ( ( $_SERVER['SCRIPT_NAME'] == '/' ) || ( $_SERVER['PHP_SELF'] == '/' ) ) {
      return 
'index.php';
    } 
    
trigger_error'USU5 could not find a valid base filename, please inform the developer.'E_USER_WARNING );
  } 
// End function
// set php_self in the local scope
  
$PHP_SELF usu5_base_filename();

Replace with ...

/**
  * ULTIMATE Seo Urls 5 PRO by FWR Media
  * 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_exists0$matches ) )
                                    && ( 
substr$matches[0], -4) == '.php' )
                                    && ( 
is_readable$matches[0] ) ) ) {
            return 
$matches[0];
          } 
        } 
      }
      
$base->next();
    }
    
// Some odd server set ups return / for SCRIPT_NAME and PHP_SELF when accessed as mysite.com (no index.php) where they usually return /index.php
    
if ( ( $_SERVER['SCRIPT_NAME'] == '/' ) || ( $_SERVER['PHP_SELF'] == '/' ) ) {
      return 
'index.php';
    }
    
// Return the standard RC3 code 
    
return ( ( ( strlenini_get'cgi.fix_pathinfo' ) ) > 0) && ( (bool)ini_get'cgi.fix_pathinfo' ) == false ) ) || !isset( $_SERVER['SCRIPT_NAME'] ) ) ? basename$_SERVER['PHP_SELF'] ) : basename$_SERVER['SCRIPT_NAME'] );
  } 
// End function
// set php_self in the local scope
  
$PHP_SELF usu5_base_filename();

Find and DELETE

// 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);

Find ...

// include the language translations
  
require(DIR_WS_LANGUAGES $language '.php');

Add immediately ABOVE ...

  /**
  * ULTIMATE Seo Urls 5 PRO by FWR Media
  */
  
Usu_Main::i()->setVar'languages_id'$languages_id )
               ->
setVar'request_type'$request_type 
               ->
setVar'session_started'$session_started 
               ->
setVar'sid'$SID 
               ->
setVar'language'$language )
               ->
setVar'filename'$PHP_SELF )
               ->
initiate( ( isset( $lng ) && ( $lng instanceof language ) ) ? $lng : array(), $languages_id$language );

6) catalog/ADMIN/categories.php

Find ...

  if (tep_not_null($action)) {
    
// ULTIMATE Seo Urls 5 by FWR Media
    // If the action will affect the cache entries
    
if ( $action == 'insert' || $action == 'update' || $action == 'setflag' ) {
      
tep_reset_cache_data_seo_urls'reset' );
    }

Replace with ...

  if (tep_not_null($action)) {
    
// ULTIMATE Seo Urls 5 PRO by FWR Media
    // If the action will affect the cache entries
    
if ( $action == 'insert' || $action == 'update' || $action == 'setflag' ) {
      
tep_reset_cache_data_usu5'reset' );
    }

7) catalog/ADMIN/includes/functions/general.php

Find ( complete function ) ...

// ULTIMATE Seo Urls 5 by FWR Media
// Reset the seo urls cache
function tep_reset_cache_data_seo_urls($action false){
  if ( 
$action == 'reset' ){
    
$usu5_path DIR_FS_CATALOG DIR_WS_MODULES 'ultimate_seo_urls5' DIRECTORY_SEPARATOR;
    switch( 
SEO_URLS_CACHE_SYSTEM ){
      case 
'FileSystem'
        
$path_to_cache realpath($usu5_path 'cache') . DIRECTORY_SEPARATOR;
        
$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 
'Database':
        
tep_db_query("TRUNCATE TABLE `usu_cache`");
        break;
      case 
'Memcached':
        if ( 
class_exists('Memcache') ){
          include_once 
$usu5_path 'interfaces' DIRECTORY_SEPARATOR 'Interface_Cache.php';
          include_once 
$usu5_path 'classes' DIRECTORY_SEPARATOR 'Usu_Cache_Memcached.php';
          
$mc = new Usu_Cache_Memcached('dummy');
          
$mc->flushOut();
        }
        break;
    }
    
tep_db_query("UPDATE " TABLE_CONFIGURATION " SET configuration_value='false' WHERE configuration_key='SEO_URLS_CACHE_RESET'");
  }       
}

Replace with ..

  /**
  * 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 realpathdirname__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(), -) == '.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 
$usu5_path 'interfaces/cache_interface.php';
            include 
$usu5_path 'cache_system/memcache.php';
            
Memcache_Cache_Module::iAdmin()->initiate()
                                           ->
flushOut();
          }
          break;
        case 
'sqlite':
          include 
$usu5_path 'interfaces/cache_interface.php';
          include 
$usu5_path 'cache_system/sqlite.php';
          
Sqlite_Cache_Module::admini()->gc(); 
          break;
      }
      
tep_db_query"UPDATE " TABLE_CONFIGURATION " SET configuration_value='false' WHERE configuration_key='USU5_RESET_CACHE'" );
    }       
  } 
// end function

Thank you for donating, it allows us to spend more time developing free contributions for you to use.

Your installation is now complete!

please click here