Adaptation zero dupes

Forum de support du Zéro duplicate.
Solution de redirections HTTP 301 personnalisées pour phpBB2.

Modérateur: Modérateurs

Adaptation zero dupes

Messagede eric6779 » Dim Fév 24, 2008 10:04 pm

Bonsoir all,


dans viewtopic, il demande ceci :
#
#-----[ FIND ]------------------------------------------
#
//
// Define censored word matches
//
$orig_word = array();
$replacement_word = array();
obtain_word_list($orig_word, $replacement_word);

//
// Censor topic title
//
if ( count($orig_word) )
{
$topic_title = preg_replace($orig_word, $replacement_word, $topic_title);
}
// www.phpBB-SEO.com SEO TOOLKIT BEGIN
$phpbb_seo->seo_url['topic'][$topic_id] = $phpbb_seo->format_url($topic_title);
// www.phpBB-SEO.com SEO TOOLKIT END



et moi j'ai ceci :
Code: Tout sélectionner
//
// Define censored word matches
//
$orig_word = array();
$replacement_word = array();
obtain_word_list($orig_word, $replacement_word);

//
// Censor topic title
//
//-- mod : disable word censor for single forums -------------------------------
//-- delete
/*-MOD
if ( count($orig_word) )
MOD-*/
//-- add
if ( count($orig_word) && (!$forum_topic_data['disable_word_censor']) )
//-- fin mod : disable word censor for single forums ---------------------------
{
   $topic_title = preg_replace($orig_word, $replacement_word, $topic_title);
}

// www.phpBB-SEO.com SEO TOOLKIT BEGIN
if ( !isset($phpbb_seo->seo_url['topic'][$topic_id]) ) {
   $phpbb_seo->seo_url['topic'][$topic_id] = $phpbb_seo->format_url($topic_title);
}
// www.phpBB-SEO.com SEO TOOLKIT END



puis je faire comme ceci :
// www.phpBB-SEO.com SEO TOOLKIT BEGIN
// Moved this a little above for the zero dupe
//
// Define censored word matches
//
//$orig_word = array();
//$replacement_word = array();
//obtain_word_list($orig_word, $replacement_word);
if ( count($orig_word) && (!$forum_topic_data['disable_word_censor']) )
//-- fin mod : disable word censor for single forums ---------------------------
{
$topic_title = preg_replace($orig_word, $replacement_word, $topic_title);
}
//
// Censor topic title
//
//if ( count($orig_word) )
//{
// $topic_title = preg_replace($orig_word, $replacement_word, $topic_title);
//}
// www.phpBB-SEO.com SEO TOOLKIT END



ou cela vas poser problème ?


Merci dcz :)
eric6779
PR1
PR1
 
Messages: 171
Inscription: Ven Déc 22, 2006 2:28 am

Publicité

Messagede dcz » Lun Fév 25, 2008 2:57 pm

Pour conserver les effets de ton mod, il faut déplacer tout son code, donc tu mets :

Code: Tout sélectionner
//
// Define censored word matches
//
$orig_word = array();
$replacement_word = array();
obtain_word_list($orig_word, $replacement_word);

//
// Censor topic title
//
//-- mod : disable word censor for single forums -------------------------------
//-- delete
/*-MOD
if ( count($orig_word) )
MOD-*/
//-- add
if ( count($orig_word) && (!$forum_topic_data['disable_word_censor']) )
//-- fin mod : disable word censor for single forums ---------------------------
{
   $topic_title = preg_replace($orig_word, $replacement_word, $topic_title);
}

// www.phpBB-SEO.com SEO TOOLKIT BEGIN
if ( !isset($phpbb_seo->seo_url['topic'][$topic_id]) ) {
   $phpbb_seo->seo_url['topic'][$topic_id] = $phpbb_seo->format_url($topic_title);
}
// www.phpBB-SEO.com SEO TOOLKIT END


A la place de :

Code: Tout sélectionner
// Define censored word matches
$orig_word = array();
$replacement_word = array();
obtain_word_list($orig_word, $replacement_word);
$topic_title = ( count($orig_word) ) ? preg_replace($orig_word, $replacement_word, $topic_title) : $topic_title;
$phpbb_seo->seo_url['topic'][$topic_id] = $phpbb_seo->format_url($topic_title);


dans le code ajouté par le zero dupe, et tu le remplaces (à l'endroit ou il se trouve au début dans ton fichier) par :

Code: Tout sélectionner
// www.phpBB-SEO.com SEO TOOLKIT BEGIN
// Moved this a little above for the zero dupe //
// Define censored word matches
//
//$orig_word = array();
//$replacement_word = array();
//obtain_word_list($orig_word, $replacement_word);

//
// Censor topic title
//
//-- mod : disable word censor for single forums -------------------------------
//-- delete
/*-MOD
if ( count($orig_word) )
MOD-*/
//-- add
//if ( count($orig_word) && (!$forum_topic_data['disable_word_censor']) )
//-- fin mod : disable word censor for single forums ---------------------------
//{
//   $topic_title = preg_replace($orig_word, $replacement_word, $topic_title);
//}

// www.phpBB-SEO.com SEO TOOLKIT BEGIN
//if ( !isset($phpbb_seo->seo_url['topic'][$topic_id]) ) {
//   $phpbb_seo->seo_url['topic'][$topic_id] = $phpbb_seo->format_url($topic_title);
//}
// www.phpBB-SEO.com SEO TOOLKIT END


Là, on commente le code pour le rendre inactif tout en conservant trace de sa position initiale (cela pourrait être utile lors d'une MAJ), mais tu peux aussi bien l'effacer si tu veux, l'essentiel c'est que ce code doit se dérouler avant le zéro dupe.

++
Useful links :
SEO Forum || SEO Directory || SEO phpBB || Search
____________________

Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Recherche
dcz
Admin
Admin
 
Messages: 21219
Inscription: Ven Avr 28, 2006 9:03 pm

Messagede eric6779 » Lun Fév 25, 2008 3:04 pm

donc au final, ça pourrai donner ceci :
Code: Tout sélectionner
//
// Define censored word matches
//
$orig_word = array();
$replacement_word = array();
obtain_word_list($orig_word, $replacement_word);

//
// Censor topic title
//
//-- mod : disable word censor for single forums -------------------------------
//-- delete
/*-MOD
if ( count($orig_word) )
MOD-*/
//-- add
if ( count($orig_word) && (!$forum_topic_data['disable_word_censor']) )
//-- fin mod : disable word censor for single forums ---------------------------
{
   $topic_title = preg_replace($orig_word, $replacement_word, $topic_title);
}

// www.phpBB-SEO.com SEO TOOLKIT BEGIN
if ( !isset($phpbb_seo->seo_url['topic'][$topic_id]) ) {
   $phpbb_seo->seo_url['topic'][$topic_id] = $phpbb_seo->format_url($topic_title);
}
// www.phpBB-SEO.com SEO TOOLKIT END

//
// Was a highlight request part of the URI?
//



par contre, j'ai deux fois :
Define censored word matches


Ligne 379 à 400 :
Code: Tout sélectionner
// Define censored word matches
$orig_word = array();
$replacement_word = array();
obtain_word_list($orig_word, $replacement_word);
$topic_title = ( count($orig_word) ) ? preg_replace($orig_word, $replacement_word, $topic_title) : $topic_title;
$phpbb_seo->seo_url['topic'][$topic_id] = $phpbb_seo->format_url($topic_title);
$uri = $phpbb_seo->seo_req_uri();
$postorder_redir = empty($_POST['postorder']) && empty($_GET['postorder']);
if ($_GET['postorder'] == 'asc'  || $_POST['postorder'] == 'asc' ) {
   $postorder_redir = TRUE;
}
$phpbb_seo->seo_start( $start, $board_config['posts_per_page'] );
$phpbb_seo->page_url = $phpbb_seo->seo_url['topic'][$topic_id] . $phpbb_seo->seo_delim['topic'] . $topic_id . $phpbb_seo->start . $phpbb_seo->seo_ext['topic'];
$phpbb_seo->seo_cond(!$userdata['session_logged_in'] && ( strpos($uri, "sid=" ) !== FALSE ) );
if ( $phpbb_seo->do_redir || ( $postorder_redir &&  strpos($uri, 'watch=') === FALSE && strpos($uri, $phpbb_seo->page_url) === FALSE )  ) {
   $phpbb_seo->seo_redirect( $phpbb_seo->seo_path['phpbb_url'] . $phpbb_seo->page_url . ( ( $post_id ) ? "#$post_id" : "" ) );
}
// www.phpBB-SEO.com SEO TOOLKIT END

//
// Is user watching this thread?
//



et ligne 714 à 744 (la partie dont je te demandai justement) :
Code: Tout sélectionner
//
// Define censored word matches
//
$orig_word = array();
$replacement_word = array();
obtain_word_list($orig_word, $replacement_word);

//
// Censor topic title
//
//-- mod : disable word censor for single forums -------------------------------
//-- delete
/*-MOD
if ( count($orig_word) )
MOD-*/
//-- add
if ( count($orig_word) && (!$forum_topic_data['disable_word_censor']) )
//-- fin mod : disable word censor for single forums ---------------------------
{
   $topic_title = preg_replace($orig_word, $replacement_word, $topic_title);
}

// www.phpBB-SEO.com SEO TOOLKIT BEGIN
if ( !isset($phpbb_seo->seo_url['topic'][$topic_id]) ) {
   $phpbb_seo->seo_url['topic'][$topic_id] = $phpbb_seo->format_url($topic_title);
}
// www.phpBB-SEO.com SEO TOOLKIT END

//
// Was a highlight request part of the URI?
//



car toi, tu me parle de modifier le premier code :s


Merci de m'éclaircir les idées :)
eric6779
PR1
PR1
 
Messages: 171
Inscription: Ven Déc 22, 2006 2:28 am


Retourner vers Zéro duplicate phpBB2

Qui est en ligne

Utilisateurs parcourant ce forum: Aucun utilisateur enregistré et 1 invité


 
cron