Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Google XML Sitemap SEO


Jack_mcs

Recommended Posts

ok, a bit of progress in my situation. I enabled errors in the index.php file and got this, which means there is some database connectivity issue with the ConnectDB() function.

Fatal error: Uncaught Error: Call to undefined function mysql_connect() in /home/ ... /public_html/dev2/googlesitemap/sitemap.class.php:83

I'm still not sure how to fix this...

Edited by Demitry

osCommerce: made for programmers, ...because store owners do not want to be programmers.

https://trends.google.com/trends/explore?date=all&geo=US&q=oscommerce

Link to comment
Share on other sites

As mentioned above, this addon doesn't work with php 7, as far as I know. Although I haven't tested it and no one has posted errors so it might be something else. Please try do a search and replace in the googlesitemap/sitemap.class.php file and replace all instances of mysql_ with mysqli_ and see if that helps.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

ok Jack, @Jack_mcs

Thank you for the suggestion. I'll give it a try.

I did not read through all the pages of this forum so I did not know about issues with PHP7. I'll let you know what I come up with. Thanks.

 

Edited by Demitry

osCommerce: made for programmers, ...because store owners do not want to be programmers.

https://trends.google.com/trends/explore?date=all&geo=US&q=oscommerce

Link to comment
Share on other sites

Well, that did work partially. I can now view the diagnostic output and two of the sitemap files got filled in - the sitemappages.xml and the sitemapindex.xml

However sitemapindex.xml does not have links to the other sitemap xml pages, it just came out like an xml page of its own. That's not how the older version I have works, so I'm not sure if this is an error or an intended change.

I did add an older modification which seems to work well,.. It eliminates all pages that are disallowed in the robots.txt file. That prevents having to enter them twice, once into the robots.txt file, and again into the admin panel configuration page for this addon.

Anyway, I have a few more things to test and see if I can get this addon to work.

Edited by Demitry

osCommerce: made for programmers, ...because store owners do not want to be programmers.

https://trends.google.com/trends/explore?date=all&geo=US&q=oscommerce

Link to comment
Share on other sites

When you say there are not links to the other sitemap files, are you looking at the actual file or via the web? If the latter, that won't work due to the new version being used for the sitemap rules. If it is still failing, please post the diagnostic results and I will take see if I can see any problems.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

I'm looking at it from the webpage, and on the older version this page had links to all the other xml sitemaps. And all the other xml pages had links to the individual pages listed,.. though this was not in xml format. This latest addon version is different in that it lists each of the pages in xml format but without links to anything. Is this how it is supposed to be?

Here is the output I got when running that .../googlesitemap/index.php file. Let me know if anything sticks out that I may be able to change to get this working right.

 

ERROR: Google Product Sitemap Generation FAILED!

ERROR: Google Category Sitemap Generation FAILED!

ERROR: Google Images Sitemap Generation FAILED!

ERROR: Google Manufacturers Sitemap Generation FAILED!

Opening   /home/ ... /public_html/dev2/sitemappages.xml

FS_CAT    /home/ ... /public_html/dev2/

Server    http://dev2.MyDomain.com

Save Path /home/ ... /public_html/dev2/

WS_CAT    /

Write /home/ ... /public_html/dev2/sitemappages.xml
Generated Google Pages Sitemap Successfully

ERROR: Google Specials Sitemap Generation FAILED!

Opening   /home/ ... /public_html/dev2/sitemapindex.xml

FS_CAT    /home/ ... /public_html/dev2/

Server    http://dev2.MyDomain.com

Save Path /home/ ... /public_html/dev2/

WS_CAT    /

Write /home/ ... /public_html/dev2/sitemapindex.xml
Generated Google Sitemap Index Successfully

Array
(
    [QUERY] => Array
        (
            [PRODUCTS] => Array
                (
                    [STATUS] => false
                    [NUM_ROWS] => 0
                )

            [CATEOGRY] => Array
                (
                    [STATUS] => false
                    [NUM_ROWS] => 0
                )

            [IMAGES] => Array
                (
                    [STATUS] => false
                    [NUM_ROWS] => 0
                )

            [MANUFACTURERS] => Array
                (
                    [STATUS] => false
                    [NUM_ROWS] => 0
                )

            [SPECIALS] => Array
                (
                    [STATUS] => false
                    [NUM_ROWS] => 0
                )

        )

    [SAVE_FILE_XML] => Array
        (
            [0] => Array
                (
                    [file] => /home/ ... /public_html/dev2/sitemappages.xml
                    [status] => success
                    [file_exists] => true
                )

            [1] => Array
                (
                    [file] => /home/ ... /public_html/dev2/sitemapindex.xml
                    [status] => success
                    [file_exists] => true
                )

        )

)

 

osCommerce: made for programmers, ...because store owners do not want to be programmers.

https://trends.google.com/trends/explore?date=all&geo=US&q=oscommerce

Link to comment
Share on other sites

@Jack_mcs

ok, update, ..I actually got them all to generate. I just have to clear this php warning:

Warning: mysqli_select_db() expects exactly 2 parameters, 1 given in /home/ ... /public_html/dev2/googlesitemap/sitemap.class.php on line 97

 

and here is the function this warning is referring to:

	function SelectDB(){
		return mysqli_select_db($this->db);
	} # end function

 

Edited by Demitry

osCommerce: made for programmers, ...because store owners do not want to be programmers.

https://trends.google.com/trends/explore?date=all&geo=US&q=oscommerce

Link to comment
Share on other sites

I think the following will fix that. Replace

return mysqli_select_db($this->db);
 

with

return mysqli_select_db($this->link_id, $this->db);

Though a better fix might be to replace all "mysqli_" with "tep_db_". Though there may be some MySQL calls that will not work that way. 

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

ok, all fixed. I changed that function above to this and no more errors.

	function SelectDB(){
		return mysqli_select_db($this->link_id, $this->db);
	} # end function

 

osCommerce: made for programmers, ...because store owners do not want to be programmers.

https://trends.google.com/trends/explore?date=all&geo=US&q=oscommerce

Link to comment
Share on other sites

one thing though, when running this in diagnostic mode, WS_CAT is only displaying a forward slash for each generated sitemap. Is that supposed to be like that?

Also, are these sitemaps not supposed to have links like the older version of this addon?

osCommerce: made for programmers, ...because store owners do not want to be programmers.

https://trends.google.com/trends/explore?date=all&geo=US&q=oscommerce

Link to comment
Share on other sites

Maybe. :)  It is the location of the shop. If the shop is in the root, then it will be a slash. If the shop is in a category, then it should be the category name. It comes from the DIR_WS_HTTP_CATALOG in the configure file so whatever is there will be displayed.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

A new version (unofficially named the Demitry version :biggrin:) has been uploaded. It has these changes:

  • Added code to merge in excluded files from the robots file - coded by member Demitry.
  • Added an option to the settings to allow the script to be ran from admin - thanks to member Demitry.
  • Changed email links based on if the script was created via cron or not.
  • Removed the styling code since it no longer works and can cause failures.
  • Script is now php 7.2 compatible - coded by member Demitry.
  • Script requires mysqli to be installed. If your host is only using mysql, then either use an older version of this addon or change to a modern host.

 

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

@Jack_mcs

Jack,

I just checked out the latest version and I think you missed adding the new changes to ../googlesitemap/index.php and ../googlesitemap/sitemap.class.php. Those files are dated to the prior version and have no changes in them.

Also, the ../googlesitemap/index.php version I sent you had the error_reporting and ini_set display_errors set to 1. I forgot to switch them back to 0.

 

osCommerce: made for programmers, ...because store owners do not want to be programmers.

https://trends.google.com/trends/explore?date=all&geo=US&q=oscommerce

Link to comment
Share on other sites

Yes, you are right. I checked the package I uploaded and it doesn't not contain the new changes. I will have to figure out what I did wrong, retest and re-upload. I created a test shop using php 7.2 and it worked so I must have gotten the files confused.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

@Jack_mcs

Hi Jack!

I have a couple SQL errors when I run the database update:

Error

SQL query:

 configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added, use_function)
 VALUES ('Create Now', 'GOOGLE_XML_SITEMAP_CREATE_NOW', 'false', 'Set to create the map files now.<a href="' . HTTPS_CATALOG_SERVER . '/googlesitemap/index.php" target="new" style="color:blue;">Generate All Sitemaps Now</a>', @this_id, '15', 'tep_cfg_select_option(array(\'true\', \'false\'), ', now(), NULL)

 

MySQL said: Documentation

#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '. HTTPS_CATALOG_SERVER . '/googlesitemap/index.php" target="new" style="color:bl' at line 2

 

Also:
 

Error

SQL query:

 

INSERT INTO configuration ( configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order ) 
 VALUES ( 'Create Now', 'GOOGLE_XML_SITEMAP_CREATE_NOW', 'false', 'Click this link to run the script now<br><center><a href="../googlesitemap/index.php" target="new"><font color=red>Generate All Sitemaps Now</font></a></center>', @this_id, '15' )

 

MySQL said: Documentation

#1048 - Column 'configuration_group_id' cannot be null

 

 

The last one may be because the first command did not run.

 

Any suggestions?

 

Thanks!

~Seth

Link to comment
Share on other sites

A new version has been uploaded. The last version didn't contain the updated files so it wouldn't have changed anything.

Please note that you should not use this version if you have the mobile addon installed.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

I still get the same SQL errors on the last 2 SQL command lines (last 4 lines technically...) and no link is created.  I can at least create the files using the "http://YOUR_DOMAIN/googlesitemap/index.php" directly.

Edited by Zalinar
clarification
Link to comment
Share on other sites

You can't get the same error because the addon doesn't use the MySQL you initially posted. Please post the commands you are trying to use so I can check them against what I have here and make sure they work.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

Jack,

Nevermind - I did not run the new single SQL command.  I used the whole old file.  I will see if the update to 1.13 command works.  I feel silly.  thank you!

~Seth

Edited by Zalinar
Made an oversight in the instructions
Link to comment
Share on other sites

  • 2 weeks later...

Thank you for posting the changes. I will look at them when I get a chance. But are you saying that you have this addon working with SEO 5? There have been a lot of requests for that but I've not had the time to setup a shop with both addons installed and find a fix. So it would be good to know that it works with your changes.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

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