1
0
mirror of https://github.com/e107inc/e107.git synced 2025-04-21 13:11:52 +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

@ -172,8 +172,8 @@ $EMAIL_TEMPLATE['default']['header'] = "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHT
<style type='text/css'>
body { padding:10px; background-color: #E1E1E1 }
div#body { padding:10px; width: 800px; background-color: #FFFFFF; border-radius: 5px; font-family: helvetica,arial }
.video-thumbnail { max-width: 100% }
.video-thumbnail { max-width: 400px }
.media img { max-width:600px }
</style>
</head>
@ -181,7 +181,7 @@ $EMAIL_TEMPLATE['default']['header'] = "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHT
<div id='body'>
";
$EMAIL_TEMPLATE['default']['body'] = "{BODY}";
$EMAIL_TEMPLATE['default']['body'] = "{BODY}<br />{MEDIA1}{MEDIA2}{MEDIA3}{MEDIA4}{MEDIA5}";
$EMAIL_TEMPLATE['default']['footer'] = "<br /><br />
{SITENAME=link}
@ -226,7 +226,7 @@ $EMAIL_TEMPLATE['signup']['body'] = "
{SITENAME=link}<br />
{SITEURL}
<br /><br />".($includeSiteButton ? "<a href='".SITEURL."' title=''>{SITEBUTTON}</a>" : '')."
<br /><br />{SITEBUTTON=email}
</div>
";

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()