| version 1.2, 2005/08/13 23:06:13 |
version 1.3, 2005/10/31 05:42:51 |
|
|
| * http://platon.sk/projects/Metafox/ |
* http://platon.sk/projects/Metafox/ |
| */ |
*/ |
| |
|
| /* $Platon: Metafox/functions.inc.php,v 1.1 2005/06/05 12:13:15 nepto Exp $ */ |
/* $Platon: Metafox/functions.inc.php,v 1.2 2005/08/13 23:06:13 nepto Exp $ */ |
| |
|
| /* |
/* |
| * Line wrap function |
* Line wrap function |
| Line 519 function ezin_article_counts_process(&$a |
|
| Line 519 function ezin_article_counts_process(&$a |
|
| } /* }}} */ |
} /* }}} */ |
| |
|
| /* |
/* |
| |
* Upload directory manipulation functions |
| |
*/ |
| |
function ezin_lookup_upload_file($file) /* {{{ */ |
| |
{ |
| |
global $ezin_cfg; |
| |
$real_file = Platon::append_slash($ezin_cfg['upload']['dir']).$file; |
| |
if (file_exists($real_file)) { |
| |
return Platon::append_slash($ezin_cfg['upload']['url']).$file; |
| |
} |
| |
return false; |
| |
} /* }}} */ |
| |
|
| |
function ezin_lookup_upload_image($dir, $file_wo_ext = '') /* {{{ */ |
| |
{ |
| |
if (strlen($file_wo_ext) <= 0) { |
| |
// just filename was passed |
| |
return ezin_lookup_upload_file($dir); |
| |
} |
| |
$dir = Platon::append_slash($dir); |
| |
static $extensions = array('', 'png', 'gif', 'jpg', 'PNG', 'GIF', 'JPG'); |
| |
foreach ($extensions as $ext) { |
| |
$file = $dir.$file_wo_ext; |
| |
strlen($ext) > 0 && $file .= ".$ext"; |
| |
$url = ezin_lookup_upload_file($file); |
| |
if (strlen($url) > 0) { |
| |
return $url; |
| |
} |
| |
} |
| |
return false; |
| |
} /* }}} */ |
| |
|
| |
function ezin_get_upload_image_html($dir, $file_wo_ext) /* {{{ */ |
| |
{ |
| |
$url = ezin_lookup_upload_image($dir, $file_wo_ext); |
| |
if (strlen($url) > 0) { |
| |
return sprintf('<img src="%s" border="0">', $url); |
| |
} |
| |
return ''; |
| |
} /* }}} */ |
| |
|
| |
/* |
| * Message process function |
* Message process function |
| */ |
*/ |
| |
|