Skip to content
Browse files

* Fixed the single_line function. Note to self: single quotes don't l…

…et you use escape characters!

* Started converting all the dev scripts to python scripts. Saves me having to write them twice for *nix and windows.

Signed-off-by: Alex <xycaleth@gmail.com>
  • Loading branch information...
1 parent 76228d4 commit c282963a686715c6fc33de01df5df568584b9ff9 @xycaleth xycaleth committed Nov 1, 2011
Showing with 23 additions and 4 deletions.
  1. +17 −0 dev/rename-defaults.py
  2. +1 −1 functions.php
  3. +5 −3 index.php
View
17 dev/rename-defaults.py
@@ -0,0 +1,17 @@
+import os, os.path
+import fnmatch
+import shutil
+
+def renameDefaults ( dir ):
+ for file in os.listdir (dir):
+ if file[0] == ".":
+ continue
+
+ relpath = os.path.join (dir, file)
+ if os.path.isdir (relpath):
+ renameDefaults (relpath)
+ elif fnmatch.fnmatch (file, "*.default"):
+ shutil.copy (relpath, relpath[0:-8])
+ print "Copied %s as %s" % (relpath, relpath[0:-8])
+
+renameDefaults ("..")
View
2 functions.php
@@ -26,7 +26,7 @@
function single_line ( $str )
{
- return str_replace ('\n', '', $str);
+ return str_replace ("\n", '', $str);
}
/**
View
8 index.php
@@ -4469,13 +4469,15 @@ function form_dropdown($name, $list=array(), $default_val='', $js='') {
trigger_error ($ind298, E_USER_WARNING);
}
- $code_smillie = ( isset ($PVARS['code_smillie']) ) ? array_map ('single_line', $PVARS['code_smillie']) : array();
+ $code_smillie = ( isset ($PVARS['code_smillie']) ) ? $PVARS['code_smillie'] : array();
$del_smillie = ( isset ($PVARS['del_smillie']) ) ? $PVARS['del_smillie'] : array();
- $smiley_image = ( isset ($PVARS['smiley_image']) ) ? array_map ('single_line', $PVARS['smiley_image']) : array();
+ $smiley_image = ( isset ($PVARS['smiley_image']) ) ? $PVARS['smiley_image'] : array();
function is_empty ( $str ) { return empty ($str); }
- $code_smillie = array_map ('fn_trim', $code_smillie);
+ $code_smillie = array_map ('single_line',
+ array_map ('fn_trim', $code_smillie)
+ );
$blank_smileys = array_filter ($code_smillie, 'is_empty');
if ( count ($blank_smileys) > 0 )
{

0 comments on commit c282963

Please sign in to comment.
Something went wrong with that request. Please try again.