Status
Not open for further replies.

neounix

Customer
Hey1

Do mind to add an option (for class_sitemap.php) in the sitemap setting (or a hook) where we can set the first page number when we start to generate a sitemap?

Right now, it always starts as "0", however (in conjunction with our recent request for capabilities to have the option for multiple sitemap directories and filenames, it would be good if we could also set the first page number to 100 or 200 or whatever depending no how we generated the maps.

That way we could generate various maps and combine them in a directory, avoiding filename collision because the sequence numbers would be different.

This would be a very helpful feature!

Thanks!

Screen Shot 2013-12-26 at 12.53.06 AM.png

PS: Not sure if this is the right area of the code or not ... sorry it the screenshot is not helpful.
 
Upvote 0
This suggestion has been closed. Votes are no longer accepted.
Oh! If easier for you and not something you would like to implement, can you please let me know where exactly I can edit the code to start the numbering sequence of the files "as we require"?

Thanks!
 
The existing dbtech_dbseo_sitemap_add_content_types hook can be used to set the initial "startat" variable.

I will add dbtech_dbseo_sitemap_next_content_type to the protected function step_content_type_forward() which will let you set the "startat" for the next content type in the list as it goes.
 
Thanks! I downloaded, then uploaded and installed the latest b10 version on our staging server this this small test code plugin:

Screen Shot 2013-12-27 at 12.22.00 AM.png

.. and as you can see (below)... it's not working... the numbers start at 0 and not 20 as I expected.

Screen Shot 2013-12-27 at 12.24.02 AM.png
 
Also, I looked at the code in class_sitemap.php and changed the plugin (to test) to be:

$session['startat'] = 20;

and it also does not work..

Hmmm. what am I doing wrong?

PS: I looked a the code and it seems the $startat = 0; was hard coded in many places and I could not find where it was over written...

Thanks for your help!
 
Last edited:
I may have found the problem.. testing now:

[
Thu Dec 26 11:15:25 2013] [error] [client 58.137.213.180] PHP Parse error: syntax error, unexpected $end in /var/www/dbtech/dbseo/includes/class_sitemap.php(168) : eval()'d code on line 2, referer: 401 Authorization Required
[Thu Dec 26 11:15:40 2013] [error] [client 58.137.213.180] PHP Parse error: syntax error, unexpected $end in /var/www/dbtech/dbseo/includes/class_sitemap.php(168) : eval()'d code on line 2, referer: 401 Authorization Required
[Thu Dec 26 11:15:58 2013] [error] [client 58.137.213.180] PHP Parse error: syntax error, unexpected $end in /var/www/dbtech/dbseo/includes/class_sitemap.php(168) : eval()'d code on line 2, referer: 401 Authorization Required

Added a newline at end of file and error is gone... will test soon
 
Nope.. sorry... even with the PHP error gone.. I tried both ways $startat = 20 and $session['startat'] = 20; and it always starts at 0.
 
Hmmm.. maybe it is because dbtech_dbseo_sitemap_next_content_type has not yet been included in protected function step_content_type_forward() (which you said will let you set the "startat" for the next content type in the list as it goes.)
 
That's correct, until that hook is implemented only the very first content type can have its startat overridden.

Also, do bear in mind that the "startat" value itself is not based on number of items, but on the id of the item. For instance, if the first thread ID on your forum is 500, then a startat of 20 translates into "select the first 30000 threads starting with thread ID 20" and thus it will have no effect.

Pagination is handled by setting "startat" to the "last ID" processed by the script.

Doing it this way vs using LIMIT startat, perpage is for performance reasons.
 
haha.. for testing, I turned off the baby plugin and just hard coded the value in (see attached) and it still starts at 0.. hahaha

Screen Shot 2013-12-27 at 1.33.25 AM.png
 
Status
Not open for further replies.
Top