Jump to content


Corporate Sponsors


Latest News: (loading..)

* * * * * 12 votes

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


6505 replies to this topic

#3021 Bushmaster

  • Community Member
  • 456 posts
  • Real Name:Scott McFadden
  • Gender:Male

Posted 29 August 2008, 14:16

View PostMANDY1, on Aug 29 2008, 06:13 AM, said:

Hello!
Having v2.1d updated (and working fine) I need to add code to the htaccess to block a couple nasty IP's are spamming and one of which is even noted by Symentec as injecting viruses. The IP banning contribs do not exclude all the pages even though they pretend to with the addition in application-top.

So my question is, how to insert the code in the .htaccess file with all the rewrites. It seems to me that normally the code would be something like :

order allow,deny
deny from xx.xx.xx.xx
allow from all

But not being sure if that is the way nor how to place it I would love some advice.

Thank you in advance for your help.

Mandy


That is it.

#3022 MANDY1

  • Community Member
  • 40 posts
  • Real Name:Mindy Burke

Posted 29 August 2008, 14:23

[quote name='Bushmaster' date='Aug 29 2008, 03:16 PM' post='1299479']
That is it.
[/quote

Hello Bushmaster,

Where would I insert it in the .ht access, before all the rewrites or after?

#3023 Bushmaster

  • Community Member
  • 456 posts
  • Real Name:Scott McFadden
  • Gender:Male

Posted 29 August 2008, 15:16

I don't ever recall that anyone specified where it needed to go. I would add it near the top. Here is a nice guide.
http://www.javascriptkit.com/howto/htaccess.shtml

#3024 MANDY1

  • Community Member
  • 40 posts
  • Real Name:Mindy Burke

Posted 29 August 2008, 16:32

View PostBushmaster, on Aug 29 2008, 04:16 PM, said:

I don't ever recall that anyone specified where it needed to go. I would add it near the top. Here is a nice guide.
http://www.javascriptkit.com/howto/htaccess.shtml


Thank you Bushmaster, I'll give it a try. Was just worried since I'm not really sure of the interaction with all the rewrite rules.

Have a good day!

Mandy

#3025 MANDY1

  • Community Member
  • 40 posts
  • Real Name:Mindy Burke

Posted 29 August 2008, 17:30

OOPS! That caused an internal Server Error! Where do I go from here!!! Wish I understood more about .htaccess which is really all greek to me.

Mandy

#3026 joytotheworld

  • Community Member
  • 15 posts
  • Real Name:martha

Posted 31 August 2008, 04:00

Hi, I just installed the SEO URL but I am getting a fatal error. I don't know what I did wrong. Here is the error message: Fatal error: Call to undefined function: tep_image() in /home/xxxxx/public_html/includes/languages/english.php on line 290.

Thanking you in advance for your help.

Martha

#3027 FWR Media

  • Community Member
  • 6,463 posts
  • Real Name:Robert Fisher
  • Gender:Male
  • Location:Stowmarket - Suffolk - UK

Posted 31 August 2008, 09:11

View Postjoytotheworld, on Aug 31 2008, 05:00 AM, said:

Hi, I just installed the SEO URL but I am getting a fatal error. I don't know what I did wrong. Here is the error message: Fatal error: Call to undefined function: tep_image() in /home/xxxxx/public_html/includes/languages/english.php on line 290.

Thanking you in advance for your help.

Martha


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.
Ultimate SEO Urls 5 PRO - Multi Language Modern, Powerful SEO Urls

KissMT Dynamic SEO Meta & Canonical Header Tags

KissER Error Handling and Debugging

If you found my post useful please click the green + sign to the right

Please only PM me for paid work.


#3028 motorcity

  • Community Member
  • 179 posts
  • Real Name:Joe
  • Location:Detroit, Michigan USA

Posted 31 August 2008, 12:20

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.

#3029 Coopco

  • Community Member
  • 9,557 posts
  • Real Name:Leslie Cooper
  • Gender:Male
  • Location:Sea Lake, Victoria, Australia

Posted 31 August 2008, 13:19

View Postmotorcity, on Aug 31 2008, 10:20 PM, said:

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


The Coopco Underwear Shop



If you live to be 100 years of age, that means you have lived for 36,525 days. Don't waste another, there aren't many left.

#3030 joytotheworld

  • Community Member
  • 15 posts
  • Real Name:martha

Posted 31 August 2008, 15:42

View PostFWR Media, on Aug 31 2008, 09:11 AM, said:

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.

#3031 motorcity

  • Community Member
  • 179 posts
  • Real Name:Joe
  • Location:Detroit, Michigan USA

Posted 31 August 2008, 18:34

View PostCoopco, on Aug 31 2008, 09:19 AM, said:

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.

#3032 Zorglubsky

  • Community Member
  • 4 posts
  • Real Name:L.P. Hemond

Posted 31 August 2008, 19:19

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

#3033 joytotheworld

  • Community Member
  • 15 posts
  • Real Name:martha

Posted 31 August 2008, 20:51

View PostFWR Media, on Aug 31 2008, 10:11 AM, said:

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

#3034 FWR Media

  • Community Member
  • 6,463 posts
  • Real Name:Robert Fisher
  • Gender:Male
  • Location:Stowmarket - Suffolk - UK

Posted 31 August 2008, 21:55

View Postmotorcity, on Aug 31 2008, 07:34 PM, said:

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.
Ultimate SEO Urls 5 PRO - Multi Language Modern, Powerful SEO Urls

KissMT Dynamic SEO Meta & Canonical Header Tags

KissER Error Handling and Debugging

If you found my post useful please click the green + sign to the right

Please only PM me for paid work.


#3035 motorcity

  • Community Member
  • 179 posts
  • Real Name:Joe
  • Location:Detroit, Michigan USA

Posted 31 August 2008, 23:42

View PostFWR Media, on Aug 31 2008, 05:55 PM, said:

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?

#3036 kshop

  • Community Member
  • 29 posts
  • Real Name:A
  • Gender:Male

Posted 02 September 2008, 19:06

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?

#3037 gavztheouch

  • Community Member
  • 22 posts
  • Real Name:Gavin Armstrong

Posted 02 September 2008, 20:55

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

#3038 FWR Media

  • Community Member
  • 6,463 posts
  • Real Name:Robert Fisher
  • Gender:Male
  • Location:Stowmarket - Suffolk - UK

Posted 02 September 2008, 22:22

View Postgavztheouch, on Sep 2 2008, 09:55 PM, said:

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.
Ultimate SEO Urls 5 PRO - Multi Language Modern, Powerful SEO Urls

KissMT Dynamic SEO Meta & Canonical Header Tags

KissER Error Handling and Debugging

If you found my post useful please click the green + sign to the right

Please only PM me for paid work.


#3039 gavztheouch

  • Community Member
  • 22 posts
  • Real Name:Gavin Armstrong

Posted 02 September 2008, 22:37

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, 02 September 2008, 22:39.


#3040 liquidair0tb

  • Community Member
  • 4 posts
  • Real Name:John Piscapoe

Posted 03 September 2008, 00:06

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?