XML Sitemap for XenForo 1.3 [Not needed, included in 1.4]

When I try to run the cron manually, I get:

"sprintf() [function.sprintf]: Too few arguments"

Any suggestions? Thanks.
I can confirm this with version 1.1.2 (not 1.1.2d, I am unable to upgrade at the moment) and only in Debug mode, the cause beeing in Sitemap/Helper/Forum.php on line 50
PHP:
 XenForo_Error::debug('-- Excluded: ' . $url);
Just commenting this line is safe and does not modify the addon functions (you only won't be able to see which urls are excluded from your forums sitemap). I did not investigate further for the real cause of the error.


@Rigel
I just finished developing a couple of helpers for additional nodes (Waindigo's addon "Library" adds libraries and articles nodes). How should I distribute them? Would you mind including them yourself in the Sitemap addon, or do you prefer that I post my code modifications here directly?
 
I can confirm this with version 1.1.2 (not 1.1.2d, I am unable to upgrade at the moment) and only in Debug mode, the cause beeing in Sitemap/Helper/Forum.php on line 50
PHP:
 XenForo_Error::debug('-- Excluded: ' . $url);
Just commenting this line is safe and does not modify the addon functions (you only won't be able to see which urls are excluded from your forums sitemap). I did not investigate further for the real cause of the error.


@Rigel
I just finished developing a couple of helpers for additional nodes (Waindigo's addon "Library" adds libraries and articles nodes). How should I distribute them? Would you mind including them yourself in the Sitemap addon, or do you prefer that I post my code modifications here directly?
Please post them here directly, I don't mind. People interested in those can download them.
 
Please post them here directly, I don't mind. People interested in those can download them.
Thanks, I'll release them here once tested.

FYI, I get the issue described above with latest version, and the same error is also raised by another XenForo_Error::debug call in Ping.php on lines 46 & 59.
 
Hmm... This happens on my local working copy with PHP 5.3.8. Wasn't this fixed with XF 1.1.3? Either it is a different bug or it is not completely fixed. I suppose you cannot reproduce? I'll take the time and test with another version of PHP later this week.
 

Attachments

  • Capture.webp
    Capture.webp
    53.9 KB · Views: 20
  • Capture2.webp
    Capture2.webp
    61.1 KB · Views: 21
Hmm... This happens on my local working copy with PHP 5.3.8. Wasn't this fixed with XF 1.1.3? Either it is a different bug or it is not completely fixed. I suppose you cannot reproduce? I'll take the time and test with another version of PHP later this week.
I just fixed that in the code itself, it will no longer use the XenForo debugger, but a custom one that does not reproduce the error.
 
Waindigo Library support in Sitemap for XenForo


EDIT 10-05-12: This modification is not compatible with latest version of the addon, please wait for me to update the mod and stick with version <1.2 until then. Do not apply if running >=1.2.

I wrote some short code adaptations in order to generate the following sitemap files from Library contents:
- Article & Article pages sitemap,
- Libraries & Library pages sitemap.

The attached zip contains a single patch with code changes to the existing Index.php file, plus additional handler files for the elements listed above.

You have to apply the patch to the library/XfAddons directory.

This was subject to minimal testing. Do not hesitate to get back to me if you discover bugs, I will probably be maintaining it for my own purposes.
 

Attachments

I just installed the addon and changed the sitemap's CHMOD to 777. Now what do I do to actually run this and create a map?!

I see it creates a new one every night (?), should I just wait for it to happen or can I run it right away? I find no run button... :unsure: /Rookie
 
You can either wait for it to happen (around 5AM is the default value, if I remember well), or launch it from

AdminCP > Tools > Cron Entries

and select Controls > Run from the "Rebuild Sitemap" item in the list.
 
You can either wait for it to happen (around 5AM is the default value, if I remember well), or launch it from

AdminCP > Tools > Cron Entries

and select Controls > Run from the "Rebuild Sitemap" item in the list.
Hi ManOnDaMoon and thank you for your answer! One little problem though, I cant find "Controls" in there. This is how it looks like.

If it doesn't work I guess Ill have to wait, my deault time seems to be 3AM. Im eager to do it though! :):)
sitemapscrsh.webp
 
Well, this is because you clicked the item in the Cron Entry list. The "Run" command is available directly from the list, see the tiny menu on the right :
Capture.webp
 
Wow, I put my link and sitemap onto Google tonight and my site is already showing up when you make a search on Google (even though its a pretty empty forum). A couple of hours ago it was totally invisible, thank you addon developers and ManOnDaMoon for your help!

One question: my help page and its sub pages look terrible and I dont even want them to show up on Google, how can I hide them from being in my sitemap? Im talking about http://mysite.com/help/ and the ones under it like http://mysite.com/help/smilies.

Can I make an exception in this addon or do I have to use robots.txt or something?

EDIT: I just made a robots.txt file with a lot of exceptions. Ill try it and see how it works. Does this look good? I mean, who wants to get these things as a search result...

Code:
User-agent: *
Disallow: /misc
Disallow: /help
Disallow: /search
Disallow: /members
Disallow: /login
Disallow: /online
Disallow: /lost-password
 
Wow, I put my link and sitemap onto Google tonight and my site is already showing up when you make a search on Google (even though its a pretty empty forum). A couple of hours ago it was totally invisible, thank you addon developers and ManOnDaMoon for your help!

One question: my help page and its sub pages look terrible and I dont even want them to show up on Google, how can I hide them from being in my sitemap? Im talking about http://mysite.com/help/ and the ones under it like http://mysite.com/help/smilies.

Can I make an exception in this addon or do I have to use robots.txt or something?

EDIT: I just made a robots.txt file with a lot of exceptions. Ill try it and see how it works. Does this look good? I mean, who wants to get these things as a search result...

Code:
User-agent: *
Disallow: /misc
Disallow: /help
Disallow: /search
Disallow: /members
Disallow: /login
Disallow: /online
Disallow: /lost-password
This is what I've done:

Code:
Sitemap: http://www.mysite.com/forums/sitemap/sitemap.xml.gz
User-agent: Mediapartners-Google
Disallow:
 
User-agent: BoardReader
Disallow: /
 
User-agent: BoardTracker
Disallow: /
 
User-agent: Gigabot
Disallow: /
 
User-agent: Twiceler
Disallow: /
 
User-agent: dotbot
Disallow: /
 
User-Agent: *
Disallow: /forums/find-new/
Disallow: /forums/account/
Disallow: /forums/attachments/
Disallow: /forums/goto/
Disallow: /forums/posts/
Disallow: /forums/login/
Disallow: /forums/admin.php
Disallow: /forums/search/
Disallow: /forums/help/
Disallow: /forums/online/
Allow: /

The ones I disallow are because they are scrapers and steal your content. I've heard they don't listen to the robots file but I figured it can't hurt. I've also heard that if you put it on after they have stolen your content, they will fight with you to continue stealing your content. I think they've even bribed some of my friends to continue to allow them to steal their content. Very shady companies and Google does nothing about them yet they will lay the smack down on some of the little guys trying to do everything correctly.
 
Top Bottom