Changeset 47966 in spip-zone for _galaxie_/plugins-spip-net/svp2010/mes_fonctions.php
- Timestamp:
- May 20, 2011, 7:55:02 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
_galaxie_/plugins-spip-net/svp2010/mes_fonctions.php
r47959 r47966 61 61 62 62 function image_petit_titre_article ($titre, $couleur) { 63 include_spip("inc/filtres_images"); 63 64 64 65 $titre = mb_strtoupper($titre); … … 86 87 } 87 88 88 89 90 91 function plugin_extraire ($xml, $string) {92 93 if (ereg("<$string>(.*)</$string>", $xml, $regs)) {94 return $regs[1];95 }96 }97 98 99 function creer_petition ($id_article) {100 $query = sql_query("SELECT id_article FROM spip_petitions WHERE id_article=$id_article");101 if ($row = sql_fetch($query)) return ;102 else {103 sql_insertq("spip_petitions", array('id_article' => $id_article, 'email_unique'=>'non', 'site_obli'=>'oui', 'site_unique' => 'oui', 'message'=>'non'));104 105 }106 }107 108 function my_extraire_lien ($texte) {109 110 if (preg_match("/a href="(.*)"/U", $texte, $regs)) {111 return $regs[1];112 } else if (preg_match("/a href=[\"\'](.*)[\"\']/U", $texte, $regs)) {113 return $regs[1];114 } else {115 return $texte;116 }117 }118 119 120 function afficher_liste_pipelines ($texte) {121 $texte = ereg_replace("(\r|\n\t)", "", $texte);122 preg_match_all("/<pipeline>.*<nom>(.*)<\/nom>.*<\/pipeline>/mUi", $texte, $regs);123 if (count($regs[1]) > 1) sort($regs[1]);124 foreach($regs[1] as $entree) {125 $ret .= "<li>$entree</li>";126 }127 if ($ret) $ret = "<div class='liste_pipelines'><strong>Pipelines</strong><ul>$ret</ul></div>";128 129 return $ret;130 131 }132 133 134 function stocker_signature($id, $pr) {135 global $st_signatures;136 137 $pr = round($pr);138 139 $st_signatures["$pr"][] = $id;140 141 /*142 echo "<hr>";143 echo "<pre>";144 print_r ($st_signatures);145 146 echo "</pre>";147 */148 149 }150 151 function liste_signatures ($rien = "") {152 global $st_signatures;153 154 for ($pr = 10; $pr >= 0; $pr--) {155 if (isset($st_signatures["$pr"])) {156 $ret [] = $st_signatures["$pr"];157 }158 }159 160 return $ret;161 }162 163 164 function calculer_animate ($num) {165 return ($num-1)*(-440);166 }167 168 89 ?>
Note: See TracChangeset
for help on using the changeset viewer.