Please upgrade here. These earlier versions are no longer being updated and have security issues.

[Sitemaps Addon] How I (almost) made it work

This discussion is related to the Sitemaps addon.
edited February 2011 in Vanilla 2.0 - 2.8
I tried to figure out why the plugin didn't work "out of the box" for me.

Actually, when calling /plugin/sitemaps/build to rebuild the sitemap, this error is triggered:

Parameter 1 to SitemapsPlugin::Controller_Build() expected to be a reference, value given

To get rid of it, just remove the ampersand in class.sitemaps.plugin.php on line 69:

public function Controller_Build(&$Sender) {

becomes:

public function Controller_Build($Sender) {

(BTW I don't really see the point with this ampersand, since PHP always uses references for objects.)

Then it works! Well, at least a sitemap gets generated :-)

Additionaly, I don't understand how the 'LastDiscussionIndex' thing is supposed to work:

$DiscussionPostIndex = (int)date('Y',$DiscussionPostDate) + (int)date('d',$DiscussionPostDate);

Let's say today is January 31. Current index value is 2042 (2011 + 31). Sitemap won't be updated until index value increases... Which won't happen until January 31, 2012!

Where did I get wrong?

Comments

  • Thanks for your response...

    Still not working....

    I edited that syntax did new post but no sitemap.index,xml in cache/sitemaps/
    I am using smarty theme and default.master.php
    Myforum/subdomains/sms/httpdocs/themes/defaultsmarty/views/default.master.php


    Is it make any difference ??


  • Just downloaded this plugin and while it creates a sitemap, it is far from correct.

    If anyone has messed with this lately, I'd love to hear about it!
  • I tried to figure out why the plugin didn't work "out of the box" for me.

    Actually, when calling /plugin/sitemaps/build to rebuild the sitemap, this error is triggered:

    Parameter 1 to SitemapsPlugin::Controller_Build() expected to be a reference, value given

    To get rid of it, just remove the ampersand in class.sitemaps.plugin.php on line 69:

    public function Controller_Build(&$Sender) {

    becomes:

    public function Controller_Build($Sender) {

    (BTW I don't really see the point with this ampersand, since PHP always uses references for objects.)

    Then it works! Well, at least a sitemap gets generated :-)

    Additionaly, I don't understand how the 'LastDiscussionIndex' thing is supposed to work:

    $DiscussionPostIndex = (int)date('Y',$DiscussionPostDate) + (int)date('d',$DiscussionPostDate);

    Let's say today is January 31. Current index value is 2042 (2011 + 31). Sitemap won't be updated until index value increases... Which won't happen until January 31, 2012!

    Where did I get wrong?
    I made it work just by removing the & .

Sign In or Register to comment.