Jump to content
FWR Media

ULTIMATE Seo Urls 5 - by FWR Media

Recommended Posts

I didn't have the trailing / before upgrading. It is hardcoded in filenames - define('FILENAME_HOME', '/');

 

Keep it like that and try the following:

 

In includes/functions/html_output.php

 

change this section

 

if ($connection == 'NONSSL') {

 

To read..

 

if ($page == '/') $page = '';

if ($connection == 'NONSSL') {

Edited by toyicebear

Share this post


Link to post
Share on other sites

Thank you for your reply. You're referring to a function that was replaced by the HTML href link wrapper function, therefore it is no longer there:

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


Absinthe Original Liquor Store

Share this post


Link to post
Share on other sites
Thank you for your reply. You're referring to a function that was replaced by the HTML href link wrapper function, therefore it is no longer there:

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

 

 

Then it looks like the file to make some edits to would be:

 

includes/modules/ultimate_seo_urls5/classes/usu.php

Share this post


Link to post
Share on other sites
Thank you for your quick reply, it doesn't work unfortunately:

 

Error!

 

Unable to determine the page link!

 

Enjoy your wine and have a great evening!

 

Yes the reason you are getting "Unable to determine the page link!" is in ...

 

includes/modules/ultimate_seo_urls5/includes/Usu_General_Functions.php

 

Lines 15 - 17 as below : -

 

	if (!tep_not_null($page)) {
  die('</td></tr></table></td></tr></table><br><br><font color="#ff0000"><b>Error!</b></font><br><br><b>Unable to determine the page link!<br><br>');
}

 

This guards the script against errors where an empty value is passed as the filename.

 

I think you could probably comment out this code to make it work but you would need to be aware that the safeguard no longer exists.

 

Hope that helps.

Share this post


Link to post
Share on other sites
Yes the reason you are getting "Unable to determine the page link!" is in ...

 

includes/modules/ultimate_seo_urls5/includes/Usu_General_Functions.php

 

Lines 15 - 17 as below : -

 

	if (!tep_not_null($page)) {
  die('</td></tr></table></td></tr></table><br><br><font color="#ff0000"><b>Error!</b></font><br><br><b>Unable to determine the page link!<br><br>');
}

 

This guards the script against errors where an empty value is passed as the filename.

 

I think you could probably comment out this code to make it work but you would need to be aware that the safeguard no longer exists.

 

Hope that helps.

 

Better to try this ..

define('FILENAME_HOME', 'aardwark');

 

includes/modules/ultimate_seo_urls5/includes/Usu_General_Functions.php

 

Find ..

 

	if (!tep_not_null($page)) {
  die('</td></tr></table></td></tr></table><br><br><font color="#ff0000"><b>Error!</b></font><br><br><b>Unable to determine the page link!<br><br>');
}

 

Add immediately below: -

 

  // Highly intelligent Aardwark mod
 if ( $page == 'aardwark' ) {
$page = '';
 }

Share this post


Link to post
Share on other sites

Hello Robert,

first of all congrats for this excellent contribution.

I'm aboslute beginner either oscomm or seo urls 5 so I apologie for any basic question.

I installed contribution and urls work fine, then start guide tells to install database and there I've some doubt.

Why I need to install a new db where oscomm has already installed its own?

Thanks

Share this post


Link to post
Share on other sites
Hello Robert,

first of all congrats for this excellent contribution.

I'm aboslute beginner either oscomm or seo urls 5 so I apologie for any basic question.

I installed contribution and urls work fine, then start guide tells to install database and there I've some doubt.

Why I need to install a new db where oscomm has already installed its own?

Thanks

 

Hi

 

No need to apologise, we all started somewhere.

 

It is not installing a new database, it is adding some entries to the existing database so that you will have administration options in your admin panel.

 

Hope that clarifies.

Share this post


Link to post
Share on other sites

Thank you Robert, it's all clear now.

 

Another short question related to SEO.

Do you think seo contributions have to be installed on a fresh Osc installation or it's better after you'll populate your site?

Can you suggest some SEO addon known to be effective on search engine optimization and userfriendly like yours?

Thanks again,

 

mario

Share this post


Link to post
Share on other sites
Thank you Robert, it's all clear now.

 

Another short question related to SEO.

Do you think seo contributions have to be installed on a fresh Osc installation or it's better after you'll populate your site?

Can you suggest some SEO addon known to be effective on search engine optimization and userfriendly like yours?

Thanks again,

 

mario

 

Hi again Mario

 

This is the support topic for this specific contribution .. if you want general advice please use the general forums.

Edited by FWR Media

Share this post


Link to post
Share on other sites

Hi there, Robert

 

Thanks for what I'm hoping will be our dream contribution. I'm trying to fit it to an old shop, and for the most part I think we're having some luck. I have a few questions if you have a moment.

 

It appears we're generating seo urls in the format

 

mysite.com/category-name-c-111.html?category=category%252name

 

Questions:

 

1. They are all 404-ing on me, and I've not yet found why. The urls appear to be correct format, but do not resolve. I don't see any errors in debug mode.

2. Is is possible to remove the ?category=category%252name

 

NOTE: these are subcategories

 

In a few instances where we have category names with 3 words such as "Good Green Stuff", the resulting url is mysite.com/stuff-c-111.html?category=good%252green It drops the first words in the category's name before the .html and drops the last word of the category's name when listed in the string after the ?

 

Would you have any pointers on how we can straighten it out? Thanks!

 

-Shaun

 

EDITED TO ADD: We've got the rewrite mod on, and the htaccess file and rewrite base all appear correct.

Edited by smartwork

Share this post


Link to post
Share on other sites
Hi there, Robert

 

Thanks for what I'm hoping will be our dream contribution. I'm trying to fit it to an old shop, and for the most part I think we're having some luck. I have a few questions if you have a moment.

 

It appears we're generating seo urls in the format

 

mysite.com/category-name-c-111.html?category=category%252name

 

Questions:

 

1. They are all 404-ing on me, and I've not yet found why. The urls appear to be correct format, but do not resolve. I don't see any errors in debug mode.

2. Is is possible to remove the ?category=category%252name

 

NOTE: these are subcategories

 

In a few instances where we have category names with 3 words such as "Good Green Stuff", the resulting url is mysite.com/stuff-c-111.html?category=good%252green It drops the first words in the category's name before the .html and drops the last word of the category's name when listed in the string after the ?

 

Would you have any pointers on how we can straighten it out? Thanks!

 

-Shaun

 

EDITED TO ADD: We've got the rewrite mod on, and the htaccess file and rewrite base all appear correct.

 

You are getting very odd results .. never seen anything like it before. I'd need to see the site in question .. send a link by pm if it is not for public consumption.

Share this post


Link to post
Share on other sites

Hi Shaun

 

I didn't realise the site was THAT old. It uses default.php instead of index.php and the what is now cPath in your site is ?category=

 

This means that without modification USU5 will not work with it.

 

Try opening up file ..

catalog/includes/modules/ultimate_seo_urls5/modules/Usu_Categories.php

 

and changing all instances of cPath to category.

 

I haven't a clue if you may encounter more problems as I have never worked with an osCommerce this old, therefore the contribution was not designed for it.

Edited by FWR Media

Share this post


Link to post
Share on other sites
Better to try this ..

define('FILENAME_HOME', 'aardwark');

 

includes/modules/ultimate_seo_urls5/includes/Usu_General_Functions.php

 

Find ..

 

	if (!tep_not_null($page)) {
  die('</td></tr></table></td></tr></table><br><br><font color="#ff0000"><b>Error!</b></font><br><br><b>Unable to determine the page link!<br><br>');
}

 

Add immediately below: -

 

  // Highly intelligent Aardwark mod
 if ( $page == 'aardwark' ) {
$page = '';
 }

Thank you, it worked. Is there a problem with feeds (google, yahoo, shopzilla, etc.)? As far as I understand, most of them have been revised to work with Ultimate SEO URLs 2.1d and they have include_once('../' .DIR_WS_CLASSES . 'seo.class.php'); coded in. Is there a safe way around it?


Absinthe Original Liquor Store

Share this post


Link to post
Share on other sites
Thank you, it worked. Is there a problem with feeds (google, yahoo, shopzilla, etc.)? As far as I understand, most of them have been revised to work with Ultimate SEO URLs 2.1d and they have include_once('../' .DIR_WS_CLASSES . 'seo.class.php'); coded in. Is there a safe way around it?

 

A number of contributions are hardcoded to use a particular url contribution (like usu series 2) as they have hardcoded it in it means a rewrite to use anything else.

 

It is thoroughly unnecessary to have hardcoded it in, most were hardcoded because they couldn't get around cron jobs disliking includes but all they had to do was use wget in the cron to access the file via apache then includes are just fine.

Share this post


Link to post
Share on other sites

Hi, Robert

 

i've installed your contrib since your first release and updated it to the last version.

 

But now I noticed that some of my top categories become after some time a wrong url.

 

e.g. http://www.my_great_site/categorie-c-31_29_33_41_34_32'>http://www.my_great_site/categorie-c-31_29_33_41_34_32

 

instead of http://www.my_great_site/categorie-c-31

 

but when i reset the usu5 cache all works as expected.

Unfortunately after a few klicks it went back to the messed up url.

 

for your help i am greatly appreciated.

 

SORRY for my english

 

regards

Harry

Share this post


Link to post
Share on other sites
But now I noticed that some of my top categories become after some time a wrong url.

 

e.g. http://www.my_great_site/categorie-c-31_29_33_41_34_32'>http://www.my_great_site/categorie-c-31_29_33_41_34_32

 

instead of http://www.my_great_site/categorie-c-31

 

but when i reset the usu5 cache all works as expected.

 

Hi Harry

 

I reported a problem with similar symptoms some time ago but Robert indicated to me that I was the only one with this problem and that it must be a problem with my own configuration. I think another person has since reported the same type of issue so that makes three of us now.

 

The problem I had only occurred with the category urls and it could be temporarily fixed by clearing the cache but then would happen again within a few hours.

 

If you figure out the problem, please post the solution so we may benefit.

 

Thanks

Share this post


Link to post
Share on other sites
Hi Harry

 

I reported a problem with similar symptoms some time ago but Robert indicated to me that I was the only one with this problem and that it must be a problem with my own configuration. I think another person has since reported the same type of issue so that makes three of us now.

 

The problem I had only occurred with the category urls and it could be temporarily fixed by clearing the cache but then would happen again within a few hours.

 

If you figure out the problem, please post the solution so we may benefit.

 

Thanks

 

Yes that is exactly the problem. But at the moment I don't have any clue, it goes far beyond my understanding of php.

 

I hope Robert will have a look at this issue.

 

If nevertheless i find out a solution, i will post it here

Share this post


Link to post
Share on other sites

Hi all

 

It is possible that these problems are occuring in limited cases because currently USU5 "believes" the cPath as provided by osCommerce to be correct in instances where it is in fact not correct, the current revision does not check the validity of each incoming cPath as it was thought an unnecessary overhead.

 

2fix4u

 

I have a prototype file available which checks the incoming cPath if you send me an email at admin(at)fwrmedia(dot)co(dot)uk I will send the file and perhaps you could test it for me to see if it alleviates the issue.

Share this post


Link to post
Share on other sites

I am setting up a new shop. Installed seo header tags then added this contribution usu5.

 

When i check the urls in firefox everything is ok.

 

When i do the same in Internet Explorer http://lasure-bois.com/oscommerce-2.2rc1-F...talog/index.php

 

works fine then when i go to categories, the links are ok but the images and stylesheets dont show up properly.

 

The links in the other boxes Informations, Meilleures ventes etc ... are ok.

 

If i turn off Enable SEO URLs everything works fine again.

 

Could someone point me in the right direction ?

 

Thanks

Share this post


Link to post
Share on other sites
I am setting up a new shop. Installed seo header tags then added this contribution usu5.

 

When i check the urls in firefox everything is ok.

 

When i do the same in Internet Explorer http://lasure-bois.com/oscommerce-2.2rc1-F...talog/index.php

 

works fine then when i go to categories, the links are ok but the images and stylesheets dont show up properly.

 

The links in the other boxes Informations, Meilleures ventes etc ... are ok.

 

If i turn off Enable SEO URLs everything works fine again.

 

Could someone point me in the right direction ?

 

Thanks

 

There is a post about this somewhere here. If I remember correctly header tags uses $PHP_SELF which is returning an seo url where the header tags script is expecting a filename.

Share this post


Link to post
Share on other sites
There is a post about this somewhere here. If I remember correctly header tags uses $PHP_SELF which is returning an seo url where the header tags script is expecting a filename.

 

Hi Robert

I also set up another shop using USU 5 I use Enable SEO URLs? true and have no problem.

Share this post


Link to post
Share on other sites
Hi Robert

I also set up another shop using USU 5 I use Enable SEO URLs? true and have no problem.

 

It's hard for me to comment Mark.

 

Logically all this contribution does is produce seo uris via the correct tep_href_link() wrapper, it should not affect any other contribution in any way. It certainly wouldn't affect html/style.

 

The only core code changed is in application_top where the spoofable $PHP_SELF is replaced with the safe $_SERVER['SCRIPT_NAME'] this does not affect osCommerce which uses $PHP_SELF to store the filename but there seems to be something in header tags which doesn't like it (having never used header tags I wouldn't know where).

Share this post


Link to post
Share on other sites
Hi all

 

It is possible that these problems are occuring in limited cases because currently USU5 "believes" the cPath as provided by osCommerce to be correct in instances where it is in fact not correct, the current revision does not check the validity of each incoming cPath as it was thought an unnecessary overhead.

 

2fix4u

 

I have a prototype file available which checks the incoming cPath if you send me an email at admin(at)fwrmedia(dot)co(dot)uk I will send the file and perhaps you could test it for me to see if it alleviates the issue.

 

It has now been confirmed that a prototype Usu_Categories.php solves the issues that certain users have been having where USU5 was "believing" invalid cPaths. I will be repackaging a new revision over the weekend.

 

This new revision will not only include this new file but all modules will be reworked based on the same new template, this uniformity should make it easy for developers of contributions to create their own modules.

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

×