1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-17 20:01:47 +02:00

IN PROGRESS - task EONE-10: System thumbnails

- media manager now uses thumb.php
- form handler uses thumb.php (UI) when type is image and parameter thumb is passed 
- minor issues fixed
- thumbUrl() method added (Parser, for now)
This commit is contained in:
secretr
2010-03-09 16:05:41 +00:00
parent b1b33d1870
commit 2a0529f631
7 changed files with 367 additions and 296 deletions

View File

@@ -1612,6 +1612,28 @@ class e_parse
return $text;
}
public function thumbUrl($url, $options = array(), $raw = false, $full = false)
{
if(!is_array($options))
{
parse_str($options, $options);
}
if($raw) $url = $this->createConstants($url, 'mix');
$thurl = ($full ? SITEURL : e_HTTP).'thumb.php?src='.$url.'&';
if(vartrue($options['aw']))
{
$thurl .= 'aw='.intval($options['aw']).'&ah='.(vartrue($options['ah']) ? intval($options['ah']) : intval($options['aw']));
}
else
{
if(!vartrue($options['w'])) $options['w'] = 100;
$thurl .= 'aw='.intval($options['w']).'&ah='.(vartrue($options['h']) ? intval($options['h']) : intval($options['w']));
}
return $thurl;
}
/**
* Replace e107 path constants
@@ -1687,7 +1709,6 @@ class e_parse
"{e_THEME}",
//,"{e_DOWNLOAD}"
"{e_HANDLER}",
//FIXME need another name
"{e_MEDIA}"
);