problème [Avancé] Zéro Duplicate V 0.2.2

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

Modérateur: Modérateurs

problème [Avancé] Zéro Duplicate V 0.2.2

Messagede eric6779 » Mar Juin 19, 2007 2:20 pm

Salut all,


j'obtiens cette erreur :
Fatal error: Call to undefined method: phpbb_seo->seo_req_uri() in C:\wamp\www\oxy\index.php on line 205


index.php ligne 203 à 223 :
Code: Tout sélectionner
$db->sql_freeresult($result);
// www.phpBB-SEO.com SEO TOOLKIT BEGIN
$uri = $phpbb_seo->seo_req_uri();
$phpbb_seo->seo_cond(!$userdata['session_logged_in'] && (strpos($uri, "sid=" ) !== FALSE ));
if ( $viewcat > 0 ) {
   $phpbb_seo->page_url = $phpbb_seo->format_url($this_cat_title, $phpbb_seo->seo_static['cat']) . $phpbb_seo->seo_delim['cat'] . $viewcat . $phpbb_seo->seo_ext['cat'];
   if ( $phpbb_seo->do_redir || strpos($uri, $phpbb_seo->page_url) === FALSE) {
      $phpbb_seo->seo_redirect($phpbb_seo->seo_path['phpbb_url'] . $phpbb_seo->page_url);
   }
} elseif ($viewcat == -1) {
   $mark_use = ($userdata['session_logged_in']) ? $mark_read : '';
   if (!empty($phpbb_seo->seo_static['index'])) {
      $phpbb_seo->seo_cond(( $mark_use == '' &&  strpos($uri, $phpbb_seo->seo_static['index']) === FALSE ), TRUE);
   } else {
      $phpbb_seo->seo_cond(( $mark_use == '' &&  strpos($uri, "index.$phpEx") !== FALSE ), TRUE);
   }
   if ( $phpbb_seo->do_redir) {
      $phpbb_seo->seo_redirect($phpbb_seo->seo_path['phpbb_url'] . $phpbb_seo->seo_static['index']);
   }
}
// www.phpBB-SEO.com SEO TOOLKIT END



le fichier phpbb_seo_class :

[Mod]Trop de code[/Mod]


Ce n'est pas une mise à jour mais une installe toute fraiche.

C'est pourtant correct...

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

Publicité

Messagede SeO » Mar Juin 19, 2007 5:24 pm

Le truc c'est :
Code: Tout sélectionner
#
#-----[ FIND ]------------------------------------------
#

}
?>

#
#-----[ BEFORE, ADD ]------------------------------------------
#


Pas

Code: Tout sélectionner
#
#-----[ FIND ]------------------------------------------
#

?>

#
#-----[ BEFORE, ADD ]------------------------------------------
#


Dans phpbb_seo_class.php
SeO
Admin
Admin
 
Messages: 6333
Inscription: Mer Mar 15, 2006 9:41 pm

Messagede eric6779 » Mar Juin 19, 2007 5:30 pm

C'est ce que j'ai fait dcz ...

tu le peux constater de toi même... ou je me suis planter ?


bon alors la fin du fichier :
Code: Tout sélectionner
   /**
   * Will return the remaining GET vars to take care of
   * @access private
   */
   function query_string() {
      if(empty($this->get_vars)) {
         return '';
      }
      $params = array();
      foreach($this->get_vars as $key => $value) {
         $params[] = $key . '=' . $value;
      }
      return '?' . implode('&', $params);
   }
   // --> Add on Functions <--
   // --> Gen stats
   /**
   * Returns usable microtime
   * Borrowed from php.net
   * Required for the phpBB SEO Google sitemaps module
   */
   function microtime_float() {
      return array_sum(explode(' ',microtime()));
   }

}
?>


le résultat donne ceci :
Code: Tout sélectionner
   /**
   * Will return the remaining GET vars to take care of
   * @access private
   */
   function query_string() {
      if(empty($this->get_vars)) {
         return '';
      }
      $params = array();
      foreach($this->get_vars as $key => $value) {
         $params[] = $key . '=' . $value;
      }
      return '?' . implode('&', $params);
   }
   // --> Add on Functions <--
   // --> Gen stats
   /**
   * Returns usable microtime
   * Borrowed from php.net
   * Required for the phpBB SEO Google sitemaps module
   */
   function microtime_float() {
      return array_sum(explode(' ',microtime()));
   }
// --> Zero Duplicate
   /**
   * Custom HTTP 301 redirections.
   * To kill duplicates
   */
   function seo_redirect($url, $header = "301 Moved Permanently", $code = 301, $replace = TRUE) {
      global $db;
      if ( !empty($db) ) {
         $db->sql_close();
      }
      if (strstr(urldecode($url), "\n") || strstr(urldecode($url), "\r") || strstr(urldecode($url), ';url')) {
         message_die(GENERAL_ERROR, 'Tried to redirect to potentially insecure url.');
      }
      $http = (@function_exists("getallheaders")) ? "HTTP/1.1 " : "Status: ";
      header($http . $header, $replace, $code);
      header("Location:" . $url);
      exit();
   }
   /**
   * Helps out grabbing boolean vars
   */
   function seo_cond($bool = FALSE, $or = FALSE) {
      if ( $bool || ($this->do_redir && $or) ) {
         $this->do_redir = TRUE;
      }
      return;
   }
   /**
   * Returns the REQUEST_URI
   */
   function seo_req_uri() {
      // Apache mod_rewrite
      if ( isset($_SERVER['REQUEST_URI']) ) {
         return $_SERVER['REQUEST_URI'];
      }
      // IIS  isapi_rewrite
      if ( isset($_SERVER['HTTP_X_REWRITE_URL']) ) {
         return $_SERVER['HTTP_X_REWRITE_URL'];
      }
      // no mod rewrite
      return  $_SERVER['SCRIPT_NAME'] . ( ( isset($_SERVER['QUERY_STRING']) ) ? '?'.$_SERVER['QUERY_STRING'] : "" );
   }
/**
   * check start var consistency
   */
   function seo_start($start = 0, $limit = 0) {
      if ($limit > 0) {
         $start = ( is_int( $start/$limit ) ) ? $start : intval($start/$limit)*$limit;
         $this->start = ( $start > 0  ) ? $this->seo_static['start'] . $start : '';
      } else {
         $this->start = ( $start > 0  ) ? $this->seo_static['start'] . $start : '';
      }
   }
}
?>



et ça marche lol.


par contre en tapant -http://mon_site.com/ => je n'obtiens plus la redirection sur -http://mon_site.com/index.html

ça ne fonctionne plus le rewriting ?
eric6779
PR1
PR1
 
Messages: 171
Inscription: Ven Déc 22, 2006 2:28 am

Messagede dcz » Ven Juin 22, 2007 11:50 am

Tu avais vraiment fait la boulette dans le code que tu avais posté ;)

Du coup normal que ça marche maintenant.

Pour la redirection vers index.html, tu as bien :

Code: Tout sélectionner
         'index' => 'index.html'


Et pas :

Code: Tout sélectionner
         'index' => ''


Dans phpbb_seo/phpbb_seo_class.php ?
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 » Ven Juin 22, 2007 12:19 pm

Merci pour le correctif mais sur mon ancien site, je n'avais pas cette erreur avec index.html :
Not Found


Je viens de vérifier sur mon ancien ftp et index.html est inéxistant et pourtant :
http://www.leericdu67.fr/index.html



Sujet réglé, problème dans mon htaccess...

merci joe ;)
eric6779
PR1
PR1
 
Messages: 171
Inscription: Ven Déc 22, 2006 2:28 am

Messagede dcz » Ven Juin 22, 2007 1:19 pm

eric6779 a écrit:merci joe ;)


:lol:
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 » Ven Juin 22, 2007 1:24 pm

MERCI DCZ :lol:

C'est vrai que je t'ai oublié, désolé :oops:
eric6779
PR1
PR1
 
Messages: 171
Inscription: Ven Déc 22, 2006 2:28 am

Messagede dcz » Ven Juin 22, 2007 1:26 pm

:lol:, en fait tu voulais parler de SeO, je me demandais d'où sortais ce joe, ou si c'était une petit attention "maison" ;)

++
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 » Ven Juin 22, 2007 1:27 pm

une petite attention maison ?


non joe, c'était pour joebart, il se reconnaîtra ;)
eric6779
PR1
PR1
 
Messages: 171
Inscription: Ven Déc 22, 2006 2:28 am

Messagede dcz » Ven Juin 22, 2007 1:30 pm

Ahh, tu parlais à un fantôme, enfin, il a pas répondu sur ce fil joebart.

Du coup j'ai cru que dans dans élan d'affection tu m'avais appelé joe :lol:
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 » Ven Juin 22, 2007 1:32 pm

loooll non mais il a lu ma demande et vu qu'il m'a parler via msn, je lui ai demander et c'est la qu'il a trouver l'erreur. ;)
eric6779
PR1
PR1
 
Messages: 171
Inscription: Ven Déc 22, 2006 2:28 am


Retourner vers Zéro duplicate phpBB2

 


  • Articles en relation
    Réponses
    Vus
    Dernier message

Qui est en ligne

Utilisateurs parcourant ce forum: Aucun utilisateur enregistré et 3 invités