Jump to content
Jack_mcs

Sitemap SEO

Recommended Posts

Hi Jack (again),

 

I followed your advice and installed this on to my site, but I really can't see where the sitemap itself is generated! Nothing appears on the front of the site, nor does it actually seem to do anything in the backend.

 

Having had so many people use this, it's obviously something I'm doing wrong - but do you have any idea what it could be? Everything installed fine, so I don't know what the issue is... Other than me clearly being a little more retarded than I initially thought.

Share this post


Link to post
Share on other sites

Hi Jack (again),

 

I followed your advice and installed this on to my site, but I really can't see where the sitemap itself is generated! Nothing appears on the front of the site, nor does it actually seem to do anything in the backend.

 

Having had so many people use this, it's obviously something I'm doing wrong - but do you have any idea what it could be? Everything installed fine, so I don't know what the issue is... Other than me clearly being a little more retarded than I initially thought.

The installation adds a link in the information box. If you are not displaying the information box, you will have to add the link manually somewhere else. Also be sure you follow the directions for initializing the database.

Share this post


Link to post
Share on other sites

Got it sorted. It was an odd one though - for once it doesn't appear to have been entirely my fault.

 

I just ran the database uninstall file, and then re-installed it. It's fine now.

 

Thanks for mentioning that link. I'm using custom pages and not the standard information box, so I'll hard code a link in there somewhere.

 

Thanks again for another awesome contribution. You remain OSC Legend. :-)

Share this post


Link to post
Share on other sites

Hi Jack,

 

Ive gone through the whole thread and not seen this asked before so apologies if it has. With regards the related categories links, is it possible to exclude the current category? At the moment when on a subcategory all related categories including the one you are already on are returned. I would like to exclude the current category from the list if possible. I'm playing with the sql query in category_tree_no_products.php but nothing is working. Please could you help. The relevant code i need to tweak i think is this in category_tree_no_products.php:

 

<?php function osC_CategoryTree($catID = 0, $load_from_database = true) {
global $languages_id;
$categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.parent_id from " . TABLE_CATEGORIES . " c left join " . TABLE_CATEGORIES_DESCRIPTION . " cd on c.categories_id = cd.categories_id where cd.language_id = '" . (int)$languages_id . "' order by c.parent_id, c.sort_order, cd.categories_name");
$this->data = array();
$this->root_category_id = $catID;

while ($categories = tep_db_fetch_array($categories_query)) {
$this->data[$categories['parent_id']][$categories['categories_id']] = array('name' => $categories['categories_name'], 'count' => 0);}
} //end class osC_CategoryTree


?>

Share this post


Link to post
Share on other sites

Hi Jack,

 

Sorry to double post but i forgot to ask you my other question. Please could you help me convert 2 eregi's in includes/functions/sitemap.php for php 5.3. The 2 lines are as follows:

 

 

<?php if (eregi("<a(.*)</a", $lines[$i], $out))
       {
         if (eregi("tep_href_link((.*))", $out[1], $locn))
         { ?>

Share this post


Link to post
Share on other sites

 

$categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.parent_id from " . TABLE_CATEGORIES . " c left join " . TABLE_CATEGORIES_DESCRIPTION . " cd on c.categories_id = cd.categories_id where cd.language_id = '" . (int)$languages_id . "' order by c.parent_id, c.sort_order, cd.categories_name");

I haven't looked at that code in quite a while so the following may not work but it won't hurt to try. Change this piece of code

where cd.language_id = '" . (int)$languages_id . "' order

to

where c.categories_id != " . (int)$catID . " and cd.language_id = '" . (int)$languages_id . "' order 

Share this post


Link to post
Share on other sites

Hi Jack,

 

Sorry to double post but i forgot to ask you my other question. Please could you help me convert 2 eregi's in includes/functions/sitemap.php for php 5.3. The 2 lines are as follows:

 

 

<?php if (eregi("<a(.*)</a", $lines[$i], $out))
       {
         if (eregi("tep_href_link((.*))", $out[1], $locn))
         { ?>

I think this should work:

<?php if (preg_match("/<a(.*)<\/a/i", $lines[$i], $out))
       {
         if (preg_match("/tep_href_link((.*))/i", $out[1], $locn))
         { ?>

Edited by Jack_mcs

Share this post


Link to post
Share on other sites

I haven't looked at that code in quite a while so the following may not work but it won't hurt to try. Change this piece of code

where cd.language_id = '" . (int)$languages_id . "' order

to

where c.categories_id != " . (int)$catID . " and cd.language_id = '" . (int)$languages_id . "' order 

 

Hi Jack,

 

Many thanks for getting back to me. I'm afraid that didn't make any difference unfortunately. I'm not a coder just a site owner so i'm afraid i'm not much help but do you possibly have any more ideas?

 

I've googled around and found some php files that look like some fork of oscommerce with a category function that has an "exclude" element, i wonder if you have seen it? Is there maybe something further down the code in the category_tree_no_products.php file that could be tweaked around the "while" statement or in the "buildbranch" function itself to exclude the current category id?

Share this post


Link to post
Share on other sites

I think this should work:

<?php if (preg_match("/<a(.*)<\/a/i", $lines[$i], $out))
       {
         if (preg_match("/tep_href_link((.*))/i", $out[1], $locn))
         { ?>

 

Hi Jack,

 

Many thanks for that mate that seems to have done the trick. Great contribution by the way your work is much appreciated. I have only just found out that sadly Chemo died last year and i decided to make more of an effort to thank people like yourself for your good work.

Share this post


Link to post
Share on other sites

Hi Jack,

 

Many thanks for getting back to me. I'm afraid that didn't make any difference unfortunately. I'm not a coder just a site owner so i'm afraid i'm not much help but do you possibly have any more ideas?

 

I've googled around and found some php files that look like some fork of oscommerce with a category function that has an "exclude" element, i wonder if you have seen it? Is there maybe something further down the code in the category_tree_no_products.php file that could be tweaked around the "while" statement or in the "buildbranch" function itself to exclude the current category id?

I'm sure it could be done but it isn't something I have time to go through right now.

Share this post


Link to post
Share on other sites

Hi Jack,

 

Many thanks for that mate that seems to have done the trick. Great contribution by the way your work is much appreciated. I have only just found out that sadly Chemo died last year and i decided to make more of an effort to thank people like yourself for your good work.

Thank you, I appreciate it. It is sad about Chemo's death, though it was not unexpected. He made a very large and positive change to oscommerce and never got the thanks he deserved, in my opinion, due to problems he had with Harold.

Share this post


Link to post
Share on other sites

I'm sure it could be done but it isn't something I have time to go through right now.

 

No worries i understand i'm just glad to hear you think it can be done. Do you think the sql query can be manipulated to achieve what i want or will it take more than that? If it'll take more i'll move onto other things for now and have a play with it again later. Perhaps if you ever do a 2.31 update for this contribution you might consider having another look at it. I don't know if it's something you'd like to see yourself. If i work it out i'll post it here.

Share this post


Link to post
Share on other sites

Thank you, I appreciate it. It is sad about Chemo's death, though it was not unexpected. He made a very large and positive change to oscommerce and never got the thanks he deserved, in my opinion, due to problems he had with Harold.

 

Yeh once i found out i did wonder weather his nickname had more sinister meaning than i had realised. I just prayed it wasn't suicide as he was so young and respected by so many. It's weird cos i never spoke to the guy and he'd been banned a couple of years before i even knew what oscommerce was but once your looking for anything to do with oscommerce you see his great work and like i say i didn't know the guy but he helped me alot so was really gutted when i saw the posts that he had passed away. I'm sure alot of others felt the same way.

 

God knows why Harold had problems with him you would have thought the opposite would be the case but maybe i'm looking at things with rose tinted glasses and don't really know anything about it anyway apart from the odd vague post on here.

 

Anyway keep well Jack and many thanks once again.

Edited by annuity

Share this post


Link to post
Share on other sites

No worries i understand i'm just glad to hear you think it can be done. Do you think the sql query can be manipulated to achieve what i want or will it take more than that? If it'll take more i'll move onto other things for now and have a play with it again later. Perhaps if you ever do a 2.31 update for this contribution you might consider having another look at it. I don't know if it's something you'd like to see yourself. If i work it out i'll post it here.

The example I gave said to use c.categories_id. You could try c.parent_id. I do plan to release a 2.3 version but no idea when that might be. Normally I would have updated a number of my contributions by now but due to the changes required for 2.3, it just adds too much extra work to convert them all and keep them updated. Releasing 2.3 as it was was such a silly mistake, but that's another story. :)

Share this post


Link to post
Share on other sites

The example I gave said to use c.categories_id. You could try c.parent_id. I do plan to release a 2.3 version but no idea when that might be. Normally I would have updated a number of my contributions by now but due to the changes required for 2.3, it just adds too much extra work to convert them all and keep them updated. Releasing 2.3 as it was was such a silly mistake, but that's another story. :)

 

Hi Jack,

 

Apologies for the delay in getting back to you. I tried c.parent_id but that made all the links disappear unfortunately as i thought it might. It looks like we need to find a way of keeping the current category id in the sql query as it needs it to find the related categories while at the same time excluding it from the final result. I don't know if something can be done once it's looped through and got all the categories ready to output onto the page.

 

I have also noticed that i am experiencing the -c-_4.html issue on the related categories. I tried changing $p_category_link = false in category_tree_no_products.php to true and thought that had fixed it but it just made all the parent id's 1 so the links all looked like -c-1_4.html not matter what the real number of the parent_id is. The issue seems to have something to do with $p_category_link but i can't work out why it's not working. The links on the sitemap page itself are all fine though so i will just leave the related categories bit out for now until hopefully you get chance to look at this contribution again in the future. Many thanks for your help Jack.

Edited by annuity

Share this post


Link to post
Share on other sites

I have also noticed that i am experiencing the -c-_4.html issue on the related categories.

This is usually caused by the use of an outdated version of Ultimate SEO. Please be sure you are using V2.2d-11.

Share this post


Link to post
Share on other sites

This is usually caused by the use of an outdated version of Ultimate SEO. Please be sure you are using V2.2d-11.

 

Hi Jack,

 

Right that's weird cos i'm using the latest version of USU5 pro on 2.3. I tried something you mentioned back in the thread to someone else but that just changed all the links to -c-1.html -c-2.html etc. instead of -c-1_1.html -c-1_2.html, so no parent id.

 

USU 5 seems to be working fine everywhere else, i'll try to explain some things about my setup and maybe your expert brain will pick up on something i mention.

 

I did have issues getting a fresh install of 2.3.1 to work on my server. I had issues with the the language id not being picked up and i had to tweak the code in application_top.php to get it working and the part i tweaked was near to where some USU 5 code goes related to language_id. Could that be something to do with it?

 

I also had issues with the currency(prices going to zero and the currency reseting to default when i navigated the site) and again had to tweak application top to get it to work. My host wasn't much help they just kept saying everything should be fine. PHP is 5.3, register globals is off, long arrays is on etc. etc. but they do have that suhosin installed, which i keep seeing mentioned on here and something made a fresh install of oscommerce 2.3 not work anyway.

 

On the admin side i had the language_id issue and unable to determine page link(related to php self i think). Again things in login.php and application_top.php had to be tweaked to get the site to work. My admin side now doesn't redirect as i think the fix for unable to determine page link was to force index.php if php self is null.

 

I must admit i've had a nagging feeling that the issues i had right at the start aren't really fixed and just papered over but like i say everything seems to be working fine now. I even tried a fresh install of 2.2rc2a but had the same language id issues so thought i'd best just stick with the latest version as whatever the problem is it seems to be the same for both versions.

 

Finally the eval function and ini_set are disabled.

 

I don't know if anything i've said has rang any bells with you like i say i'm not a coder so thought i would just throw a few things out there and see what you thought.

Edited by annuity

Share this post


Link to post
Share on other sites

Sorry Jack one final thing i thought to mention. I noticed with regards to USU5 that the latest version seems to handle redirects slightly differently from an older version i have on another site. On the site we've been talking about with the latest version of USU5 if i manually change the URL in the browser from say product-name-p-12.html to -p-12.html i get a 404 page where as on the site with the older version it will redirect to product-name-p-12.html on just -p-12.html. On the new version it will only redirect if at least one letter is before the hyphen like z-p-12.html but it can be any letter.

 

Now i don't know if this new way of redirecting is intentional or if it is a problem with my setup and related to what we've been discussing, which is why i'm mentioning it. The older way seems better to me unless there are valid reasons for making the change i'm not aware of.

Edited by annuity

Share this post


Link to post
Share on other sites

Hang on i've just realised i've got you mixed up with someone else called fwr media. USU5 is not your contribution is it. My apologies. Whats the deal with seo url's i'm confused now!? I see you support Ultimate SEO V 2.2d so what is the difference to USU5 pro? Does USU5 use none standard code or something? I thought USU5 was a continuation of chemos version and that was now obsolete but I notice in the contribution description you mention yours is compatible with all contributions, which suggests to me usu5 pro isn't? I have no preference to which version of seo url's i use so should i try your version(i notice there is an osc 2.3 version) and maybe the problems im having with the related categories on seo sitemap and -p-12.html not redirecting will be resolved?

 

While i'm here the next thing i'm looking at is canonical links. Please could you recommend a contribution that works best with your version of SEO url's?

Edited by annuity

Share this post


Link to post
Share on other sites

Hang on i've just realised i've got you mixed up with someone else called fwr media. USU5 is not your contribution is it. My apologies. Whats the deal with seo url's i'm confused now!? I see you support Ultimate SEO V 2.2d so what is the difference to USU5 pro? Does USU5 use none standard code or something? I thought USU5 was a continuation of chemos version and that was now obsolete but I notice in the contribution description you mention yours is compatible with all contributions, which suggests to me usu5 pro isn't? I have no preference to which version of seo url's i use so should i try your version(i notice there is an osc 2.3 version) and maybe the problems im having with the related categories on seo sitemap and -p-12.html not redirecting will be resolved?

 

While i'm here the next thing i'm looking at is canonical links. Please could you recommend a contribution that works best with your version of SEO url's?

No, SEO 5 isn't a continuation of Chemo's version. I updated Chemo's version and is the one I recommend. As for SEO 5 working with this, or any contribution, since I don't support it, I can't help with the compatibility problems. There are several fixes around to get it to work with various contributions, though I don't recall if there was a fix for this one. If so, it has probably been mentioned in this thread.

 

As for canonical, I suggest you insall Header Tags SEO since it has that built-in. You'll have to change a setting in SEO 5 to have it work properly with Header Tags. See the link in my signature for the SEO-type contributions I recommend.

Share this post


Link to post
Share on other sites

No, SEO 5 isn't a continuation of Chemo's version. I updated Chemo's version and is the one I recommend. As for SEO 5 working with this, or any contribution, since I don't support it, I can't help with the compatibility problems. There are several fixes around to get it to work with various contributions, though I don't recall if there was a fix for this one. If so, it has probably been mentioned in this thread.

 

As for canonical, I suggest you insall Header Tags SEO since it has that built-in. You'll have to change a setting in SEO 5 to have it work properly with Header Tags. See the link in my signature for the SEO-type contributions I recommend.

 

Hi Jack,

 

Many thanks for getting back to me. I will install your version of seo url's and see how i go. With regards using Header Tags SEO for the canonical links, could you advise the specific sections of code that deal with the canonical links because the thing is to cut a long story short i'm using header tags seo already but not all of it. I have previously installed it on other sites and decided this time to not include the page control admin section or most of the catalog side except for the relevant sql queries that need adjusting to retrieve the extra info.

 

Instead i have hard coded the meta tags on the catalog side with if else statements echoing things like $category['categories_htc_desc_tag']; and create the meta tags text for each product & category as normal with header tags seo in admin/categories.php.

 

So in other words i don't have the canonical tags part of header tags seo installed. Please could you advise the parts of the header tags seo code that deal with the canonical tag?

 

As i'm going off topic now i will post any further questions regarding seo urls or header tags seo in the appropriate support forum.

Share this post


Link to post
Share on other sites

Hi Jack,

 

Many thanks for getting back to me. I will install your version of seo url's and see how i go. With regards using Header Tags SEO for the canonical links, could you advise the specific sections of code that deal with the canonical links because the thing is to cut a long story short i'm using header tags seo already but not all of it. I have previously installed it on other sites and decided this time to not include the page control admin section or most of the catalog side except for the relevant sql queries that need adjusting to retrieve the extra info.

 

Instead i have hard coded the meta tags on the catalog side with if else statements echoing things like $category['categories_htc_desc_tag']; and create the meta tags text for each product & category as normal with header tags seo in admin/categories.php.

 

So in other words i don't have the canonical tags part of header tags seo installed. Please could you advise the parts of the header tags seo code that deal with the canonical tag?

 

As i'm going off topic now i will post any further questions regarding seo urls or header tags seo in the appropriate support forum.

The code for it is built into the includes/header_tags.php file so it probably won't be of much use to you. I can't imagine why you would only use part of the contribution but if you are going to do that, you probably should use one of the other meta tags contributions that just concentrate on meta tags. Header Tags is meant to help SEO a site but by not using it as designed, you are bypassing that and making it pretty useless. There is also an addon just for canonical tags which works without having to have the Header Tags SEO addon installed. That is probably what you should use, in your case. Please ask any other Header Tags related questions in its support thread.

Share this post


Link to post
Share on other sites

The code for it is built into the includes/header_tags.php file so it probably won't be of much use to you. I can't imagine why you would only use part of the contribution but if you are going to do that, you probably should use one of the other meta tags contributions that just concentrate on meta tags. Header Tags is meant to help SEO a site but by not using it as designed, you are bypassing that and making it pretty useless. There is also an addon just for canonical tags which works without having to have the Header Tags SEO addon installed. That is probably what you should use, in your case. Please ask any other Header Tags related questions in its support thread.

 

Header tags seo is a great contribution I think i did it my way to keep database queries to a minimum, that's my ultimate goal with this new site and I tend to write all my tags manually anyway so i just needed the code to input everything into the database really. The if else statements are to have at least something if the header tags are not set. I think i am using the canonical tag contribution you mentioned on another site of mine and i was reluctant to use it as i have an issue with google indexing my urls with < at the end and the canonical is the same. I can't exclude < from the canonical no matter what i do so google is always complaining about all my urls being duplicates cos .html and .html< are displaying exactly the same content. I will give it another go anyway as it seems adding < to the end of my urls on this new site causes a 404. I have installed your version of seo url's now and have a question so i will go post it there. Many thanks for all your help once again.

Edited by annuity

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

×