Google Sitemap pour Dle Forum

08 Jan, 2021

481 Vues

1 Commentaires



Avec ce module, votre forum DLE sera entièrement visible par Google. Pour cela, le module construit une carte de forum (sitemap.xml) pour les moteurs de recherche.

Installation

1. Ouvrez: engine/classes/google.class.php

Rechercher:
$map .= $this->get_news();


Ajouter en dessous
$map .= $this->get_dleforum();


Rechercher:
function get_xml($loc, $lastmod){


Ajouter au dessus
function get_dleforum() {
global $db, $forum_config;

$xml = "";
$lastmod=date("Y-m-d");

$this->priority = $this->stat_priority;

$result = $db->query("SELECT tid FROM " . PREFIX . "_forum_topics");

while($row = $db->get_row($result)) {
	
  if( $forum_config['mod_rewrite'] == 0 ){  
  $loc = $this->home."index.php?do=forum&showtopic=".$row['tid'];
  }else{ 
  $loc = $this->home."forum/topic_".$row['tid'];
  }

  $xml .= $this->get_xml($loc, $lastmod);
}
return $xml;
}


Maintenant, direction votre site http //yoursite/admin.php?mod=googlemap et mettez à jour votre site map pour y inclure Dle Forum.

Ajouter un commentaire

Votre adresse électronique ne sera pas publiée. Les champs obligatoires sont marqués *

Information

Les utilisateurs du Invités ne sont pas autorisés à ajouter des commentaires à cette publication.

Commentaires 1
  1. 6 Janvier 2022 23:10

    Stricker

    Merci pour ce hack, installé et fonctionnel :)