Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

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


Recommended Posts

Okay. call me a vampire if you must but I've been searching all over the place for the html_output.php code mods for Ultimate SEO URLs COMBINED WITH Page cache contribution - 'both' by Chemo

Google provided two code snippets one each for CRE & Zen, nothing found for standard OSC even though I've downloaded and searched a half dozen versions of Ultimate SEO URLs and Page cache.

 

In our case we've had Ultimate SEO URLs v2.1 running for 2 years, it's the page cache I'm trying to add now.

 

our existing html_output.php

// Ultimate SEO URLs v2.1
// 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;		
	if ( !is_object($seo_urls) ){
		if ( !class_exists('SEO_URL') ){
			include_once(DIR_WS_CLASSES . 'seo.class.php');
		}
		global $languages_id;
		$seo_urls = new SEO_URL($languages_id);
	}
return $seo_urls->href_link($page, $parameters, $connection, $add_session_id);
 }

so (from instructions for Page Cache v1.5) of course there is nothing to "FIND"

global $request_type, $session_started;

And REPLACE it with this code

global $request_type, $session_started, $SID;

Find this code in tep_href_link():

if (isset($_sid)) {
  $link .= $separator . $_sid;
  }

And REPLACE it with this code:

if (!tep_session_is_registered('customer_id') && ENABLE_PAGE_CACHE == 'true' && class_exists('page_cache')) {
  $link .= $separator . '<osCsid>';
  } elseif (isset($_sid)) {
  $link .= $separator . $_sid;
  }

I'm sure I've searched everywhere and probably just missed it, but if anyone could be so kind I imagine I'm not the only idiot who can't find this to save my life.

Link to comment
Share on other sites

I'm sure I've searched everywhere and probably just missed it, but if anyone could be so kind I imagine I'm not the only idiot who can't find this to save my life.

 

The code you are looking for was removed when you installed Ultimate SEO URLs

Link to comment
Share on other sites

One of the instructions for this contribution is to replace the tep_href_link() function in catalog/includes/functions/html_output.php.

 

Directly below that function is the tep_image function. It looks like you overwrote two functions not just the one.

 

Find the tep_image function from a fresh catalog/includes/functions/html_output.php and put it below the tep_href_link function in your current file.

Thank you very much for your prompt response and this great contribution. The contribution is now working. I have two minor issues. The add to cart link that I have on the index page is not working. <a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=41' . $listing['products_id'], 'NONSSL') . '">' . tep_image_button('button_buy_now.gif', TEXT_BUY . $listing['products_name'] . TEXT_NOW) . '</a>

 

I also notice that in IE I am getting sids.

 

Thanks much!

 

PS: I can't seem to find the donation link, please post it.

Link to comment
Share on other sites

The code you are looking for was removed when you installed Ultimate SEO URLs

Exactly! But I find it difficult to believe I would be the first one running both Page Cache and Ultimate SEO on the same site. There must be a fairly common way to code html_output.php so that both will function.

 

As I mentioned, I found both CRE & Zen versions for combining the two Chemo contribs - the oscommerce version has so far eluded all my searches.

Link to comment
Share on other sites

Well, I have this weird problem with my categories and subcategories, and I am wondering if anybody can help.

 

My site is www.leotards.ca - Currently, I only have a number of top categories. For example:

http://www.leotards.ca/catalog/bodysuits-leotards-c-1.html

http://www.leotards.ca/catalog/unitards-c-7.html

 

 

Let's say I want to add a subcategory. I have a category "Bargains", and I want to add a subcategory, "Too good to be true". I do so via the OSCommerce admin.

 

When I look at my left menu, I see the sub-category "Too good to be true" listed under "Bargains". Hovering over, I see that their respective URLS are:

http://www.leotards.ca/catalog/bargains-c-111.html

http://www.leotards.ca/catalog/good-true-c-111_121.html

 

As long as I click on any top categories, all is well. The problem occurs if I want to see "Too good to be true". Once I reach that category, all the other top category URLs are changes; they all have "c-111-121" included: We get:

http://www.leotards.ca/catalog/bodysuits-l...-111_121_1.html

http://www.leotards.ca/catalog/unitards-c-111_121_7.html

etc.

 

Now, that's not really a big problem for the clients, as they reach the right page anyway. But!

 

1 - That is a problem for search engines, who now survey he same page under different URLs, and more importantly:

2 - If I try to click back on the "Bargains" top category, I get the "Too good to be true" page. The URL for Bargains seems now to be http://www.leotards.ca/catalog/bargains-c-111_121_111.html

 

How weird is that??? Anybody with any idea what this issue is, how to fix it?

 

Thanks a bunch

 

L.P. aka Zorglubsky

Link to comment
Share on other sites

One of the instructions for this contribution is to replace the tep_href_link() function in catalog/includes/functions/html_output.php.

 

Directly below that function is the tep_image function. It looks like you overwrote two functions not just the one.

 

Find the tep_image function from a fresh catalog/includes/functions/html_output.php and put it below the tep_href_link function in your current file.

Hi, I found a fix to the add to cart button on the index page. I now have a different issue. In IE when I click on add to cart from product listing page, it clears everything that is in the cart but it works fine in Firefox. Both were working prior to install of SEO URL.

 

Many thanks for all the help.

 

Martha

Link to comment
Share on other sites

Exactly! But I find it difficult to believe I would be the first one running both Page Cache and Ultimate SEO on the same site. There must be a fairly common way to code html_output.php so that both will function.

 

As I mentioned, I found both CRE & Zen versions for combining the two Chemo contribs - the oscommerce version has so far eluded all my searches.

 

All of chemos contributions work with each other.

 

Page cache support is included within the seo.class.php.

Link to comment
Share on other sites

All of chemos contributions work with each other.

 

Page cache support is included within the seo.class.php.

 

Thanks FWR, does that mean no changes to html_output.php will result in both contributions working anyway? That might be why I can't seem to find it. (And I must admit I haven't tried it.)

 

The coding for zen & cre involved additional 'if' statements and I thought somewhere along the way I saw that advice given regarding oscommerce, with no examples or code snippets for the unwashed masses.

I've come across several dead end threads where the same questions I'm asking have gone unanswered too long on this great website.

Can't someone point me to the code - if it exists?

Link to comment
Share on other sites

How about solving problem with multilanguage sites, Zorglubsky's site also suffers from this: when you have product_info.php open and choose another language from the languages box, product info in another language opens, however links in the language box are incorrect - current language link contains SEO url from the last language, e.g., we have links like "...bodysuit?language=en" and "...bodysuit&language=fr", "...bodysuit" should be show translated into the French language. I tried to debug, but to no avail...

Anyone has fixed this?

Link to comment
Share on other sites

Hi I just added this application to my cart everything seems fine until I try to check out i get this error.

 

Warning: Cannot modify header information - headers already sent by (output started at /home/thebrass/public_html/includes/application_top.php:1081) in /home/thebrass/public_html/includes/functions/general.php on line 33

 

any help is appreciated

Link to comment
Share on other sites

Hi I just added this application to my cart everything seems fine until I try to check out i get this error.

 

Warning: Cannot modify header information - headers already sent by (output started at /home/thebrass/public_html/includes/application_top.php:1081) in /home/thebrass/public_html/includes/functions/general.php on line 33

 

any help is appreciated

 

Nothing to do with this contribution .. check those files for whitespace at the very top and very bottom of the files.

Link to comment
Share on other sites

Thanks tried removing the white space, and tested again. Though for a minute it was fixed then i logged out and then tried to checkout and the problem returned, it also throws the same error if i click to login which suggests it is the login page that is causing the problems, as the checkout button would take you to the login page when I was not logged in.

 

I have these contributions installed.

 

Light box for images

A couple of extra shipping modules

The catagories menu has been modified

(sorry i cant remember the exact names of these contribs)

 

Would these conflict with ultimate SEO?

Edited by gavztheouch
Link to comment
Share on other sites

What am I doing wrong?

 

I ran a fresh copy of osc 2.2rc2a. I installed 2.1d to the letter.

I changed the director in .htaccess to read my directory name.

I put .php files in correct place. I changed correct PHP code.

 

When i try and open osc's index page I get something like this

 

host = $host; $this->user = $user; $this->db = $db; $this->pass = $pass; $this->ConnectDB(); $this->SelectDB(); } # end function /** * Function to connect to MySQL * @author Bobby Easland * @version 1.1 */ function ConnectDB(){ $this->link_id = mysql_connect($this->host, $this->user, $this->pass); } # end function /** * Function to select the database * @author Bobby Easland * @version 1.0 * @return resoource */ function SelectDB(){ return mysql_select_db($this->db); } # end function /** * Function to perform queries * @author Bobby Easland * @version 1.0 * @param string $query SQL statement * @return resource */ function Query($query){ return @mysql_query($query, $this->link_id); } # end function /** * Function to fetch array * @author Bobby Easland * @version 1.0 * @param resource $resource_id * @param string $type MYSQL_BOTH or MYSQL_ASSOC * @return array */ function FetchArray($resource_id, $type = MYSQL_BOTH){ return @mysql_fetch_array($resource_id, $type); } # end function /** * Function to fetch the number of rows * @author Bobby Easland * @version 1.0 * @param resource $resource_id * @return mixed */ function NumRows($resource_id){ return @mysql_num_rows($resource_id); } # end function /** * Function to fetch the last insertID * @author Bobby Easland * @version 1.0 * @return integer */ function InsertID() { return mysql_insert_id(); } /** * Function to free the resource * @author Bobby Easland * @version 1.0 * @param resource $resource_id * @return boolean */ function Free($resource_id){ return @mysql_free_result($resource_id); } # end function /** * Function to add slashes * @author

 

 

 

Pages on top of pages of this craziness. What do you think is wrong?

Link to comment
Share on other sites

What am I doing wrong?

 

I ran a fresh copy of osc 2.2rc2a. I installed 2.1d to the letter.

I changed the director in .htaccess to read my directory name.

I put .php files in correct place. I changed correct PHP code.

 

When i try and open osc's index page I get something like this

 

host = $host; $this->user = $user; $this->db = $db; $this->pass = $pass; $this->ConnectDB(); $this->SelectDB(); } # end function /** * Function to connect to MySQL * @author Bobby Easland * @version 1.1 */ function ConnectDB(){ $this->link_id = mysql_connect($this->host, $this->user, $this->pass); } # end function /** * Function to select the database * @author Bobby Easland * @version 1.0 * @return resoource */ function SelectDB(){ return mysql_select_db($this->db); } # end function /** * Function to perform queries * @author Bobby Easland * @version 1.0 * @param string $query SQL statement * @return resource */ function Query($query){ return @mysql_query($query, $this->link_id); } # end function /** * Function to fetch array * @author Bobby Easland * @version 1.0 * @param resource $resource_id * @param string $type MYSQL_BOTH or MYSQL_ASSOC * @return array */ function FetchArray($resource_id, $type = MYSQL_BOTH){ return @mysql_fetch_array($resource_id, $type); } # end function /** * Function to fetch the number of rows * @author Bobby Easland * @version 1.0 * @param resource $resource_id * @return mixed */ function NumRows($resource_id){ return @mysql_num_rows($resource_id); } # end function /** * Function to fetch the last insertID * @author Bobby Easland * @version 1.0 * @return integer */ function InsertID() { return mysql_insert_id(); } /** * Function to free the resource * @author Bobby Easland * @version 1.0 * @param resource $resource_id * @return boolean */ function Free($resource_id){ return @mysql_free_result($resource_id); } # end function /** * Function to add slashes * @author

 

 

 

Pages on top of pages of this craziness. What do you think is wrong?

 

I figured it out. The new PHP syntax must require <?php ?> code brakets. lol

Link to comment
Share on other sites

Thanks FWR, does that mean no changes to html_output.php will result in both contributions working anyway? That might be why I can't seem to find it. (And I must admit I haven't tried it.)

 

The coding for zen & cre involved additional 'if' statements and I thought somewhere along the way I saw that advice given regarding oscommerce, with no examples or code snippets for the unwashed masses.

I've come across several dead end threads where the same questions I'm asking have gone unanswered too long on this great website.

Can't someone point me to the code - if it exists?

 

Hi

I can give you the code for html output.php ultimate seo version D plus page cache. The only thing is I have also got automatic Thumbnail from Emmett Brosnan installed in the html output the only file changed for this contribution is the html output the idea is to speed the page loading time.So you would either have to install this with the page cache or pick out the bits of code you need for page cache.

John

To improve is to change; to be perfect is to change often.

 

Link to comment
Share on other sites

I now am having the same problem as him, except I don't have any other contributions loaded.

 

 

I figured it out. I did so with the help of everyone on this thread. I'm running Apache 2.2.9 on a vista machine and a XP Pro. Within the config folder located in the default location C:\Program Files\Apache Software Foundation\Apache2.2, I made a change within the config.http file. Look for a line towards the lower end of the middle starting with

 

#

# Note that from this point forward you must specifically allow

# particular features to be enabled - so if something's not working as

# you might expect, make sure that you have specifically enabled it

# below.

#

 

from within the <directory> tags find a line that reads

 

#

# AllowOverride controls what directives may be placed in .htaccess files.

# It can be "All", "None", or any combination of the keywords:

# Options FileInfo AuthConfig Limit

#

AllowOverride None

 

 

change AllowOverride None

to

AllowOverride All

 

What did I just do? You ask. I have no freekin clue....

Link to comment
Share on other sites

Hi

I can give you the code for html output.php ultimate seo version D plus page cache. The only thing is I have also got automatic Thumbnail from Emmett Brosnan installed in the html output the only file changed for this contribution is the html output the idea is to speed the page loading time.So you would either have to install this with the page cache or pick out the bits of code you need for page cache.

John

 

Thanks John, please do send me a copy by using the "send message", (I'm much better at taking code apart than putting it together from scratch).

 

Note for anyone who might be following the course I'm on ~ finding html_output.php code for Ultimate SEO URLs COMBINED WITH Page Cache v1.5

As pointed out by FWR Media, and here you might not have to alter the code.

I've also come across the opinion that combining Page Cache with Chemo's SEO isn't a good idea because PC isn't a dynamic mod, and everything else about OSC pretty much is.

Link to comment
Share on other sites

Well, I have this weird problem with my categories and subcategories, and I am wondering if anybody can help.

 

My site is www.leotards.ca - Currently, I only have a number of top categories. For example:

http://www.leotards.ca/catalog/bodysuits-leotards-c-1.html

http://www.leotards.ca/catalog/unitards-c-7.html

 

 

Let's say I want to add a subcategory. I have a category "Bargains", and I want to add a subcategory, "Too good to be true". I do so via the OSCommerce admin.

 

When I look at my left menu, I see the sub-category "Too good to be true" listed under "Bargains". Hovering over, I see that their respective URLS are:

http://www.leotards.ca/catalog/bargains-c-111.html

http://www.leotards.ca/catalog/good-true-c-111_121.html

 

As long as I click on any top categories, all is well. The problem occurs if I want to see "Too good to be true". Once I reach that category, all the other top category URLs are changes; they all have "c-111-121" included: We get:

http://www.leotards.ca/catalog/bodysuits-l...-111_121_1.html

http://www.leotards.ca/catalog/unitards-c-111_121_7.html

etc.

 

Now, that's not really a big problem for the clients, as they reach the right page anyway. But!

 

1 - That is a problem for search engines, who now survey he same page under different URLs, and more importantly:

2 - If I try to click back on the "Bargains" top category, I get the "Too good to be true" page. The URL for Bargains seems now to be http://www.leotards.ca/catalog/bargains-c-111_121_111.html

 

How weird is that??? Anybody with any idea what this issue is, how to fix it?

 

Thanks a bunch

 

L.P. aka Zorglubsky

 

 

And also...

 

What are the new db fields "products_seo_url" and "categories_seo_url" used for? I've noticed that they are not getting populated at all. Should they be?

 

Thanks

Link to comment
Share on other sites

And also...

 

What are the new db fields "products_seo_url" and "categories_seo_url" used for? I've noticed that they are not getting populated at all. Should they be?

 

Thanks

 

We've had our site running for several years. (we also have a development server where I can play coding games without worry).

Our fairly large catalog - over 3000 categories - 4 levels deep, Point of reference;

 

One of 14 top categories

http://www.~~.com/plumbing-c-22.html

 

One of 19 plumbing subs

http://www.~~.com/plumbing-pipe-fittings-types-c-22_204.html

 

one of 10 pipe fittings subs

http://www.~~.com/pipe-fittings-types-blac...22_204_206.html

 

one of 16 black iron fittings subs

http://www.~~.com/black-iron-fittings-blac...4_206_2563.html

 

Looks something like the way your site is working doesn't it? Keep in mind customers don't usually know or care about urls for categories, and search engines mostly are concerned with the product url not the category.

 

"the new db fields "products_seo_url" and "categories_seo_url"" you asked about sound like rows in the configuration table. They are settings you can adjust from admin/configuration/SEO URLs

 

Hope that helps.

 

Note; for some the reason the longer urls as displayed here get truncated, hover your mouse to see the real thing.

Edited by motorcity
Link to comment
Share on other sites

We've had our site running for several years. (we also have a development server where I can play coding games without worry).

Our fairly large catalog - over 3000 categories - 4 levels deep, Point of reference;

 

One of 14 top categories

http://www.~~.com/plumbing-c-22.html

 

One of 19 plumbing subs

http://www.~~.com/plumbing-pipe-fittings-types-c-22_204.html

 

one of 10 pipe fittings subs

http://www.~~.com/pipe-fittings-types-blac...22_204_206.html

 

one of 16 black iron fittings subs

http://www.~~.com/black-iron-fittings-blac...4_206_2563.html

 

Looks something like the way your site is working doesn't it? Keep in mind customers don't usually know or care about urls for categories, and search engines mostly are concerned with the product url not the category.

 

"the new db fields "products_seo_url" and "categories_seo_url"" you asked about sound like rows in the configuration table. They are settings you can adjust from admin/configuration/SEO URLs

 

Hope that helps.

 

Note; for some the reason the longer urls as displayed here get truncated, hover your mouse to see the real thing.

 

 

Thanks, I appreciate the time you took to answer my post.

 

But your answer does not actually address the real problem, i.e. not being able to reach the top category once I have looked at the sub-category. And it does not actually tell me what the db fields are for.

 

Thanks again.

Link to comment
Share on other sites

I moved my site to a new temp DNS. Come Tuesday, the actual www account will be ready. This will happen when I change the server names Monday. Any, My problem is that everything seems to work with the exception of the SEO for the products. Please take a look at the site: Visit My Website, in the catagories when you click or hover over them, please look at the bottom of the browser. I get this wierd osc extenstion and just cannot figure this out. Please help.

Edited by ctec2001

Do or Do Not, there is no try.

Link to comment
Share on other sites

I moved my site to a new temp DNS. Come Tuesday, the actual www account will be ready. This will happen when I change the server names Monday. Any, My problem is that everything seems to work with the exception of the SEO for the products. Please take a look at the site: Visit My Website, in the catagories when you click or hover over them, please look at the bottom of the browser. I get this wierd osc extenstion and just cannot figure this out. Please help.

 

What have you set as RewriteBase in .htaccess?

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