1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-26 15:54:43 +02:00

New resizeImage() method added to MediaManager class. Inline images now resized on-the-fly prior to emailing. Sitebutton auto-resized prior to emailing.

This commit is contained in:
Cameron
2015-05-13 13:34:52 -07:00
parent 2f78304ab2
commit fba9816acd
4 changed files with 101 additions and 18 deletions

View File

@@ -8,7 +8,7 @@ if (!defined('e107_INIT')) { exit; }
class siteinfo_shortcodes // must match the folder name of the plugin.
{
function sc_sitebutton($parm='')
function sc_sitebutton($parm=null)
{
if($_POST['sitebutton'] && $_POST['ajax_used'])
@@ -19,10 +19,18 @@ class siteinfo_shortcodes // must match the folder name of the plugin.
{
$path = (strstr(SITEBUTTON, 'http:') ? SITEBUTTON : e_IMAGE.SITEBUTTON);
}
if($parm == 'email')
if($parm['type'] == 'email' || $parm == 'email') // (retain {} constants )
{
$h = !empty($parm['h']) ? $parm['h'] : 100;
$path = e107::getConfig()->get('sitebutton');
$realPath = e107::getParser()->replaceConstants($path);
if($resized = e107::getMedia()->resizeImage($path, e_MEDIA."temp/".basename($realPath),'h='.$h))
{
$path = e107::getParser()->createConstants($resized);
}
}
if(!empty($path))