Subversion Repositories Applications.bazar

Rev

Rev 222 | Rev 225 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 222 Rev 223
Line 17... Line 17...
17
// |                                                                                                      |
17
// |                                                                                                      |
18
// | You should have received a copy of the GNU Lesser General Public                                     |
18
// | You should have received a copy of the GNU Lesser General Public                                     |
19
// | License along with this library; if not, write to the Free Software                                  |
19
// | License along with this library; if not, write to the Free Software                                  |
20
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                            |
20
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                            |
21
// +------------------------------------------------------------------------------------------------------+
21
// +------------------------------------------------------------------------------------------------------+
22
// CVS : $Id: bazar.fonct.rss.php,v 1.76 2007-04-04 15:09:59 florian Exp $
22
// CVS : $Id: bazar.fonct.rss.php,v 1.77 2007-04-04 15:15:22 neiluj Exp $
23
/**
23
/**
24
* 
24
* 
25
*@package bazar
25
*@package bazar
26
//Auteur original :
26
//Auteur original :
27
*@author        Alexandre GRANIER <alexandre@tela-botanica.org>
27
*@author        Alexandre GRANIER <alexandre@tela-botanica.org>
28
*@author        Florian Schmitt <florian@ecole-et-nature.org>
28
*@author        Florian Schmitt <florian@ecole-et-nature.org>
29
//Autres auteurs :
29
//Autres auteurs :
30
*@copyright     Tela-Botanica 2000-2006
30
*@copyright     Tela-Botanica 2000-2006
31
*@version       $Revision: 1.76 $
31
*@version       $Revision: 1.77 $
32
// +------------------------------------------------------------------------------------------------------+
32
// +------------------------------------------------------------------------------------------------------+
33
*/
33
*/
Line 34... Line 34...
34
 
34
 
35
// +------------------------------------------------------------------------------------------------------+
35
// +------------------------------------------------------------------------------------------------------+
Line 260... Line 260...
260
						$res .= '<span class="BAZ_texte BAZ_texte_'.$GLOBALS['_BAZAR_']['class'].'" id="'.$tableau[$i]['nom_bdd'].'_description"> '.strftime('%d.%m.%Y',strtotime($ligne[$val])).'</span>'."\n".'</div>'."\n";
260
						$res .= '<span class="BAZ_texte BAZ_texte_'.$GLOBALS['_BAZAR_']['class'].'" id="'.$tableau[$i]['nom_bdd'].'_description"> '.strftime('%d.%m.%Y',strtotime($ligne[$val])).'</span>'."\n".'</div>'."\n";
261
					}
261
					}
262
				}		
262
				}		
263
			}
263
			}
264
			elseif ( $tableau[$i]['type']=='wikini' ) {
264
			elseif ( $tableau[$i]['type']=='wikini' ) {
265
				$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";
265
				$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";
266
			}
266
			}
267
		}
267
		}
268
	//afficher les liens pour l'annonce
268
	//afficher les liens pour l'annonce
269
	$requete = 'SELECT  bu_url, bu_descriptif_url FROM bazar_url WHERE bu_ce_fiche='.$GLOBALS['_BAZAR_']['id_fiche'];
269
	$requete = 'SELECT  bu_url, bu_descriptif_url FROM bazar_url WHERE bu_ce_fiche='.$GLOBALS['_BAZAR_']['id_fiche'];
270
	$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
270
	$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
Line 474... Line 474...
474
	$GLOBALS['_BAZAR_']['url']->removeQueryString('id_commentaire');
474
	$GLOBALS['_BAZAR_']['url']->removeQueryString('id_commentaire');
475
	$GLOBALS['_BAZAR_']['url']->removeQueryString('typeannonce');
475
	$GLOBALS['_BAZAR_']['url']->removeQueryString('typeannonce');
476
	return $res ;
476
	return $res ;
477
}
477
}
Line -... Line 478...
-
 
478
 
-
 
479
// merci PHP 5 ...
-
 
480
function mb_str_split($str, $length = 1) {
-
 
481
  if ($length < 1) return FALSE;
-
 
482
 
-
 
483
  $result = array();
-
 
484
 
-
 
485
  for ($i = 0; $i < strlen($str); $i += $length) {
-
 
486
    $result[] = substr($str, $i, $length);
-
 
487
  }
-
 
488
 
-
 
489
  return $result;
-
 
490
}
-
 
491
// 
-
 
492
 
-
 
493
function genere_nom_wiki($nom, $spaces = FALSE)
-
 
494
{
-
 
495
	// traitement des accents
-
 
496
	$nom = str_replace(array('é','è','ë','ê','É','È','Ë','Ê','&','£'), 'e', $nom);
-
 
497
	$nom = str_replace(array('à','ä','â','Â','Ä','À','@'), 'a', $nom);
-
 
498
	$nom = str_replace(array('ç','Ç'), 'c', $nom);
-
 
499
	$nom = str_replace(array('ÿ','¾'), 'y', $nom);
-
 
500
	$nom = str_replace(array('ô','ö','ò','Ô','Ò','Ö'), 'o', $nom);
-
 
501
	$nom = str_replace(array('ï','î','ì','Î','Ï','Ì'), 'i', $nom);
-
 
502
	$nom = str_replace('$', 's', $nom);
-
 
503
    
-
 
504
	$temp = mb_str_split($nom);
-
 
505
	
-
 
506
	$count = 0;
-
 
507
	$final = NULL;
-
 
508
	foreach($temp as $letter)
-
 
509
	{
-
 
510
		if(preg_match('/([[:space:]]|[[:punct:]])/', $letter))
-
 
511
		{
-
 
512
			$final .= ($spaces ? '_' : '');
-
 
513
		} elseif(preg_match ('/[a-zA-Z0-9]/', $letter)) {
-
 
514
            $final .= (($count == 0 || $count == (strlen($nom) - 1)) ? strtoupper($letter) : strtolower($letter));
-
 
515
        }
-
 
516
        $count++;
-
 
517
	}
-
 
518
	
-
 
519
	// vérifions que le retour n'est pas uniquement un underscore
-
 
520
	if(preg_match('/^[[:punct:]]+$/', $final)) return FALSE;
-
 
521
 
-
 
522
 	// sinon retour du nom formaté
-
 
523
	return($final);
-
 
524
}
-
 
525
 
Line 478... Line 526...
478
 
526
 
479
 
527
 
480
/** RSSversHTML () transforme un flux RSS (en XML) en page HTML
528
/** RSSversHTML () transforme un flux RSS (en XML) en page HTML
481
*
529
*
Line 1128... Line 1176...
1128
}
1176
}
Line 1129... Line 1177...
1129
 
1177
 
1130
/* +--Fin du code ----------------------------------------------------------------------------------------+
1178
/* +--Fin du code ----------------------------------------------------------------------------------------+
1131
*
1179
*
-
 
1180
* $Log: not supported by cvs2svn $
-
 
1181
* Revision 1.76  2007/04/04 15:09:59  florian
-
 
1182
* modif class fichiers
1132
* $Log: not supported by cvs2svn $
1183
*
1133
* Revision 1.75  2007/04/04 08:51:01  florian
1184
* Revision 1.75  2007/04/04 08:51:01  florian
1134
* gestion des classes spécifiques pour habiller par CSS les fiches bazar
1185
* gestion des classes spécifiques pour habiller par CSS les fiches bazar
1135
*
1186
*
1136
* Revision 1.74  2007/03/28 15:54:32  florian
1187
* Revision 1.74  2007/03/28 15:54:32  florian