Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[CONTRIBUTION] Ultimate SEO URLs v2.1 - by Chemo


Recommended Posts

4 minutes ago, jampjamp said:

 

@raiwa No, old polish language files doesn't work correctly with bootstrap edition. My /polish/ is actually a copy of english language with some changes (not fully done, only part of front-end), so charset is set to be as default utf-8 (in includes/languages/polish.php and in admin/.. too).

Imported 2.2MS database tables were already converted to utf8_unicode_ci.

Do you have any other suggestions, please?

 

The setting:

// charset for web pages and emails
define('CHARSET', 'utf-8');

just tells the browser to render or decode your texts as utf-8. Another thing is that your texts (language files) are correct utf-8 encoded.

The old polnish language files are for sure encoded in old ISO-xxxxx, not utf-8.

You need first to make sure that your text editor uses utf-8, ( or by default or by changing the configuration setting) and then find a way to change the encoding, preserving that the special characters still show correct. To give more specific advice you need to tell us which text editor you are using.

 

Another subject is the database encoding and the correct rendering of the category and product names in the SEO URLs which are extracted from the database, not from the language files.

If you have converted the database tables to utf-8 encoding, check in PHP My Admin if the Category and Product names show correct the special characters in the correspondent tables.

Sometimes if you did some conversions in your old 2.2MS database to use utf-8 encoding in your shop, the encoding may get corrupted.

You must see in PHP my Admin all texts with special characters correct showing up.

rgds

Rainer

Link to comment
Share on other sites

Thanks for your interesting of my problem!

I'm not sure if I understood you right, but I'm not using old polish language files. They are not working good with bootstrap edition.

At first I was just using original english language with some changes like european date showing, but i didn't change anything like charset, because everything has been shown as it should.

As earlier I supposed that non-standard character conversion doesn't work with polish letters on english language, I've duplicated it with few changes to being recognised by oscommerce as polish, but it didn't help.

I'm using notepad++ and it shows that my lng files are coded in UTF-8 (without BOM).

Also, in PHPMyAdmin every letter is shown as it should be.

Please, look at my screen. Those are all polish letters. I've changed products_name directly in the database. As you can see, only ó=>o is working well. http://i.imgur.com/A16VoRH.jpg

Link to comment
Share on other sites

48 minutes ago, jampjamp said:

As earlier I supposed that non-standard character conversion doesn't work with polish letters on english language, I've duplicated it with few changes to being recognised by oscommerce as polish, but it didn't help.

Sorry, I do not understand what exact you wants to say here.

Otherwise, as far as I understand, all seems correct with your store and I can't see a reason that the SEO URL character conversion shouldn't work.

 

Maybe it would be helpful to have a look on your store if it's public available. If you do not wish to public it here, you can send me a private message.

 

rgds

Rainer

Link to comment
Share on other sites

@raiwa What I wanted to say there was that I thought the reason of problem could happen because i'm doing this at original english language, so SEO URLs addon doesn't handle another letters than eng standard. So I made polish language folder (based on english) to be used by osCommerce. Of course it didn't work.

My shop is not yet available by public, i'm testing it at localhost.
If you have any other idea what should I check, I'm determined to test it :)

@Jack_mcs Please, have a look-see at my screenshots too, maybe you would have any idea why could it happen: http://i.imgur.com/A16VoRH.jpg

Link to comment
Share on other sites

8 minutes ago, jampjamp said:

@raiwa What I wanted to say there was that I thought the reason of problem could happen because i'm doing this at original english language, so SEO URLs addon doesn't handle another letters than eng standard. So I made polish language folder (based on english) to be used by osCommerce. Of course it didn't work.

all language support in 2.3.4 BS is utf-8 based and all languages including english (files and database) should support all special characters.

8 minutes ago, jampjamp said:

My shop is not yet available by public, i'm testing it at localhost.

Date localization has known issues (doesn't work) on local test installations under windows, but the SEO URL stuff should work.

There must be something wrong in the setup, but without having a look on your store it is difficult to give further advice.

Maybe @Jack_mcshas an idea.

Edited by raiwa
Link to comment
Share on other sites

@jampjamp,

 

just to be sure: did you reset the SEO URL cache after adding the special characters to the configuration list

Edited by raiwa
Link to comment
Share on other sites

@jampjamp,

As stated, without a look on your store, I have no more ideas what to check. Maybe it would be helpful to post a screenshot of an example product with special characters in the name and the produced URL.

Link to comment
Share on other sites

1 hour ago, jampjamp said:

@Jack_mcs Please, have a look-see at my screenshots too, maybe you would have any idea why could it happen: http://i.imgur.com/A16VoRH.jpg

I don't understand what your image is showing. I see the characters in the setting and they look to be correct but what is the list of characters below it? And, just to be clear, the rewrite is for the url, not text on the page.

I don't know if it was mentioned anywhere in this thread but if you have the English language installed, does the rewrite work with it?

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

@Jack_mcs the list of characters below is a name of product compound only with typical Polish letters. 

In the bottom you can see a link generated by SEO URLs. It avoids most of Polish letters, except ó=>o. Do you have any idea why? 

 

/// conversion works as it should if I would put character like e=>u then in link I will have 'u'  instead of 'e'. The problem affects only specific Polish letters shown above 

Edited by jampjamp
Link to comment
Share on other sites

I'm still not clear on the distinctions you are making but I don't have any answers for you. I suggest you install a blank shop, install the addon and see if it works for English. If it fails right from the start with English, then something on the server is causing the problem. Otherwise, install the Polish language and try it. If it works, then convert your database and see if that works. Somewhere along the way you should be able to discover the problem.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

On 13.6.2017 at 8:04 PM, jampjamp said:

Thanks for that great contribution!

I have a little issue in working with BS 2.3.4 edge.

Looks like option "Enter special character conversions" doesn't work with polish letters.
I've tested and it works well on 2.2MS, but in this old revision file admin/includes/languages/polish.php specifies charset as iso-8859-2. If I set it to UTF-8 (as it is on BS 2.3.4) it stops to convert characters too.

I'm trying to set BS admin's language file into iso-8859-2, but then I can't even save my characters to convert (it saves as clear).

I've tried also to use unicodes instead of polish signs directly. For example U+017C=>z or c5 bc=>z or ż=>z instead of just ż=>z, but it didn't work.

Can you help me with that? :( It's important for me to get it work because i'm moving from old osC where it has worked and I want to keep old links as they were before.

Recommand read this:

 

  • The clever one learn from everything and from everybody
  • The normal one learn from his experience
  • The silly one knows everything better

[socrates, 412 before Christ]

Computers help us with the problems we wouldn't have without them!
99.9% of the bugs sit in front of the computer!
My programmed add-ons: WDW EasyTabs 1.0.3, WDW Facebook Like 1.0.0

if(isset($this) || !isset($this)){ // that's the question...

 

Link to comment
Share on other sites

@mcmannehan,

ULTIMATE SEO URLS5 is a different SEO URL add-on and character conversion pairs can be defined there in the external file you mention.

This possibility is not implemented in the version of thread: Ultimate SEO URLs v2.1 - by Chemo

 

Edited by raiwa
Link to comment
Share on other sites

@raiwa

Thanks for the info. I didn't saw that this is a different add-on. Sometimes can't see the trees, about the forest:cool:

  • The clever one learn from everything and from everybody
  • The normal one learn from his experience
  • The silly one knows everything better

[socrates, 412 before Christ]

Computers help us with the problems we wouldn't have without them!
99.9% of the bugs sit in front of the computer!
My programmed add-ons: WDW EasyTabs 1.0.3, WDW Facebook Like 1.0.0

if(isset($this) || !isset($this)){ // that's the question...

 

Link to comment
Share on other sites

 

On 15.06.2017 at 3:33 AM, Jack_mcs said:

I'm still not clear on the distinctions you are making but I don't have any answers for you. I suggest you install a blank shop, install the addon and see if it works for English. If it fails right from the start with English, then something on the server is causing the problem. Otherwise, install the Polish language and try it. If it works, then convert your database and see if that works. Somewhere along the way you should be able to discover the problem.

@Jack_mcs I've tried to install the addon on blank shop, but it didn't work. I've also tried to use another localhost server.

However, I installed addon mentioned by @mcmannehan and it looks like everything is as it should be. I didn't even use "file based character conversions" (as it's recommended in admin panel too) - works correctly without it.

So thank you guys, and Jack - please look at it in your addon.

Link to comment
Share on other sites

I tried it as you typed it and it failed for me too. But then I changed the name to use lower case and it worked:

nirosoft-explorer-p-818.html

It missed the middle word but I suspect it is also a case issue. Is there a case for €?

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

@Jack_mcs, @jampjamp,

Here the fix:

In: includes/classes/seo_class.php:

line 77 change:

        function ConnectDB(){
			    $this->link_id = mysqli_connect($this->host, $this->user, $this->pass, $this->db);
	    if (!$this->link_id) {
    die('Connect Error (' . mysqli_connect_errno() . ') '
		    . mysqli_connect_error());
}
        } # end function

to:

        function ConnectDB(){
			    $this->link_id = mysqli_connect($this->host, $this->user, $this->pass, $this->db);
			    mysqli_set_charset($this->link_id, 'utf8');
	    if (!$this->link_id) {
    die('Connect Error (' . mysqli_connect_errno() . ') '
		    . mysqli_connect_error());
}
        } # end function

line 1859 remove this:

                if (CHARSET == 'utf-8') {
                   $string =  iconv("ISO-8859-1", "UTF-8//TRANSLIT", $string);
                }

 

Example product title: Ñiçrosoft €βČčûæĂŠŤ Explorer

Result URL:nicrosoft-essccuaeast-explorer-p-26.html

replacement pairs: Ñ=>n,Ç=>c,ñ=>n,ç=>c,€=>e,β=>ss,Č=>c,č=>c,û=>u,æ=>ae,Ă=>a,Š=>s,Ť=>t

 

This will only work for OsCommerce versions since 2.3.3.4, full utf-8 support.

 

This may work for all versions (using sqli):

        function ConnectDB(){
			    $this->link_id = mysqli_connect($this->host, $this->user, $this->pass, $this->db);
          if (CHARSET == 'utf-8') mysqli_set_charset($this->link_id, 'utf8');
	    if (!$this->link_id) {
    die('Connect Error (' . mysqli_connect_errno() . ') '
		    . mysqli_connect_error());
}
        } # end function
                if (CHARSET != 'utf-8') {
                   $string =  iconv(CHARSET, "UTF-8//TRANSLIT", $string);
                }

rgds

Rainer

Edited by raiwa
Link to comment
Share on other sites

  • 3 weeks later...

I'm not familiar enough with SEO 5, which I assume is what you mean, so I can't say much about it. Raiwa Is probably better to answer in detail. But as long as you run SEO 5 in rewrite mode there's not a big difference, in my opinion. Running it in other modes is a mistake, as far as I'm concerned. This addon has problems on sites with very large number of products or categories if the caching option is used. SEO 5 will crash if cache gets too large. Or it used to - maybe that has been fixed. I think the code in this one is cleaner and less of a problem overall. If you turn this one off, it is totally turned off. But if you turn off SEO 5, it is only partially turned off.  

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

@vampirehunter,

In addition to Jacks observations:

Ultimate SEO URLs 2.2 by Chemo:

Pro:

  •           Easier installation – less file changes
  •           All included in one class file

Contra:

  •           Only one cache option: file cache – not sure if it’s a con
  •           Limited character encoding to ISO-8859-1 or other ISO character encodings at least in the actual version.  I posted the fix for full utf-8 support here:
  •           Character conversion pairs are only possible to define generic for all store languages. Some special characters have different transliterations in different languages. Example: “ä” should be transliterated to “ae” in German, but to ” a” in Turkish, “ü” should be transliterated to “ue” in German, but to “u” in Spanish and Catalan.
  •           In Multilanguage store the secondary language URLs are built only by the categories and products title translations, no specific language part in the path. Switching from one language to another is done like in core adding language html parameter to the URL (?language=de) which disappears once the language has been changed.
  •          No html language tags can be realized because of this. Google doesn’t validate html parameter for html language tags
  •         Additional custom pages are more difficult to add, even support for the most common add-ons which use additional pages, is included.

 

Ultimate SEO URL5 BS:

Pro:

  •           4 cache options, but sql cache got vulnerability issues reported by @Gergely:  https://www.oscommerce.com/forums/topic/336702-ultimate-seo-urls-5-by-fwr-media/?do=findComment&comment=1757817
  •           Claims to be faster than ULTIMATE SEO URLs 2 by Chemo, but I can’t check or confirm this point
  •           Full utf-8 character encoding support
  •           Separate character conversion lists for each language, so this can be realized: Example: “ä” should be transliterated to “ae” in German, but to ” a” in Turkish, “ü” should be transliterated to “ue” in German, but to “u” in Spanish and Catalan.
  •           In Multilanguage store the secondary language URLs are built by permanent language shortcut in the paths. Example: www.mystore/de/meine-kategorie-c-153.html , www.mystore/es/mi-producto-p-53.html
  •           html language tag support already included since BS version.
  •           Additional custom pages can be easy added copying and modifying an existing page file.

   Contra:

  •        installation requires a bit more file changes
  •        a lot of separate files -> more complicate to customize if needed.
  •        the issues mentioned by Jack

 

For sure there are more things, maybe other users can extend the list.

My recommendation – Resume: for one language stores I recommend ULTIMATER SEO URLs 2.2 by Chemo, for multilanguage stores and specifically stores in languages which include critical special character issues, ULTIMATE SEO URLs5 BS.

Hope this helps

Rainer

Edited by raiwa
Link to comment
Share on other sites

  • 3 weeks later...

Hi,

SEO URL does not work with PHP 7.0.21

instead of "productname-p-120.html" the URL will be "-p-120.html"

I tested it with PHP 5.5.38 and 5.6.31 => both versions are working

7.0.21 not.

Insert into cache could be a problem.
Working versions hava datas like pVlNb/M2DL7vV+zWDZiA2G7aBDsN2477wLCdB9VWYi2 in cache_data
NOT working version has "AwA="

Does anyone have a solution?
Sven

Link to comment
Share on other sites

In the includes/classes/seo.urls.php file, find these three lines (they are not together as shown)

function SEO_DataBase($host, $user, $db, $pass){
function SEO_URL_INSTALLER(){
function SEO_URL($languages_id){

And change them to

function __construct($host, $user, $db, $pass){
function __construct(){
function __construct($languages_id){

I can't currently test this so there may be other changes needed but those should help.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

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