[Agora-commits] agora mes_fonctions_agora.php3,1.10,1.11

maciek at adullact1.hosting.cri74.org maciek at adullact1.hosting.cri74.org
Jeu 1 Sep 12:52:40 CEST 2005


Update of /cvsroot/agora/agora
In directory adullact1:/tmp/cvs-serv12958

Modified Files:
	mes_fonctions_agora.php3 
Log Message:
This function should perhaps be moved out of here? 


Patches by Lukasz Zachulski. We're still waiting for his CVS access, by the way.

Index: mes_fonctions_agora.php3
===================================================================
RCS file: /cvsroot/agora/agora/mes_fonctions_agora.php3,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- mes_fonctions_agora.php3	4 Aug 2004 12:19:06 -0000	1.10
+++ mes_fonctions_agora.php3	1 Sep 2005 10:52:38 -0000	1.11
@@ -7,6 +7,8 @@
 	$GLOBALS['dossier_squelettes'] = ($GLOBALS['dossier_squelettes'] ? $GLOBALS['dossier_squelettes'].'/' : '');
 }
 
+$GLOBALS['dossier_squelettes']='spipagora/';
+
 // Filtre SMILEYS - 23 janvier 2003
 // pour toute suggestion, remarque, proposition d'ajout d'un
 // smileys, etc ; reprotez vous au forum de l'article :
@@ -836,4 +838,32 @@
         return $texte;
 }
 
-?>
\ No newline at end of file
+/**
+ * Break word after size letters.
+ * Simple version which works:)
+ *
+ * todo: zero inline when space occurs.
+ */
+
+function htmlwrap($str, $width, $break=' '){
+
+    return preg_replace_callback("/(<[^>]*>)?([^(<.*>)\s\n\r]*)(<\/[^>]*>)?/",
+        create_function('$matches, $width='.$width,
+               'static $inline;
+
+           $inline+=strlen($matches[2]);
+        
+           if($inline>$width){
+                $inline=(integer)fmod($inline,$width);
+                if(strlen($matches[2])>=$width){
+                    $matches[2]=\' \'.wordwrap($matches[2],$width,\' \',true);
+                }else{
+                     $matches[2]=\' \'.$matches[2];
+                }
+                }
+                
+           return $matches[1].$matches[2].$matches[3];'),
+            $str);
+}
+
+?>




Plus d'informations sur la liste de diffusion Agora-commits