Jump to content



Latest News: (loading..)

* * * * - 10 votes

ULTIMATE Seo Urls 5 - by FWR Media


  • Please log in to reply
3897 replies to this topic

#3381   museumreplicas.gr

museumreplicas.gr
  • Members
  • 3 posts
  • Real Name:Agis Apostolopoulos
  • Gender:Male
  • Location:Athens, Greece

Posted 26 July 2011 - 02:13 PM

View PostFWR Media, on 26 July 2011 - 01:04 PM, said:

Assuming that English is the default language,  you have a language set up in admin as "gr" ( code field of the languages table ) and that you have turned on multi language support then ..

www.mysite.com/index.php would load the English links and language.

www.mysite.com/index.php/gr would load Greek

hi Robert, thank you very much for your quick reply!
Indeed English is the default lanquage, and Greek is a secondary lanquage as "gr" ( code field of the languages table ), I also have multi language support turned on.

Yes you are correct
www.museumreplicas.gr/index.php is loading the English links and language and
www.museumreplicas.gr/index.php/gr is loading the Greek

Here are a couple of issues I have...
When I turn to Greek lanquage I can not add a product category in Greek with more than 16 characters (ex.: a propper translation for the product category "CYCLADIC COLLECTION" is "ΚΥΚΛΑΔΙΚΗ ΣΥΛΛΟΓΗ") but instead of "ΚΥΚΛΑΔΙΚΗ ΣΥΛΛΟΓΗ" it is translated to "ΚΥΚΛΑΔΙΚΗ ΣΥΛΛΟΓ�"

When I call the Greek product categories links I get this browser error 310 (net::ERR_TOO_MANY_REDIRECTS): There were too many redirects.

Please advise
thanks
Agis
www.museumreplicas.gr
Authentic Greek museum replicas, Greek souvenirs, and jewellery related to ancient Greece

#3382   kevin197

kevin197
  • Members
  • 5 posts
  • Real Name:Kevin

Posted 28 July 2011 - 01:12 AM

Hi, I've just installed this mod and am getting

Fatal error: Cannot redeclare usu5_base_filename() (previously declared in /public_html/includes/application_top.php:52) in /public_html/includes/application_top.php on line 72

In application_top.php it says

  /**
  * 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_exists( 0, $matches ) )
									&& ( substr( $matches[0], -4, 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 ( ( ( strlen( ini_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();

  if ($request_type == 'NONSSL') {
	define('DIR_WS_CATALOG', DIR_WS_HTTP_CATALOG);
  } else {
	define('DIR_WS_CATALOG', DIR_WS_HTTPS_CATALOG);
  }

Is this correct? And if so can you give me a clue on where to look for the error?

Thanks

#3383   FWR Media

FWR Media
  • Community Sponsor
  • 6,836 posts
  • Real Name:Robert Fisher
  • Gender:Male
  • Location:Stowmarket - Suffolk - UK

Posted 28 July 2011 - 05:46 AM

View Postkevin197, on 28 July 2011 - 01:12 AM, said:

Hi, I've just installed this mod and am getting

Fatal error: Cannot redeclare usu5_base_filename() (previously declared in /public_html/includes/application_top.php:52) in /public_html/includes/application_top.php on line 72


Is this correct? And if so can you give me a clue on where to look for the error?

Thanks

To get rid of this error you just need to install it properly as per the instructions.

The error means that you have somehow added the usu5_base_filename() function twice.

#3384   32 Degrees

32 Degrees
  • Members
  • 229 posts
  • Real Name:Ryan
  • Gender:Male
  • Location:California, USA

Posted 28 July 2011 - 06:54 PM

Robert,

I'm using the latest release of ULTIMATE Seo Urls 5 Pro and came across a known error. My google webmaster tools informed me that all my child categories had duplicate links.

Example:
/discount-ladies-golf-discount-ladies-golf-outerwear-c-105_108.html
/discount-ladies-golf-discount-ladies-golf-outerwear-c-108.html


I searched through this support topic and found you posted a fix for someone else who also had this issue. If this is a universal case I wanted to recommend the inclusion of your fix in the next release. Here is a link for others having this same problem Updated validator.php

- Ryan

Edited by 32 Degrees, 28 July 2011 - 06:54 PM.


#3385   FWR Media

FWR Media
  • Community Sponsor
  • 6,836 posts
  • Real Name:Robert Fisher
  • Gender:Male
  • Location:Stowmarket - Suffolk - UK

Posted 28 July 2011 - 07:50 PM

View Post32 Degrees, on 28 July 2011 - 06:54 PM, said:

Robert,

I'm using the latest release of ULTIMATE Seo Urls 5 Pro and came across a known error. My google webmaster tools informed me that all my child categories had duplicate links.

Example:
/discount-ladies-golf-discount-ladies-golf-outerwear-c-105_108.html
/discount-ladies-golf-discount-ladies-golf-outerwear-c-108.html


- Ryan

Hi Ryan

Firstly please let me thank you for taking the time to read back through the support threads and finding the related topic rather than just posting your problem.

That particular file was to solve a localised redirect issue.

When you look at the two URIs

/discount-ladies-golf-discount-ladies-golf-outerwear-c-105_108.html
/discount-ladies-golf-discount-ladies-golf-outerwear-c-108.html

The problem is that they ARE duplicate content, two different URIs pointing to exactly the same page content.

This I currently view as a direct result of putting the same product in multiple categories.

If I have misunderstood the problem please let me know.


#3386   nafri

nafri
  • Members
  • 133 posts
  • Real Name:naf

Posted 29 July 2011 - 12:12 AM

hi

i got  small issue..
i am  using the latest version with only english language.

google has complained some of my url are non acessible.

they seem to have to the following characters in name

m²,®,®,£ etc

I have looked at the character_conversion_pack. i am not sure if that also applies to english language. in the config if i do .,..m²=>m2,®=>A,m²=>m2,®=>A,£=>p,then the page is accessible.

but for some reason if i add an other char  then  i get 404 error with the folloing in the url www.sitename.com/-p-36879.html .No product name.

I tried clearing cache but have no joy.

I found if  removed the whole Enter special character conversions. block .. the site works.

Do i need to create a file for the  english side aswell.I thought the contrib did this automatically.

kind regards

#3387   azpro

azpro
  • Members
  • 13 posts
  • Real Name:Arjan

Posted 31 July 2011 - 08:29 PM

Robert,

First of all ... Thank you for an absolute killer contribution! The best I have ever seen for OSC. Install very well documented and therefore simple.

All works fine, accept for the URL's for popup_image.php .... I read way back in the forum, tested with 2.2 and 2.3 (the last totally clean install) but I seem to miss the solution.

This is what I tried both in 2.2 and 2.3 - with cache and without cache:

echo '<a href="' . tep_href_link(FILENAME_POPUP_IMAGE,'pID=' . $product_info['products_id']) . '" >' .  tep_image_button('image_enlarge.gif', TEXT_CLICK_TO_ENLARGE) . '</a>'.'<br><br>';

<script type="text/javascript"><!--
      document.write('<?php echo '<a href="javascript:popupWindow(\\\'' . tep_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $product_info['products_id']) . '\\\')">' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], addslashes($product_info['products_name']), SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br />' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?>');
//--></script>

Hovering the links gives http://wwww.domain.com/popup_image.php?pID=16 ..... I suppose there is no need to add popup_image.php to /page_modules (allthough I tested this also) .. I looked over all the settings in debug-mode but no luck.

Any tips and help are appreciated!

Thank you,

Arjan

#3388   FWR Media

FWR Media
  • Community Sponsor
  • 6,836 posts
  • Real Name:Robert Fisher
  • Gender:Male
  • Location:Stowmarket - Suffolk - UK

Posted 31 July 2011 - 08:50 PM

View Postazpro, on 31 July 2011 - 08:29 PM, said:

Any tips and help are appreciated!

Thank you,

Arjan
Hmm .. it's a bit late and maybe I'm being "tired" but I don't believe the latest USU5 has a module for popup images ( as it is irrelevant )

Edited by FWR Media, 31 July 2011 - 08:50 PM.


#3389   azpro

azpro
  • Members
  • 13 posts
  • Real Name:Arjan

Posted 31 July 2011 - 10:01 PM

View PostFWR Media, on 31 July 2011 - 08:50 PM, said:

Hmm .. it's a bit late and maybe I'm being "tired" but I don't believe the latest USU5 has a module for popup images ( as it is irrelevant )

You are right! Late it is ... But I allready made some progress and indeed found out I need to make a popup_image.php in /page_modules ... I need it for backward compatibility with the old Chemo/Jack MCS url contribution  because Google unfortunately indexed some popup_image.php for products ... It shouldn't offcourse but it did ... and I don't want to loose those links ... I will be redirecting them later on, but now visitors get a 404 page which I don't like anyway ...

Anyhow ... I am now a bit struggling with the $dependencies query ... I need them like this : www.domain.com/brand-model-productsname-pi-xxx.html ...

I started with this (and it works fine):

    protected $dependencies = array( 'products_id' => array( 'marker'     => '-pi-', // like -p- or -c- etc
                                                             'query'      => "SELECT products_name FROM :TABLE_PRODUCTS_DESCRIPTION WHERE products_id=':products_id' AND language_id=':languages_id' LIMIT 1",
                                                             'to_replace' => array( ':TABLE_PRODUCTS_DESCRIPTION', ':products_id', ':languages_id' ) ) ); // TABLE_XXX and pID must match the line above

But now I need to put in the brand and model in the URL and an extra _GET key for image eg the url would be like:
www.domain.com/brand-model-productsname-pi-xxx.html?image=3

So if you could help me out (whenever you have some time) I would be thankful!

Arjan

Edited by azpro, 31 July 2011 - 10:03 PM.


#3390   azpro

azpro
  • Members
  • 13 posts
  • Real Name:Arjan

Posted 31 July 2011 - 11:43 PM

Ok ... I solved it and it's working great!

For those people who also want/need to keep using popup_image.php with SEO url .... altough I recommend to upgrade OSC2.3 ...

- Copy the code and save in folder /page_modules as popup_image.php
- The .htacces already has the line in it for rewriting the URL (if you have uri fromat rewrite in your admin settings) ... I only tested with rewrite!
- I changed the _GET key from pID to products_id in the javascript snippets:

<script type="text/javascript"><!--
      document.write('<?php echo '<a href="javascript:popupWindow(\\\'' . tep_href_link(FILENAME_POPUP_IMAGE, 'products_id=' . $product_info['products_id'].'&image=1') . '\\\')">' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], addslashes($product_info['products_name']), SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br />' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?>');
//--></script>

- It also works for additional images

  class Popup_Image_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 dependent _GET key ( e.g. -c- replaces cPath )
    * - 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
    * @example protected $dependencies = array( 'cPath' => array( 'marker'     => '-c-',
    * @var array $dependencies
    */

    protected $dependencies = array( 'products_id' => array( 'marker'     => '-pi-',
                                                             '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=':products_id' 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', ':products_id' ) ) );


    /**
    * 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, 'image'=> 1 ); // xxx = _GET key ( e.g. cPath ), you may want to add "page" if there are paging functions
    /**
    * Class constructor
    * @access private
    */
    private function __construct() {
    } // end constructor
    /**
    * Returns a singleton instance of this object
    *
    * @access public
    * @return Article_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() {
      $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
      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 = array( 'products_id' ); // xxx = _GET key ( e.g. cPath )
      $this->setAllParams( $page, $parameters, $add_session_id, $connection, $extract );
      if ( false === $this->validRequest() ) {
        $this->unsetProperties();
        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': // xxx = _GET key ( e.g. cPath )
          // This array contains replacements for the to_replace array ( see the $dependencies 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 false then we return nothing and set $page_not_found to true forcing a 404 page
      Usu_Main::i()->setVar( 'page_not_found', false );
      if ( false === $link_text ) {
        Usu_Main::i()->setVar( 'page_not_found', true );
        $this->unsetProperties();
        return;
      }
      // Return a fully built seo url
      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

Maybe Robert can comment on possible pitfalls!

Test first and use at own risk!


Cheers!

#3391   Critical_Impact

Critical_Impact
  • Members
  • 2 posts
  • Real Name:Terry

Posted 01 August 2011 - 09:10 AM

So I've followed the instructions, and repeated them to make sure I did everything right,

I get this error,

Fatal error: Call to undefined function tep_href_link() in /home/dawntest/public_html/includes/languages/english.php on line 635

Can anyone help me out?

#3392   FWR Media

FWR Media
  • Community Sponsor
  • 6,836 posts
  • Real Name:Robert Fisher
  • Gender:Male
  • Location:Stowmarket - Suffolk - UK

Posted 01 August 2011 - 09:18 AM

View PostCritical_Impact, on 01 August 2011 - 09:10 AM, said:

So I've followed the instructions, and repeated them to make sure I did everything right,

You need to check again as you haven't done everything right. The function tep_href_link() is missing from catalog/includes/functions/html_output.php

#3393   Critical_Impact

Critical_Impact
  • Members
  • 2 posts
  • Real Name:Terry

Posted 01 August 2011 - 01:25 PM

View PostFWR Media, on 01 August 2011 - 09:18 AM, said:

You need to check again as you haven't done everything right. The function tep_href_link() is missing from catalog/includes/functions/html_output.php

You were right for some reason the code was there but it had all been moved onto one line, so it was commented out. Not sure why that happened but It's working now. It didn't look like that on my work PC when I had notepad++ but when I opened it on my home PC it was formatted that way :P

#3394   toxmaster

toxmaster
  • Members
  • 1 posts
  • Real Name:Jürgen
  • Gender:Male
  • Location:Germany

Posted 01 August 2011 - 08:18 PM

@robert
thank you for your fantastic contrib and your great support

View Postomulec, on 20 July 2011 - 08:57 AM, said:

Any possibility/suggestion than to switch off USU5 on category URLs?

Anyway, thanks Robert. For both - contributions and being present in the support thread.

in the configuration of USU5 you have to set the value of "Force www.mysite.com/ when www.mysite.com/index.php" to false to get the YMM contrib working

#3395   misterbling

misterbling
  • Members
  • 142 posts
  • Real Name:Lee

Posted 02 August 2011 - 01:43 PM

Robert,

Upgraded to your Pro version.

Am getting an odd issue with forcing cookies on. If you clear out cookies in a browser, everything is fine until your second click the site redirects you to the index page. Assuming its a session issue since once this happens if you keep the cookie there are no further issues. Wondering if this has happened to someone before? Tried in html_output

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

  function tep_href_link( $page = '', $parameters = '', $connection = 'NONSSL', $add_session_id = false, $search_engine_safe = true ) {
	return Usu_Main::i()->hrefLink( $page, $parameters, $connection, $add_session_id, $search_engine_safe );
  }

But still experiencing the issue. This is a long thread and haven't seen this issue, please if I could be pointed in the right direction.

Thanks
Hip Hop Jewelry | Bling Bling | Iced Out

#3396   FWR Media

FWR Media
  • Community Sponsor
  • 6,836 posts
  • Real Name:Robert Fisher
  • Gender:Male
  • Location:Stowmarket - Suffolk - UK

Posted 02 August 2011 - 01:56 PM

View Postmisterbling, on 02 August 2011 - 01:43 PM, said:

Robert,

Upgraded to your Pro version.

Am getting an odd issue with forcing cookies on. If you clear out cookies in a browser, everything is fine until your second click the site redirects you to the index page. Assuming its a session issue since once this happens if you keep the cookie there are no further issues. Wondering if this has happened to someone before? Tried in html_output

But still experiencing the issue. This is a long thread and haven't seen this issue, please if I could be pointed in the right direction.

Thanks

You don't need to change USU5 files as there are no known issues currently.

I think you are looking in the wrong place for your problem.

There are only 3 situations where USU5 could affect a redirect. None of them are related to cookies.

1) Admin setting where www.mysite.com/index.php is redirected to www.mysite.com ( turn it off if on as this doesn't work on some servers ).
2) .htaccess RewriteRules - these are static so wouldn't create your problem.
3) Old seo urls redirecting to the new. Not related to cookies.

#3397   andygolf

andygolf
  • Members
  • 7 posts
  • Real Name:Andrew Goff

Posted 04 August 2011 - 12:01 AM

Hi Robert,

Thanks for all your hard work on this amazing contribution.

I've been trying to get Sage Pay Server working and have come across your post that says w3c style urls will cause problems with the redirect url. I tested with w3c urls switched off and it worked fine.

Is there any chance that there is a workaround to this problem that I've missed? I'd rather not switch off w3c urls because they look more professional.

Keep up the great work.

Andy

#3398   azpro

azpro
  • Members
  • 13 posts
  • Real Name:Arjan

Posted 06 August 2011 - 11:16 PM

Robert,

I did some more reading and experiments with SEO URL 5 and wondered if you could comment...

Would there be any SEO benefits with category URLs like parent/category-c-1.html instead of category URLs like parent-category-c-1.html which SEO URL 5 pro outputs now?

Reading a lot about this issue, I couldn't really decide, but I figured especially for large shops the separator slash could be a benefit ...

If you agree ... could you give a hint to fix the rewrite URL to parent/sub/category instead of parent-sub-category ?

Tnx!

Arjan

#3399   Gyakutsuki

Gyakutsuki
  • Members
  • 158 posts
  • Real Name:Loic Richard
  • Gender:Male
  • Location:Quebec

Posted 09 August 2011 - 02:32 PM

Hello,

It's possible to tell where is my error.

I created a new files blog_content.php (see an article) and create a new add on in pages_modules called blog_content.php

When I want to see my article, I have a page not found :

Quote

The requested URL /boutique/comportements-multicanaux-etudes-decouvrir-bl-26.html was not found on this server.
my original url :
http://www.mysite.com/boutique/blog_content.php?blog_content_id=26
Thanks.




Process :

I write in ht access this line :    
RewriteRule ^([a-z0-9/-]+)-bl-([0-9]+).html$ blog_content.php [NC,L,QSA]

and I write this module :

  class Blog_Content_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 dependent _GET key ( e.g. -c- replaces cPath )
	* - 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
	* @example protected $dependencies = array( 'cPath' => array( 'marker' 	=> '-c-',
	* @var array $dependencies
	*/
 //															'query'  	=> "SELECT pd.blog_content_name FROM :TABLE_BLOG_CONTENT_DESCRIPTION pd INNER JOIN :TABLE_BLOG_CONTENT p ON pd.blog_content_id = p.blog_content_id WHERE pd.blog_content_id=':blog_content_id' AND pd.language_id=':languages_id' LIMIT 1",
	protected $dependencies = array( 'blog_content_id' => array( 'marker' 	=> '-bl-',
												 			'query'  	=> "SELECT pd.blog_content_name FROM :TABLE_BLOG_CONTENT_DESCRIPTION pd where pd.blog_content_id=':blog_content_id' AND pd.language_id=':languages_id' LIMIT 1",
												 			'to_replace' => array( ':TABLE_BLOG_CONTENT_DESCRIPTION', ':TABLE_BLOG_CONTENT', ':blog_content_id', ':languages_id' ) ) );
	/**
	* 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( 'blog_content_id' => 1, 'reviews_id' => 1 ); // xxx = _GET key ( e.g. cPath ), you may want to add "page" if there are paging functions
	protected $cache_name_builder = array( 'blog_content_id' => 1); // xxx = _GET key ( e.g. cPath ), you may want to add "page" if there are paging functions

	/**
	* Class constructor
	* @access private
	*/
	private function __construct() {
	} // end constructor
	/**
	* Returns a singleton instance of this object
	* 
	* @access public
	* @return Blog_Content_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() {
  	$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
  	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 = array( 'blog_content_id' );
  	$this->setAllParams( $page, $parameters, $add_session_id, $connection, $extract );
  	if ( false === $this->validRequest() ) {
		$this->unsetProperties();
		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 == 'blog_content_id': // xxx = _GET key ( e.g. cPath )
	  	// This array contains replacements for the to_replace array ( see the $dependencies array )
	  	$this->setQuery( array( TABLE_BLOG_CONTENT_DESCRIPTION, TABLE_BLOG_CONTENT, $this->stripPathToLastNumber( $this->keys_index[$this->key] ), Usu_Main::i()->getVar( 'languages_id' ) ) );
	  	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 false then we return nothing and set $page_not_found to true forcing a 404 page
  	Usu_Main::i()->setVar( 'page_not_found', false );
  	if ( false === $link_text ) {
		Usu_Main::i()->setVar( 'page_not_found', true );
		$this->unsetProperties();
		return;
  	}
  	// Return a fully built seo url
  	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( $link_text ) ), $this->dependencies[$this->key]['marker'], $this->keys_index[$this->key] ) );
	} // end method

  } // end class


Edited by Gyakutsuki, 09 August 2011 - 02:35 PM.

-----------------------------------------
Regards

Loïc

#3400   Gyakutsuki

Gyakutsuki
  • Members
  • 158 posts
  • Real Name:Loic Richard
  • Gender:Male
  • Location:Quebec

Posted 09 August 2011 - 03:13 PM

[quote name='Gyakutsuki' timestamp='1312900366' post='1596754']
Hello,

It's possible to tell where is my error.

I created a new files blog_content.php (see an article) and create a new add on in pages_modules called blog_content.php

When I want to see my article, I have a page not found :
my original url :

Thanks.


Sorry, it works !!! :blush:
-----------------------------------------
Regards

Loïc