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

Extra bootstrap styles added to default mail template. Precautions for legacy sitebutton resize. PM notify template clean up.

This commit is contained in:
Cameron
2016-04-22 16:10:18 -07:00
parent 0b78deb22a
commit 3c0f501e43
8 changed files with 74 additions and 25 deletions

View File

@@ -269,7 +269,7 @@ class banlist_ui extends e_admin_ui
public function timesPage() protected function timesPage()
{ {
if (!getperms('0')) if (!getperms('0'))
{ {
@@ -349,12 +349,12 @@ class banlist_ui extends e_admin_ui
} }
public function optionsPage() protected function optionsPage()
{ {
//FIXME Put Options code in here. //FIXME Put Options code in here.
} }
public function banlogPage() protected function banlogPage()
{ {
//FIXME Put LogPage code in here. //FIXME Put LogPage code in here.
} }

View File

@@ -204,7 +204,7 @@ class eurl_admin_ui extends e_admin_controller_ui
} }
//TODO Checkbox for each plugin to enable/disable //TODO Checkbox for each plugin to enable/disable
public function simplePage() protected function simplePage()
{ {
// $this->addTitle("Simple Redirects"); // $this->addTitle("Simple Redirects");
$eUrl =e107::getAddonConfig('e_url'); $eUrl =e107::getAddonConfig('e_url');
@@ -320,7 +320,7 @@ class eurl_admin_ui extends e_admin_controller_ui
} }
} }
public function SettingsPage() protected function SettingsPage()
{ {
//$this->addTitle(LAN_EURL_NAME_SETTINGS); //$this->addTitle(LAN_EURL_NAME_SETTINGS);
return $this->getUI()->urlSettings(); return $this->getUI()->urlSettings();
@@ -356,7 +356,7 @@ class eurl_admin_ui extends e_admin_controller_ui
} }
} }
public function AliasPage() protected function AliasPage()
{ {
// $this->addTitle(LAN_EURL_NAME_ALIASES); // $this->addTitle(LAN_EURL_NAME_ALIASES);
@@ -411,7 +411,7 @@ class eurl_admin_ui extends e_admin_controller_ui
} }
} }
public function ConfigPage() protected function ConfigPage()
{ {
// $this->addTitle(LAN_EURL_NAME_CONFIG); // $this->addTitle(LAN_EURL_NAME_CONFIG);
$active = e107::getPref('url_config'); $active = e107::getPref('url_config');

View File

@@ -112,6 +112,8 @@ $EMAIL_TEMPLATE['default']['header'] = "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHT
.sitebutton img { max-height: 100px; border-radius:4px; margin-right:5px } .sitebutton img { max-height: 100px; border-radius:4px; margin-right:5px }
h4.sitename { font-size: 20px; margin-bottom:5px; margin-top:0; text-decoration:none } h4.sitename { font-size: 20px; margin-bottom:5px; margin-top:0; text-decoration:none }
h4.sitename a { text-decoration:none } h4.sitename a { text-decoration:none }
.text-right { text-align: right }
.text-center { text-align: center }
a.siteurl { font-size: 14px } a.siteurl { font-size: 14px }
a { color: #428BCA } a { color: #428BCA }
@@ -133,7 +135,39 @@ $EMAIL_TEMPLATE['default']['header'] = "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHT
vertical-align: top; vertical-align: top;
border-top: 1px solid #DDD; border-top: 1px solid #DDD;
} }
.alert { padding: 15px; margin-bottom: 20px; border: 1px solid transparent; border-radius: 4px; }
.alert-info { color: #31708f; background-color: #d9edf7; border-color: #bce8f1; }
.alert-warning { color: #8a6d3b; background-color: #fcf8e3; border-color: #faebcc; }
.alert-danger { color: #a94442; background-color: #f2dede; border-color: #ebccd1; }
.alert-success { color: #3c763d; background-color: #dff0d8; border-color: #d6e9c6; }
a.btn { text-decoration: none; }
.btn {
display: inline-block;
padding: 6px 12px;
margin-bottom: 0;
font-size: 14px;
font-weight: 400;
line-height: 1.42857143;
text-align: center;
white-space: nowrap;
vertical-align: middle;
-ms-touch-action: manipulation;
touch-action: manipulation;
cursor: pointer;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
background-image: none;
border: 1px solid transparent;
border-radius: 4px;
}
.btn-primary { color: #fff; background-color: #337ab7; border-color: #2e6da4; }
.btn-success { color: #fff; background-color: #5cb85c; border-color: #4cae4c; }
.btn-warning { color: #fff; background-color: #f0ad4e; border-color: #eea236; }
.btn-danger { color: #fff; background-color: #d9534f; border-color: #d43f3a; }
.btn-lg { padding: 10px 16px; font-size: 18px; line-height: 1.3333333; border-radius: 6px; }
.btn-sm { padding: 5px 10px; font-size: 12px; line-height: 1.5; border-radius: 3px; }
</style> </style>
</head> </head>
@@ -146,7 +180,7 @@ $EMAIL_TEMPLATE['default']['body'] = "{BODY}<br />{MEDIA1}{MEDIA2}{MEDIA3}{MED
$EMAIL_TEMPLATE['default']['footer'] = "<br /><br /><table cellspacing='4'> $EMAIL_TEMPLATE['default']['footer'] = "<br /><br /><table cellspacing='4'>
<tr><td>{SITEBUTTON: type=email&h=60}</td> <tr><td>{SITEBUTTON: type=email&h=60}</td>
<td><h4 class='sitename'>{SITENAME=link}</h4> <td><h4 class='sitename'>{SITENAME=link}</h4>
{SITEURL}</td></tr> <small>{SITEURL}</small></td></tr>
</table> </table>
</div> </div>
</body> </body>

View File

@@ -566,7 +566,7 @@ class e107Email extends PHPMailer
} }
$message = str_replace("\t", "", $message); // filter out tabs from templates; $message = str_replace("\t", "", $message); // filter out tabs from templates;
if ($want_HTML !== FALSE) if ($want_HTML !== FALSE)
{ {
// $message = e107::getParser()->toHtml("[html]".$message."[/html]",true); // using toHtml will break media attachment links. (need to retain {e_XXXX ) // $message = e107::getParser()->toHtml("[html]".$message."[/html]",true); // using toHtml will break media attachment links. (need to retain {e_XXXX )
@@ -598,7 +598,7 @@ class e107Email extends PHPMailer
$message = str_replace("\n", "<br />\n", $message); $message = str_replace("\n", "<br />\n", $message);
} }
$this->MsgHTML($message); // Theoretically this should do everything, including handling of inline images. $this->MsgHTML($message); // Theoretically this should do everything, including handling of inline images.
} }
@@ -863,11 +863,11 @@ class e107Email extends PHPMailer
$identifier = deftrue('MAIL_IDENTIFIER', 'X-e107-id'); $identifier = deftrue('MAIL_IDENTIFIER', 'X-e107-id');
if (isset($eml['SMTPDebug'])) { $this->SMTPDebug = $eml['SMTPDebug']; } // 'FALSE' is a valid value! if (isset($eml['SMTPDebug'])) { $this->SMTPDebug = $eml['SMTPDebug']; } // 'FALSE' is a valid value!
if (!empty($eml['sender_email'])) { $this->From = $eml['sender_email']; } if (!empty($eml['sender_email'])) { $this->From = $eml['sender_email']; }
if (!empty($eml['sender_name'])) { $this->FromName = $eml['sender_name']; } if (!empty($eml['sender_name'])) { $this->FromName = $eml['sender_name']; }
if (!empty($eml['replyto'])) { $this->AddAddressList('replyto',$eml['replyto'],vartrue($eml['replytonames'],'')); } if (!empty($eml['replyto'])) { $this->AddAddressList('replyto',$eml['replyto'],vartrue($eml['replytonames'],'')); }
if (isset($eml['html'])) { $this->allow_html = $eml['html']; } // 'FALSE' is a valid value! if (isset($eml['html'])) { $this->allow_html = $eml['html']; } // 'FALSE' is a valid value!
if (isset($eml['html_header'])) { $this->add_HTML_header = $eml['html_header']; } // 'FALSE' is a valid value! if (isset($eml['html_header'])) { $this->add_HTML_header = $eml['html_header']; } // 'FALSE' is a valid value!
if (!empty($eml['body'])) { $this->makeBody($eml['body'], $this->allow_html, $this->add_HTML_header); } if (!empty($eml['body'])) { $this->makeBody($eml['body'], $this->allow_html, $this->add_HTML_header); }
@@ -882,7 +882,7 @@ class e107Email extends PHPMailer
if (!empty($eml['split'])) { $this->SingleTo = ($eml['split'] != FALSE); } if (!empty($eml['split'])) { $this->SingleTo = ($eml['split'] != FALSE); }
if (!empty($eml['smtp_username'])) { $this->Username = $eml['smtp_username']; } if (!empty($eml['smtp_username'])) { $this->Username = $eml['smtp_username']; }
if (!empty($eml['smtp_password'])) { $this->Password = $eml['smtp_password']; } if (!empty($eml['smtp_password'])) { $this->Password = $eml['smtp_password']; }
if (!empty($eml['bouncepath'])) if (!empty($eml['bouncepath']))
{ {
$this->Sender = $eml['bouncepath']; // Bounce path $this->Sender = $eml['bouncepath']; // Bounce path
@@ -968,12 +968,12 @@ class e107Email extends PHPMailer
public function sendEmail($send_to, $to_name, $eml = array(), $bulkmail = false) public function sendEmail($send_to, $to_name, $eml = array(), $bulkmail = false)
{ {
if (count($eml)) if (count($eml))
{ {
if($error = $this->arraySet($eml)) // Set parameters from list if($error = $this->arraySet($eml)) // Set parameters from list
{ {
return $error; return $error;
} }
} }
if (($bulkmail == true) && $this->localUseVerp && $this->save_bouncepath && (strpos($this->save_bouncepath,'@') !== false)) if (($bulkmail == true) && $this->localUseVerp && $this->save_bouncepath && (strpos($this->save_bouncepath,'@') !== false))
@@ -1002,7 +1002,7 @@ class e107Email extends PHPMailer
$_SERVER['REMOTE_ADDR'] = $_SERVER['SERVER_ADDR']; $_SERVER['REMOTE_ADDR'] = $_SERVER['SERVER_ADDR'];
$_SERVER["HTTP_X_FORWARDED_FOR"] = $_SERVER['SERVER_ADDR']; $_SERVER["HTTP_X_FORWARDED_FOR"] = $_SERVER['SERVER_ADDR'];
$_SERVER["HTTP_CF_CONNECTING_IP"] = $_SERVER['SERVER_ADDR']; $_SERVER["HTTP_CF_CONNECTING_IP"] = $_SERVER['SERVER_ADDR'];
$result = $this->Send(); // Actually send email $result = $this->Send(); // Actually send email
@@ -1122,10 +1122,18 @@ class e107Email extends PHPMailer
$url = $tp->replaceConstants($url); $url = $tp->replaceConstants($url);
// resize on the fly. // resize on the fly.
if($this->debug)
{
echo "<br />Attempting Resize...".$url;
}
if($resized = e107::getMedia()->resizeImage($url, e_TEMP.basename($url),'w=800')) if($resized = e107::getMedia()->resizeImage($url, e_TEMP.basename($url),'w=800'))
{ {
$url = $resized; $url = $resized;
} }
elseif($this->debug)
{
echo "<br />Couldn't resize ".$url;
}
$delim = $images[2][$i]; // Will be single or double quote $delim = $images[2][$i]; // Will be single or double quote
$filename = basename($url); $filename = basename($url);
@@ -1139,7 +1147,7 @@ class e107Email extends PHPMailer
if ($this->debug) if ($this->debug)
{ {
echo "<br />CID file {$filename} in {$directory}. Base = ".SERVERBASE."< BaseDir = {$basedir}<br />"; echo "<br />CID file {$filename} in {$directory}. Base = ".SERVERBASE."<br />BaseDir = {$basedir}<br />";
} }
$cid = 'cid:' . md5($filename); $cid = 'cid:' . md5($filename);

View File

@@ -1472,6 +1472,11 @@ class e_media
$src = $tp->replaceConstants($src); $src = $tp->replaceConstants($src);
$dest = $tp->replaceConstants($dest); $dest = $tp->replaceConstants($dest);
if(!file_exists($src))
{
return false;
}
$maxWidth = varset($opts['w'], 800); $maxWidth = varset($opts['w'], 800);
$maxHeight = varset($opts['h'], 800); $maxHeight = varset($opts['h'], 800);

View File

@@ -86,4 +86,6 @@ define("LAN_PM_108", "Message sent on: ");
define("LAN_PM_109", "New Message(s)"); define("LAN_PM_109", "New Message(s)");
define("LAN_PM_111", "Read"); define("LAN_PM_111", "Read");
define("LAN_PM_112", "User(s)"); define("LAN_PM_112", "User(s)");
define("LAN_PM_113", "Read Message");
?> ?>

View File

@@ -407,7 +407,8 @@ class private_message
$data['PM_DATE'] = e107::getParser()->toDate($pmInfo['pm_sent'], 'long'); $data['PM_DATE'] = e107::getParser()->toDate($pmInfo['pm_sent'], 'long');
$data['SITENAME'] = SITENAME; $data['SITENAME'] = SITENAME;
$data['USERNAME'] = USERNAME; $data['USERNAME'] = USERNAME;
$data['PM_URL'] = "<a href='".$url."'>".$url."</a>";// e107::url('pm','index', null, array('mode'=>'full')).'?show.'.$pmid; $data['PM_URL'] = $url;// e107::url('pm','index', null, array('mode'=>'full')).'?show.'.$pmid;
$data['PM_BUTTON'] = "<a class='btn btn-primary' href='".$url."'>".LAN_PM_113."</a>";// e107::url('pm','index', null, array('mode'=>'full')).'?show.'.$pmid;
$text = e107::getParser()->simpleParse($template, $data); $text = e107::getParser()->simpleParse($template, $data);

View File

@@ -276,10 +276,9 @@ $PM_NOTIFY =
<tr><td>".LAN_PM_103."</td><td>{PM_SUBJECT}</td></tr> <tr><td>".LAN_PM_103."</td><td>{PM_SUBJECT}</td></tr>
<tr><td>".LAN_PM_108."</td><td>{PM_DATE}</td></tr> <tr><td>".LAN_PM_108."</td><td>{PM_DATE}</td></tr>
<tr><td>".LAN_PM_104."</td><td>{PM_ATTACHMENTS}</td></tr> <tr><td>".LAN_PM_104."</td><td>{PM_ATTACHMENTS}</td></tr>
</table>
</table><br /> <table class='table'><tr><td class='text-center'><br />
<div>".LAN_PM_105.": {PM_URL}</div> <a class='btn btn-primary btn-lg' href='{PM_URL}'>".LAN_PM_113."</a></td></tr>
</div> </table>
"; ";
?>