ElkArte Community

General => Chit Chat => Topic started by: kode54 on January 22, 2016, 01:41:24 am

Title: Sitemap generator
Post by: kode54 on January 22, 2016, 01:41:24 am
Our forum, Hydrogenaudio (https://hydrogenaud.io), also employed a sitemap generator prior to the move from IPS Board 2.x.

I have adapted this generator to ElkArte, and posted it here:

https://gist.github.com/kode54/6cbcf2dc4f5c018be16b
Title: Re: Sitemap generator
Post by: Vekseid on January 26, 2016, 01:08:32 am
Nice. I'll try to work my own code in and post it.

Elliquiy generates multiple maps because we passed the 50k page limit a long time ago, even for public threads.
Title: Re: Sitemap generator
Post by: kode54 on January 26, 2016, 01:35:11 am
I've updated it a bit, fixed the use of message IDs for offset pages. Now it correctly uses post count offsets in increments of 25, which may be amended to whatever count you want based on your site's default posts per page count. Or I could amend it to fetch that count from the configuration table.

I await your changes as well.
Title: Re: Sitemap generator
Post by: Flavio93Zena on February 02, 2016, 09:38:39 pm
Many likes but no comments by the big guys here? O.o
Title: Re: Sitemap generator
Post by: emanuele on February 21, 2016, 06:14:46 am
Quote from: Flavio93Zena (#OpIsis) – Many likes but no comments by the big guys here? O.o
That's what I always said about likes. :P
Title: Re: Sitemap generator
Post by: kode54 on February 22, 2016, 12:33:41 am
Quote from: derived – last automated sitemap generator i bothered with, posted a url to admin section


This one intentionally checks the access lists against the Guests group, and even then, it only posts links to topics and the date of the most recent post.
Title: Re: Sitemap generator
Post by: radu81 on November 26, 2017, 07:05:28 pm
Thanks for sharing this @kode54

just a note if could be useful for someone else, if you are not using the rewrite urls included into elkarte this should be edited from:
Code: (FROM) [Select]
                   '/index.php/topic,'.$row['id_topic'].'.0.html';
      } else {
      $posturl = $boardurl.
                   '/index.php/topic,'.$row['id_topic'].'.'.$lastpage.'.html';

Code: (TO) [Select]
                   '/index.php?topic='.$row['id_topic'].'.0';
      } else {
      $posturl = $boardurl.
                   '/index.php?topic='.$row['id_topic'].'.'.$lastpage;

I'm not sure about this:
Code: [Select]
      $lastpage = (intval(($row['num_replies'] + 1) / 25)) * 25;
Should 25 be replaced with the number of posts  displayed per page? I am using 15 posts per page.
Title: Re: Sitemap generator
Post by: kode54 on November 26, 2017, 07:21:47 pm
Ah, yes, that should be replaced with the number of posts per page. Maybe I should read that programmatically from the configuration?