Subversion Repositories Applications.bazar

Compare Revisions

Ignore whitespace Rev 222 → Rev 223

/trunk/bibliotheque/bazar.fonct.rss.php
19,7 → 19,7
// | License along with this library; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
// +------------------------------------------------------------------------------------------------------+
// CVS : $Id: bazar.fonct.rss.php,v 1.76 2007-04-04 15:09:59 florian Exp $
// CVS : $Id: bazar.fonct.rss.php,v 1.77 2007-04-04 15:15:22 neiluj Exp $
/**
*
*@package bazar
28,7 → 28,7
*@author Florian Schmitt <florian@ecole-et-nature.org>
//Autres auteurs :
*@copyright Tela-Botanica 2000-2006
*@version $Revision: 1.76 $
*@version $Revision: 1.77 $
// +------------------------------------------------------------------------------------------------------+
*/
 
262,7 → 262,7
}
}
elseif ( $tableau[$i]['type']=='wikini' ) {
$res .= '<div class="BAZ_lien_wikini BAZ_lien_wikini_'.$GLOBALS['_BAZAR_']['class'].'"><a href="wikini/'.baz_titre_wiki($ligne["bf_titre"]).'">'.BAZ_ENTRER_PROJET.'</a></div>'."\n";
$res .= '<div class="BAZ_lien_wikini BAZ_lien_wikini_'.$GLOBALS['_BAZAR_']['class'].'"><a href="wikini/'.genere_nom_wiki($ligne["bf_titre"], TRUE).'">'.BAZ_ENTRER_PROJET.'</a></div>'."\n";
}
}
//afficher les liens pour l'annonce
476,7 → 476,55
return $res ;
}
 
// merci PHP 5 ...
function mb_str_split($str, $length = 1) {
if ($length < 1) return FALSE;
 
$result = array();
 
for ($i = 0; $i < strlen($str); $i += $length) {
$result[] = substr($str, $i, $length);
}
 
return $result;
}
//
 
function genere_nom_wiki($nom, $spaces = FALSE)
{
// traitement des accents
$nom = str_replace(array('é','è','ë','ê','É','È','Ë','Ê','&','£'), 'e', $nom);
$nom = str_replace(array('à','ä','â','Â','Ä','À','@'), 'a', $nom);
$nom = str_replace(array('ç','Ç'), 'c', $nom);
$nom = str_replace(array('ÿ','¾'), 'y', $nom);
$nom = str_replace(array('ô','ö','ò','Ô','Ò','Ö'), 'o', $nom);
$nom = str_replace(array('ï','î','ì','Î','Ï','Ì'), 'i', $nom);
$nom = str_replace('$', 's', $nom);
$temp = mb_str_split($nom);
$count = 0;
$final = NULL;
foreach($temp as $letter)
{
if(preg_match('/([[:space:]]|[[:punct:]])/', $letter))
{
$final .= ($spaces ? '_' : '');
} elseif(preg_match ('/[a-zA-Z0-9]/', $letter)) {
$final .= (($count == 0 || $count == (strlen($nom) - 1)) ? strtoupper($letter) : strtolower($letter));
}
$count++;
}
// vérifions que le retour n'est pas uniquement un underscore
if(preg_match('/^[[:punct:]]+$/', $final)) return FALSE;
 
// sinon retour du nom formaté
return($final);
}
 
 
 
/** RSSversHTML () transforme un flux RSS (en XML) en page HTML
*
* On passe en paramètre le contenu du flux RSS, on affiche ou non la description,
1130,6 → 1178,9
/* +--Fin du code ----------------------------------------------------------------------------------------+
*
* $Log: not supported by cvs2svn $
* Revision 1.76 2007/04/04 15:09:59 florian
* modif class fichiers
*
* Revision 1.75 2007/04/04 08:51:01 florian
* gestion des classes spécifiques pour habiller par CSS les fiches bazar
*