Warning: The author of this contribution does not provide support for it anymore.

phpBB3 SEO Sitemap

Integrity with tas2580 seourls - phpBB3 SEO Sitemap

Integrity with tas2580 seourls

by cichy_ludek » Thu Nov 10, 2016 11:39 pm

Maybe you want to use this ext with tas2580 seourls ext to generate nice links.
So you need only few changes.
1) Open core.php in main folder of extension.
2) Locate public function generate_sitemap(){
somewhere there put line:

Code: Select all

if (class_exists('\tas2580\seourls\event\base')) $seourl = new \tas2580\seourls\event\base($this->auth, $this->config, $this->phpbb_root_path);

3) Locate line:

Code: Select all

$f_url = $this->path . "viewforum.$this->php_ext?f=$f_id";
and put BEFORE:

Code: Select all

if ($seourl!=null) $f_url= $this->path. $seourl->generate_forum_link($f_id,$forums[$f_id]['forum_name']); else 

4) few lines after this you can find:

Code: Select all

$f_url = $this->path . "viewforum.$this->php_ext?f=$f_id&start=" . ($page * $per);

Before this put:

Code: Select all

if ($seourl!=null) $f_url= $this->path. $seourl->generate_forum_link($f_id,$forums[$f_id]['forum_name'],($page * $per)); else 

Forums are done, time for topics.
5) Before:

Code: Select all

$t_url = $this->path . "viewtopic.$this->php_ext?" . $f_part . "t=$t_id";


Code: Select all

if ($seourl!=null) $t_url= $this->path. $seourl->generate_topic_link($f_id,$forums[$f_id]['forum_name'],$t_id,$data['topic_title']);else

6) And before:

Code: Select all

$t_url = $this->path . "viewtopic.$this->php_ext?" . $f_part . "t=$t_id&start=" . ($page * $per);

Code: Select all

if ($seourl!=null) $t_url= $this->path. $seourl->generate_topic_link($f_id,$forums[$f_id]['forum_name'],$t_id,$data['topic_title'],($page * $per));   else

7) [edit]
We need also get topic title, so there:

Code: Select all

$sql = 'SELECT t.topic_id' . $seo_add . ', t.topic_type, t.topic_last_post_id, t.forum_id, p.post_id, p.post_modified

just add , t.topic_title

Maybe someone find this helpful :)
Registered User
Posts: 72
Joined: Fri Jun 17, 2016 12:31 pm