|
|
A la recherche du fichier xfg.php de Xoops for google |
|
Régulier 
Inscrit: 09/04/2006 21:04
|
Bonjour tout le monde, Je suis à la recherche du fichier "xfg.php" de Xoops for google pour pouvoir donner des titres et descriptions à certaines pages de mon site. J’ai effectué plusieurs recherches, mais je n’ai pas trouvé ce fichier. Quelqu'un sait où je peux télécharger ce fichier ?
Merci d’avance pour votre aide.
Posté le : 23/08/2008 17:57
|
|
Développeur web.
|
|
|
Re: A recherche du fichier xfg.php de Xoops for google |
|
Xoops accro 
Inscrit: 25/11/2004 12:53
De 48400 Florac - France
|
Bonsoir, Regarde si c'est ça :
<?php
// ------------------------------------------------------------------------ //
// Xoops For Google - Hack for XOOPS 2.0.x //
// Copyright (c) 2005 Herv Thouzard //
// <http://www.herve-thouzard.com/>&nb ... nbsp; //
// ------------------------------------------------------------------------- //
// This program is free software; you can redistribute it and/or modify //
// it under the terms of the GNU General Public License as published by //
// the Free Software Foundation; either version 2 of the License, or //
// (at your option) any later version. //
// //
// You may not change or alter any portion of this comment or credits //
// of supporting developers from this source code or any supporting //
// source code which is considered copyrighted (c) material of the //
// original comment or credit authors. //
// //
// This program is distributed in the hope that it will be useful, //
// but WITHOUT ANY WARRANTY; without even the implied warranty of //
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
// GNU General Public License for more details. //
// //
// You should have received a copy of the GNU General Public License //
// along with this program; if not, write to the Free Software //
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA //
// ------------------------------------------------------------------------ //
/*
How to use, simply copy the following code to your module :
// Hack made by Herv Thouzard (http://www.herve-thouzard.com)
include_once XOOPS_ROOT_PATH."/xfg.php";
xoops_create_page_title($article, $topic);
xoops_create_meta_description($content);
xoops_create_meta_keywords($content);
// End Hack
*/
if (!defined("XOOPS_ROOT_PATH")) {
die("XOOPS root path not defined");
}
/**
* Create the page's title
*
* @package Xoops
* @author Herv Thouzard (http://www.herve-thouzard.com)
* @copyright Herv Thouzard
*/
function xoops_create_page_title($article='', $topic='')
{
global $xoopsModule, $xoopsTpl;
$myts =& MyTextSanitizer::getInstance();
$content='';
if(!empty($article)) $content .= strip_tags($myts->htmlSpecialChars($article));
if(!empty($topic)) {
if(xoops_trim($content)!='') {
$content .= ' - '.strip_tags($myts->htmlSpecialChars($topic));
} else {
$content .= strip_tags($myts->htmlSpecialChars($topic));
}
}
if(is_object($xoopsModule) && xoops_trim($xoopsModule->name())!='') {
if(xoops_trim($content)!='') {
$content.=' - '.strip_tags($myts->htmlSpecialChars($xoopsModule->name()));
} else {
$content.=strip_tags($myts->htmlSpecialChars($xoopsModule->name()));
}
}
if($content!='') {
$xoopsTpl->assign('xoops_pagetitle', $content);
}
}
/**
* Create the meta description based on the content
*
* @package Xoops
* @author Herv Thouzard (http://www.herve-thouzard.com)
* @copyright Herv Thouzard
*/
function xoops_create_meta_description($content)
{
global $xoopsTpl;
$myts =& MyTextSanitizer::getInstance();
$content= $myts->undoHtmlSpecialChars($content);
$xoopsTpl->assign('xoops_meta_description', strip_tags($content));
}
/**
* Create the meta keywords based on the content
*
* @package Xoops
* @author Herv Thouzard (http://www.herve-thouzard.com)
* @copyright Herv Thouzard
*/
function xoops_create_meta_keywords($content)
{
// Parameters you can change **********************************************************
$method = 1; // Method to use
// 1=Create keywords in the same order as in the text
// 2=Keywords order is made according to the reverse keywords frequency
// (so the less frequent words appear in first in the list)
// 3=Same as previous, the only difference is that the most frequent
// words will appear in first in the list
$keywords_count = 40; // Number of keywords to create
// ************************************************************************************
global $xoopsTpl;
$tmp=array();
if(isset($_SESSION['xoops_keywords_limit'])) { // Search the "Minimum keyword length"
$limit = $_SESSION['xoops_keywords_limit'];
} else {
$config_handler =& xoops_gethandler('config');
$xoopsConfigSearch =& $config_handler->getConfigsByCat(XOOPS_CONF_SEARCH);
$limit=$xoopsConfigSearch['keyword_min'];
$_SESSION['xoops_keywords_limit']=$limit;
}
$myts =& MyTextSanitizer::getInstance();
$content = str_replace ("<br />", " ", $content);
$content= $myts->undoHtmlSpecialChars($content);
$content= strip_tags($content);
$content=strtolower($content);
$search_pattern=array(" ","t","rn","r","n",",",".","'",";",":",")","(",'"','?','!','{','}','[',']','<','>','/','+','-','_','\','*');
$replace_pattern=array(' ',' ',' ',' ',' ',' ',' ',' ','','','','','','','','','','','','','','','','','','','');
$content = str_replace($search_pattern, $replace_pattern, $content);
$keywords=explode(' ',$content);
switch($method) {
case 1: // Returns keywords in the same order that they were created in the text
$keywords=array_unique($keywords);
break;
case 2: // the keywords order is made according to the reverse keywords frequency (so the less frequent words appear in first in the list)
$keywords=array_count_values($keywords);
asort($keywords);
$keywords=array_keys($keywords);
break;
case 3: // Same as previous, the only difference is that the most frequent words will appear in first in the list
$keywords=array_count_values($keywords);
arsort($keywords);
$keywords=array_keys($keywords);
break;
}
foreach($keywords as $keyword) {
if(strlen($keyword)>=$limit && !is_numeric($keyword)) {
$tmp[]=$keyword;
}
}
$tmp=array_slice($tmp,0,$keywords_count);
if(count($tmp)>0) {
$xoopsTpl->assign('xoops_meta_keywords', implode(',',$tmp));
} else {
if(!isset($config_handler) || !is_object($config_handler)) {
$config_handler =& xoops_gethandler('config');
}
$xoopsConfigMetaFooter =& $config_handler->getConfigsByCat(XOOPS_CONF_METAFOOTER);
$xoopsTpl->assign('xoops_meta_keywords', $xoopsConfigMetaFooter['meta_keywords']);
}
}
?>
Philippe.
Posté le : 23/08/2008 18:23
|
|
|
|
|
Re: A la recherche du fichier xfg.php de Xoops for google |
|
Régulier 
Inscrit: 09/04/2006 21:04
|
Bonsoir, Merci Philippe pour ta réponse, je n'ai jamais utilisé ce fichier ou cette version de Xoops, mais le fichier m'a l'air bon ?
Posté le : 24/08/2008 02:34
|
|
Développeur web.
|
|
|
Re: A la recherche du fichier xfg.php de Xoops for google |
|
Régulier 
Inscrit: 09/04/2006 21:04
|
Bonjour, Quelqu'un sait où je peux télécharger Xoops for google ? je ne le trouve pas sur le site de Mr Hervé 
Posté le : 24/08/2008 13:49
|
|
Développeur web.
|
|
|
Re: A la recherche du fichier xfg.php de Xoops for google |
|
Régulier 
Inscrit: 09/04/2006 21:04
|
Personne ne sait ou je peux télécharger cette version ??
Posté le : 28/08/2008 00:17
|
|
Développeur web.
|
|
|
Re: A la recherche du fichier xfg.php de Xoops for google |
|
Régulier 
Inscrit: 21/03/2005 00:13
|
je peu te l'envoyer par mail envoi moi un mp avec ton adresse mail
Posté le : 28/08/2008 14:19
|
|
|
|
|
Re: A la recherche du fichier xfg.php de Xoops for google |
|
Xoops accro 
Inscrit: 25/02/2004 00:20
De Région parisienne
|
Citation : Ankyo a écrit: Bonjour,
Quelqu'un sait où je peux télécharger Xoops for google ? je ne le trouve pas sur le site de Mr Hervé 
Un copier/Coller du code posté par phmo devrait faire l'affaire.
Posté le : 28/08/2008 17:26
|
|
|
|
|
Re: A la recherche du fichier xfg.php de Xoops for google |
|
Régulier 
Inscrit: 09/04/2006 21:04
|
Merci DuGris, mais je voudrais le pack complet 
Posté le : 28/08/2008 18:48
|
|
Développeur web.
|
|
|
Re: A la recherche du fichier xfg.php de Xoops for google |
|
Régulier 
Inscrit: 21/03/2005 00:13
|
je viens de te l'envoyer
Posté le : 01/09/2008 18:38
|
|
|
|
|
Re: A la recherche du fichier xfg.php de Xoops for google |
|
Régulier 
Inscrit: 09/04/2006 21:04
|
Merci faridelha
Posté le : 04/09/2008 07:43
|
|
Développeur web.
|
Vous pouvez voir les sujets.
Vous ne pouvez pas débuter de nouveaux sujets.
Vous ne pouvez pas répondre aux contributions.
Vous ne pouvez pas éditer vos contributions.
Vous ne pouvez pas effacez vos contributions.
Vous ne pouvez pas ajouter de nouveaux sondages.
Vous ne pouvez pas voter en sondage.
Vous ne pouvez pas attacher des fichiers à vos contributions.
Vous ne pouvez pas poster sans approbation.
|