Jump to content



Photo
- - - - -

Google XML Sitemap SEO


  • Please log in to reply
1372 replies to this topic

#1361   Roaddoctor

Roaddoctor
  • Members
  • 1,055 posts
  • Real Name:David Jennings
  • Gender:Not Telling
  • Location:Texas

Posted 16 June 2014 - 14:34

fixed - thank you!


-Dave

#1362   Jack_mcs

Jack_mcs
  • Members
  • 26,633 posts
  • Real Name:Jack York
  • Gender:Male
  • Location:Michigan

Posted 17 June 2014 - 00:28

A new version has been uploaded with these changes:

 

- Added code to set the last modified date if the date is 0. If this happens, it may mean there is a problem with the database.
- Added a bunch of files to the excludes list to prevent them from showing in the pages site map file.
- Added code to include reviews in the pages file.
- Changed code to handle the exclude list correctly.
- Changed mysql file so it works with newer versions of mysql.
- Removed extra showmanufacturers statement fron index.php - found by Melanie (mommaroodles ).



#1363   plazman65

plazman65
  • Members
  • 77 posts
  • Real Name:Michelle

Posted 11 July 2014 - 12:54

Hi! I have SPPC and Hidden Products installed. Does anyone know what changes I would need to make to exclude hidden products from showing up? Thanks for any help :)



#1364   RBA55

RBA55
  • Members
  • 9 posts
  • Real Name:Robin Bass

Posted 20 August 2014 - 11:04

My store has 2 languages, english and french. My admin is in english. The sitemaps are generated only in english. Is there a way to have sitemaps generated for both languages?



#1365   Jack_mcs

Jack_mcs
  • Members
  • 26,633 posts
  • Real Name:Jack York
  • Gender:Male
  • Location:Michigan

Posted 20 August 2014 - 13:41

There isn't an easy way. I started adding the code but never completed it. I think that if you change this line in googlesitemap/index.php

$languages_id = $lng->language['id'];

to this

$languages_id = XX;

where XX is the language ID of the other language, the files will be created in that language. This has to be done manually, of course, and the resulting sitemap files would have to be renamed since they would be overwritten when the other language is ran.



#1366   Roaddoctor

Roaddoctor
  • Members
  • 1,055 posts
  • Real Name:David Jennings
  • Gender:Not Telling
  • Location:Texas

Posted 20 August 2014 - 13:55

Hi! I have SPPC and Hidden Products installed. Does anyone know what changes I would need to make to exclude hidden products from showing up? Thanks for any help :)

 

you need to add

where p.products_status = '1'

or

WHERE c.categories_status = 1

at the appropriate places


-Dave

#1367   RBA55

RBA55
  • Members
  • 9 posts
  • Real Name:Robin Bass

Posted 20 August 2014 - 21:12

Thanks Jack, as I suspected. I'll take a look at the code myself and see if I can figure it out, just wanted to know if it had been done. I guess it's a good thing to do, no?



#1368   Jack_mcs

Jack_mcs
  • Members
  • 26,633 posts
  • Real Name:Jack York
  • Gender:Male
  • Location:Michigan

Posted 21 August 2014 - 00:14

As long as there is a link to the other language, like in a language box, the search engines will find the other url's. But the maps speeds that process up so they would help.


Edited by Jack_mcs, 21 August 2014 - 00:16.


#1369   queenzukie

queenzukie
  • Members
  • 624 posts
  • Real Name:Rachael
  • Gender:Female
  • Location:USA

Posted Yesterday, 16:45

I am trying to make some changes to the code to match my shop. I have 4 manufacturers set up. I don't know how to explain it, not just 4 individual manufacturers but I have coded the site to have 4 different manufacturers available (label, artist, genre, condition). I would like to have sitemaps for each of those manufacturers. 

 

I have added the database tables for sitemap true/false selection and set those to true.  I have added the dummy xml files and set the permissions to 755. I have edited index.php and sitemap.class.php. Somewhere in these two files I've made a mistake and I cannot figure it out. 

 

When I run the index.php in my browser it runs fine, however it just flat out stops after creating the first manufacturer sitemap. Diagnosis shows nothing. No errors whatsoever it just stops and never creates the sitemap.xml for the other manufacturers. 

 

Here is my manufacturers code from sitemap.class.php where I do think the error is. 

		function GenerateManufacturer2Sitemap(){
        $sql = "SELECT manufacturers2_id as m2ID, date_added, last_modified as last_mod, manufacturers2_name
                FROM " . TABLE_MANUFACTURERS2 . " order by manufacturers2_name DESC";

		if ( $manufacturers2_query = $this->DB->Query($sql) ){
			$this->debug['QUERY']['MANUFACTURERS2']['STATUS'] = 'success';
			$this->debug['QUERY']['MANUFACTURERS2']['NUM_ROWS'] = $this->DB->NumRows($manufacturers2_query);
			$container = array();
			$number = 0;
			while( $result = $this->DB->FetchArray($manufacturers2_query) ){
				$location = $this->hrefLink(FILENAME_DEFAULT, 'manufacturers2_id=' . $result['m2ID'], 'NONSSL', false);
				$lastmod = $this->NotNull($result['last_mod']) ? $result['last_mod'] : $result['date_added'];
				$changefreq = GOOGLE_SITEMAP_MAN2_CHANGE_FREQ;
				$priority = .5;

				$container[] = array('loc' => htmlspecialchars(utf8_encode($location)),
				                     'lastmod' => date ("Y-m-d", strtotime($lastmod)),
									 'changefreq' => $changefreq,
									 'priority' => $priority
				                     );
				if ( sizeof($container) >= 50000 ){
					$type = $number == 0 ? 'manufacturers2' : 'manufacturers2' . $number;
					$this->GenerateSitemap($container, $type);
					$container = array();
					$number++;
				}
			} # end while
			$this->DB->Free($manufacturers2_query);
			if ( sizeof($container) > 0 ) {
				$type = $number == 0 ? 'manufacturers2' : 'manufacturers2' . $number;
				return $this->GenerateSitemap($container, $type);
			} # end if			
		} else {
			$this->debug['QUERY']['MANUFACTURERS2']['STATUS'] = 'false';
			$this->debug['QUERY']['MANUFACTURERS2']['NUM_ROWS'] = '0';
		}
	} # end function

It' seemed like it would be such a simple thing to do, but I have reread those lines over and over and I do not see where I could have messed up. 

 

Can anyone help?



#1370   Jack_mcs

Jack_mcs
  • Members
  • 26,633 posts
  • Real Name:Jack York
  • Gender:Male
  • Location:Michigan

Posted Yesterday, 17:10

Try replacing all of the code in GenerateManufacturer2Sitemap with that in GenerateManufacturerSitemap and see if it works, which it should. If it does, then it is just a matter of swapping the lines until you find the problem.



#1371   queenzukie

queenzukie
  • Members
  • 624 posts
  • Real Name:Rachael
  • Gender:Female
  • Location:USA

Posted Yesterday, 17:24

Great idea! Going to do it now.



#1372   queenzukie

queenzukie
  • Members
  • 624 posts
  • Real Name:Rachael
  • Gender:Female
  • Location:USA

Posted Yesterday, 17:40

I found the error. 

 

The code I was using had this:

$this->DB->

when it should have had this:

tep_db_

Working like a charm now! 

Thank you so much Jack! You're a great supporter of your contributions! I really do appreciate all your hard work!



#1373   Jack_mcs

Jack_mcs
  • Members
  • 26,633 posts
  • Real Name:Jack York
  • Gender:Male
  • Location:Michigan

Posted Yesterday, 18:23

You're welcome. I'm glad you got it going.