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

Fixes #795 Sitebutton path error in emails. Use {SITEBUTTON=email} if you have a custom email template.

This commit is contained in:
Cameron
2014-10-24 13:10:20 -07:00
parent 96926fe0ad
commit 4b78946f60
2 changed files with 23 additions and 7 deletions

View File

@@ -8,11 +8,27 @@ if (!defined('e107_INIT')) { exit; }
class siteinfo_shortcodes // must match the folder name of the plugin.
{
function sc_sitebutton()
function sc_sitebutton($parm='')
{
$path = ($_POST['sitebutton'] && $_POST['ajax_used']) ? e107::getParser()->replaceConstants($_POST['sitebutton']) : (strstr(SITEBUTTON, 'http:') ? SITEBUTTON : e_IMAGE.SITEBUTTON);
if($_POST['sitebutton'] && $_POST['ajax_used'])
{
$path = e107::getParser()->replaceConstants($_POST['sitebutton']);
}
else
{
$path = (strstr(SITEBUTTON, 'http:') ? SITEBUTTON : e_IMAGE.SITEBUTTON);
}
if($parm == 'email')
{
$path = e107::getConfig()->get('sitebutton');
}
//TODO use CSS class?
return '<a href="'.SITEURL.'"><img src="'.$path.'" alt="'.SITENAME.'" /></a>';
if(!empty($path))
{
return '<a href="'.SITEURL.'"><img src="'.$path.'" alt="'.SITENAME.'" /></a>';
}
}
function sc_sitedisclaimer()