function pb_charts_traiter_charts ($texte) { global $id_article; if (!$id_article) #return "on est pas dans un article"; return $texte; // Echec silencieux //print $id_article; //si l'article possède le mot clef définit dans cfg, alors on met la pb_charte dessus if (function_exists(lire_config)) { $arracfgmot_chart=lire_config("pbcharts/mot_pbcharts",' '); $id_mot=$arracfgmot_chart[0]; //print $id_mot; //s'affiche 2 fois?? if ($id_mot!=' '){ //on cherche si le mot est attache a l'article $s = spip_query("SELECT id_mot FROM spip_mots_articles WHERE id_mot=$id_mot AND id_article=$id_article"); $row = spip_fetch_array($s); if (!$row) //l'article n'est pas lie. #return "il n'y a pas le mot clef attache a cet article"; return $texte; // Echec silencieux else{ #return "le mot est attache on demarre la charte"; return pb_charts_original($texte); }; } }else{ #return "pas de cfg, on laisse rouler comme avant"; return pb_charts_original($texte); } #return "la sortie est par là"; return pb_charts_original($texte); }