Got questions, comments, patches, etc.?
Contact Jason Woofenden
gitweb
/
wfpl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
277f043
)
added: format_h_w_image()
author
jason
<jason@lappy.(none)>
Wed, 13 Feb 2008 21:05:28 +0000
(16:05 -0500)
committer
jason
<jason@lappy.(none)>
Wed, 13 Feb 2008 21:05:28 +0000
(16:05 -0500)
format.php
patch
|
blob
|
history
diff --git
a/format.php
b/format.php
index
99a67b7
..
d058631
100644
(file)
--- a/
format.php
+++ b/
format.php
@@
-87,6
+87,20
@@
function format_filename($str) {
return ereg_replace('^[.-]', '_', $str);
}
return ereg_replace('^[.-]', '_', $str);
}
+function format_h_w_image($str) {
+ $fields = explode(' ', $str);
+ if(count($fields) != 3) {
+ return '';
+ }
+
+ list($width, $height, $filename) = $fields;
+ $width = format_int_0($width);
+ $height = format_int_0($height);
+ $filename = format_filename($filename);
+
+ return "$width $height $filename";
+}
+
function format_varname($str) {
$str = strtolower($str);
$str = ereg_replace('[^a-z0-9_]', '_', $str);
function format_varname($str) {
$str = strtolower($str);
$str = ereg_replace('[^a-z0-9_]', '_', $str);