Welcome to Geeklog Monday, October 22 2018 @ 11:02 pm EDT

Geeklog Forums

Sitemap.plugin files every update timing


Status: offline

ivy

Forum User
Full Member
Registered: 25/11/04
Posts: 301
Location:Tokyo Japan
I want to change sitemap files freequency.
Now only configuration is changed..

execute XMLSITEMAP_changeFile() by cron or content edit timing.
What should I do?
Geeklog Japan https://www.geeklog.jp

Status: offline

Laugh

Site Admin
Admin
Registered: 27/09/05
Posts: 1309
It should change as the xmlsitemap plugin does contain the function

plugin_configchange_xmlsitemap

which will update the sitemap file on any configuration change.

Can the webserver write to the sitemap file?

One of the Geeklog Core Developers.

Status: offline

ivy

Forum User
Full Member
Registered: 25/11/04
Posts: 301
Location:Tokyo Japan
Can the webserver write to the sitemap file?


Yes.
But I should save configuration manually.

Can I write sitemap.xml by using CRON everyday?
Geeklog Japan https://www.geeklog.jp

Status: offline

Laugh

Site Admin
Admin
Registered: 27/09/05
Posts: 1309
I am not sure I understand why you want to update the sitemap everyday as it should update whenever there are any new items or changes.

If you do want to run the cron job then have it execute the function

PHP Formatted Code
XMLSMAP_update();


which is found in the xmlsitemap functions.inc file. This will update the sitemap file for all plugins.
One of the Geeklog Core Developers.

Status: offline

ivy

Forum User
Full Member
Registered: 25/11/04
Posts: 301
Location:Tokyo Japan
Thanks!

I am not sure I understand why you want to update the sitemap everyday as it should update whenever there are any new items or changes.


I want to execute XMLSMAP_update() everytime editing staticpages, story, and so on.
But each plugin does not excute XMLSMAP_update(), so Geeklog CRON execute.

Geeklog Japan https://www.geeklog.jp

Status: offline

ivy

Forum User
Full Member
Registered: 25/11/04
Posts: 301
Location:Tokyo Japan
xmlsitemap/functions.inc

add this functions?

PHP Formatted Code

/**
* callback function for the pseudo cron job
*/

function plugin_runScheduledTask_xmlsitemap() {
        XMLSMAP_update();
}
 

Geeklog Japan https://www.geeklog.jp

Status: offline

Laugh

Site Admin
Admin
Registered: 27/09/05
Posts: 1309
Thanks Ivy
One of the Geeklog Core Developers.

Status: offline

ivy

Forum User
Full Member
Registered: 25/11/04
Posts: 301
Location:Tokyo Japan
This function does not work. sorry.
Could you please debug?
Geeklog Japan https://www.geeklog.jp

Status: offline

Laugh

Site Admin
Admin
Registered: 27/09/05
Posts: 1309
Why do you want to run the xmlsitemap on a cron job? There is no need as it will update with any config change or any edit you do to an article etc...


XMLSMAP_update();

is run when the xmlsitemap config is changed and when I look at the file dates it updates fine after I change the xmlsitemap config from the Geeklog configuration.

Tom

One of the Geeklog Core Developers.

Status: offline

ivy

Forum User
Full Member
Registered: 25/11/04
Posts: 301
Location:Tokyo Japan
Why do you want to run the xmlsitemap on a cron job? There is no need as it will update with any config change or any edit you do to an article etc...


not updated by editing dataBox, Story content.

XMLSMAP_update();

is run when the xmlsitemap config is changed and when I look at the file dates it updates fine after I change the xmlsitemap config from the Geeklog configuration.


only xmlsitemap config is changed.

Geeklog Japan https://www.geeklog.jp

Status: offline

Laugh

Site Admin
Admin
Registered: 27/09/05
Posts: 1309
So if you change the update frequency in the config your sitemap.xml file doesn't get updated and change right away?

When does it the sitemap update? When you add or delete a story?

As I said before the config runs

PHP Formatted Code
XMLSMAP_update();


when a xmlsitemap config option changes.

When an item is saved like a story, the function

PHP Formatted Code
plugin_itemsaved_xmlsitemap


is run and then for example for stories

PHP Formatted Code
XMLSMAP_update('story')


is run.

The plugin needs to support plugin_getiteminfo_xxx before the xmlsitemap plugin will update the sitemap with its information.

I think something else must be going on with your install.

Is this just a databox issue?
One of the Geeklog Core Developers.

Status: offline

ivy

Forum User
Full Member
Registered: 25/11/04
Posts: 301
Location:Tokyo Japan
plugin_getiteminfo_xxx
I see.
It is databox issue.
thanks!

Geeklog Japan https://www.geeklog.jp

All times are EDT. The time is now 11:02 pm.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content