Changeset 1305
- Timestamp:
- 03/13/10 11:22:58 (3 years ago)
- Location:
- trunk
- Files:
-
- 23 edited
-
. (modified) (1 prop)
-
Hotaru.php (modified) (2 diffs)
-
content/admin_language.php (modified) (1 diff)
-
content/admin_themes/admin_default/css/style.css (modified) (1 diff)
-
content/plugins (modified) (1 prop)
-
content/plugins/admin_email/admin_email.php (modified) (2 diffs)
-
content/plugins/comments/comments.php (modified) (3 diffs)
-
content/plugins/comments/readme.txt (modified) (1 diff)
-
content/plugins/rss_show/readme.txt (modified) (1 diff)
-
content/plugins/rss_show/rss_show.php (modified) (4 diffs)
-
content/plugins/sb_base/libs/SbBaseFunctions.php (modified) (7 diffs)
-
content/plugins/user_rankings/user_rankings.php (modified) (1 diff)
-
content/plugins/users/libs/UserFunctions.php (modified) (1 diff)
-
content/plugins/vote/vote.php (modified) (1 diff)
-
content/themes/default/css/style.css (modified) (1 diff)
-
hotaru_settings_default.php (modified) (1 diff)
-
install/install_tables.php (modified) (1 diff)
-
install/upgrade.php (modified) (1 diff)
-
libs/AdminPages.php (modified) (2 diffs)
-
libs/EmailFunctions.php (modified) (3 diffs)
-
libs/Feeds.php (modified) (2 diffs)
-
libs/InspektExtras.php (modified) (1 diff)
-
libs/extensions/ezSQL/mysql/ez_sql_mysql.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/1.2 merged: 1293-1303
- Property svn:mergeinfo changed
-
trunk/Hotaru.php
r1304 r1305 43 43 protected $includes; // for CSS/JavaScript includes 44 44 protected $debug; // Debug object 45 protected $email; // Email object 45 46 46 47 // page info … … 2063 2064 public function email($to = '', $subject = '', $body = '', $headers = '', $type = 'email') 2064 2065 { 2065 require_once(LIBS . 'EmailFunctions.php'); 2066 $emailFunctions = new EmailFunctions($to, $subject, $body, $headers, $type); 2067 $emailFunctions->type = $type; 2068 return $emailFunctions->doEmail(); 2066 if (!is_object($this->email)) { 2067 require_once(LIBS . 'EmailFunctions.php'); 2068 $this->email = new EmailFunctions(); 2069 } 2070 2071 $this->email->to = $to; 2072 $this->email->subject = $subject; 2073 $this->email->body = $body; 2074 $this->email->headers = $headers; 2075 $this->email->type = $type; 2076 2077 return $this->email->doEmail(); 2069 2078 } 2070 2079 } -
trunk/content/admin_language.php
r1108 r1305 120 120 121 121 /* Settings */ 122 $lang['admin_settings_update_success'] = "Updated successfully."; 122 $lang['admin_settings_update_success'] = "Updated successfully"; 123 $lang['admin_settings_update_failure'] = "Error saving settings"; 123 124 $lang["admin_settings_theme_activate_success"] = "Theme was activated successfully."; 124 125 $lang["admin_theme_settings"] = "Settings"; -
trunk/content/admin_themes/admin_default/css/style.css
r1081 r1305 149 149 .green { 150 150 background-color: #99FF66 !important; 151 } 152 153 .yellow { 154 background-color: #fbe760 !important; 151 155 } 152 156 -
trunk/content/plugins
- Property svn:mergeinfo changed
/branches/1.2/content/plugins merged: 1293-1294,1296,1298-1302
- Property svn:mergeinfo changed
-
trunk/content/plugins/admin_email/admin_email.php
r1190 r1305 154 154 echo "<meta http-equiv='Refresh' content='0; URL=" . $url . "' />"; 155 155 echo $h->lang["admin_email_redirecting"]; 156 ob_flush();156 @ob_flush(); 157 157 flush(); 158 158 exit; … … 214 214 $from = SITE_EMAIL; // Send_From_Email is admin 215 215 $to = $recipient->user_email; 216 $headers = "From: " . $from . "\r\nReply-To: " . $from . "\r\nX-Priority: 3\r\n";217 216 218 217 if ($send_self && ($h->currentUser->id == $recipient->user_id)) { 219 218 echo $h->lang["admin_email_sent_to"] . "<i>" . $to . "</i><br />\n"; 220 @mail($to, $subject, $message, $headers); // This sends an email to the requesting admin219 $h->email($to, $subject, $message); // This sends an email to the requesting admin 221 220 } elseif ($simulation) { 222 221 echo $h->lang["admin_email_fake_sending"] . $to . "<br />\n"; 223 222 } else { 224 223 echo $h->lang["admin_email_sent_to"] . $to . "<br />\n"; 225 @mail($to, $subject, $message, $headers); // This does the actual sending!226 } 227 ob_flush();224 $h->email($to, $subject, $message); // This does the actual sending! 225 } 226 @ob_flush(); 228 227 flush(); 229 228 sleep(1); // one second pause between sending emails -
trunk/content/plugins/comments/comments.php
r1248 r1305 3 3 * name: Comments 4 4 * description: Enables logged-in users to comment on posts 5 * version: 1. 65 * version: 1.7 6 6 * folder: comments 7 7 * class: Comments … … 148 148 } 149 149 150 if ($h->pageName == 'comments') { 150 if ($h->pageName == 'comments') 151 { 152 // set current comment and responses to pending: 153 if ($h->cage->get->getAlpha('action') == 'setpending') { 154 155 // before setting pending, we need to be certain this user has permission: 156 if ($h->currentUser->loggedIn && $h->currentUser->getPermission('can_set_comments_pending') == 'yes') { 157 $cid = $h->cage->get->testInt('cid'); // comment id 158 $comment = $h->comment->getComment($h, $cid); 159 $h->comment->readComment($h, $comment); // read comment 160 $h->comment->status = 'pending'; // set to pending 161 $h->comment->editComment($h); // update this comment 162 163 $h->comment->postId = $h->cage->get->testInt('pid'); // post id 164 $h->comment->setPendingCommentTree($h,$cid); // set all responses to 'pending', too. 165 166 // redirect back to thread: 167 $h->post = new Post(); 168 $h->readPost($h->comment->postId); 169 header("Location: " . $h->url(array('page'=>$h->post->id))); // Go to the post 170 die(); 171 } 172 } 173 174 // delete current comment and responses: 175 if ($h->cage->get->getAlpha('action') == 'delete') { 176 177 // before deleting a comment, we need to be certain this user has permission: 178 if ($h->currentUser->loggedIn && $h->currentUser->getPermission('can_delete_comments') == 'yes') { 179 $cid = $h->cage->get->testInt('cid'); // comment id 180 $comment = $h->comment->getComment($h, $cid); 181 $h->comment->readComment($h, $comment); // read comment 182 183 $h->pluginHook('comments_delete_comment'); 184 185 $h->comment->deleteComment($h, $cid); // delete this comment 186 $h->comment->deleteCommentTree($h, $cid); // delete all responses, too. 187 188 $h->clearCache('html_cache', false); // clear HTML cache to refresh Comments and Activity widgets 189 190 $h->comment->postId = $h->cage->get->testInt('pid'); // post id 191 192 // redirect back to thread: 193 $h->readPost($h->comment->postId); 194 header("Location: " . $h->url(array('page'=>$h->comment->postId))); // Go to the post 195 die(); 196 } 197 } 198 199 // FOR THE COMMENTS PAGE: 151 200 $h->pageTitle = $h->lang['comments']; 152 201 if ($h->cage->get->keyExists('user')) { … … 257 306 258 307 } 259 260 // set current comment and responses to pending:261 if ($h->cage->get->getAlpha('action') == 'setpending') {262 263 // before setting pending, we need to be certain this user has permission:264 if ($h->currentUser->getPermission('can_set_comments_pending') == 'yes') {265 $cid = $h->cage->get->testInt('cid'); // comment id266 $comment = $h->comment->getComment($h, $cid);267 $h->comment->readComment($h, $comment); // read comment268 $h->comment->status = 'pending'; // set to pending269 $h->comment->editComment($h); // update this comment270 271 $h->comment->postId = $h->cage->get->testInt('pid'); // post id272 $h->comment->setPendingCommentTree($h,$cid); // set all responses to 'pending', too.273 274 // redirect back to thread:275 $h->post = new Post();276 $h->readPost($h->comment->postId);277 header("Location: " . $h->url(array('page'=>$h->post->id))); // Go to the post278 die();279 }280 }281 282 // delete current comment and responses:283 if ($h->cage->get->getAlpha('action') == 'delete') {284 285 // before deleting a comment, we need to be certain this user has permission:286 if ($h->currentUser->getPermission('can_delete_comments') == 'yes') {287 $cid = $h->cage->get->testInt('cid'); // comment id288 $comment = $h->comment->getComment($h, $cid);289 $h->comment->readComment($h, $comment); // read comment290 291 $h->pluginHook('comments_delete_comment');292 293 $h->comment->deleteComment($h, $cid); // delete this comment294 $h->comment->deleteCommentTree($h, $cid); // delete all responses, too.295 296 $h->clearCache('html_cache', false); // clear HTML cache to refresh Comments and Activity widgets297 298 $h->comment->postId = $h->cage->get->testInt('pid'); // post id299 300 // redirect back to thread:301 $h->readPost($h->comment->postId);302 header("Location: " . $h->url(array('page'=>$h->comment->postId))); // Go to the post303 die();304 }305 }306 307 308 } 308 309 -
trunk/content/plugins/comments/readme.txt
r1248 r1305 15 15 Changelog 16 16 --------- 17 v.1.7 2010/03/11 - Nick - Fix for a previous change that broke the set pending and delete links within comments. 17 18 v.1.6 2010/02/26 - Nick - Adds link to profile navigation; Email changed to go through Hotaru's "email" function 18 19 v.1.5 2010/02/23 - Nick - Shows messages for moderated comments: "Awaiting approval", "Exceeded Daily Limit", etc. -
trunk/content/plugins/rss_show/readme.txt
r1081 r1305 32 32 Changelog 33 33 --------- 34 v.0.8 2010/03/11 - Nick - Added some sanitation to feed output 34 35 v.0.7 2010/01/04 - Nick - Updates for compatibility with Hotaru 1.0 35 36 v.0.6 2009/11/04 - Nick - Updated install function for easier upgrading -
trunk/content/plugins/rss_show/rss_show.php
r1108 r1305 3 3 * name: RSS Show 4 4 * description: Adds links in a widget block to the latest posts from a specified RSS feed. 5 * version: 0. 75 * version: 0.8 6 6 * folder: rss_show 7 7 * class: RssShow … … 87 87 $output .= "<li class='rss_show_feed_item'>"; 88 88 $output .= "<span class='rss_show_title'>"; 89 $output .= "<a href='" . $item->get_permalink() . "'>" . $item->get_title() . "</a></span>\n";89 $output .= "<a href='" . $item->get_permalink() . "'>" . sanitize($item->get_title(), 'tags') . "</a></span>\n"; 90 90 91 91 // AUTHOR / DATE … … 95 95 $output .= " by "; 96 96 foreach ($item->get_authors() as $author) { 97 $output .= $author->get_name();97 $output .= sanitize($author->get_name(), 'ents'); 98 98 } 99 99 } … … 106 106 // SUMMARY 107 107 if ($settings['content'] == 'summaries') { 108 $output .= "<p class='rss_show_content'>" . substr(s trip_tags($item->get_content()), 0, 300);108 $output .= "<p class='rss_show_content'>" . substr(sanitize($item->get_content(), 'tags'), 0, 300); 109 109 $output .= "... "; 110 $output .= "<small><a href='" . $item->get_permalink() . "' title='" . $item->get_title() . "'>" . $h->lang["rss_show_read_more"] . "</a>";110 $output .= "<small><a href='" . $item->get_permalink() . "' title='" . sanitize($item->get_title(), 'tags') . "'>" . $h->lang["rss_show_read_more"] . "</a>"; 111 111 $output .= "</small></p>"; 112 112 } -
trunk/content/plugins/sb_base/libs/SbBaseFunctions.php
r1234 r1305 129 129 $end = date('YmdHis', strtotime($upcoming_duration)); // should be negative 130 130 $h->vars['filter']['(post_date >= %s AND post_date <= %s)'] = array($end, $start); 131 $h->vars['orderby'] = "post_votes_up DESC ";131 $h->vars['orderby'] = "post_votes_up DESC, post_date DESC"; 132 132 } 133 133 elseif ($type == 'top-24-hours') … … 138 138 $end = date('YmdHis', strtotime("-1 day")); 139 139 $h->vars['filter']['(post_date >= %s AND post_date <= %s)'] = array($end, $start); 140 $h->vars['orderby'] = "post_votes_up DESC ";140 $h->vars['orderby'] = "post_votes_up DESC, post_date DESC"; 141 141 } 142 142 elseif ($type == 'top-48-hours') … … 147 147 $end = date('YmdHis', strtotime("-2 days")); 148 148 $h->vars['filter']['(post_date >= %s AND post_date <= %s)'] = array($end, $start); 149 $h->vars['orderby'] = "post_votes_up DESC ";149 $h->vars['orderby'] = "post_votes_up DESC, post_date DESC"; 150 150 } 151 151 elseif ($type == 'top-7-days') … … 156 156 $end = date('YmdHis', strtotime("-7 days")); 157 157 $h->vars['filter']['(post_date >= %s AND post_date <= %s)'] = array($end, $start); 158 $h->vars['orderby'] = "post_votes_up DESC ";158 $h->vars['orderby'] = "post_votes_up DESC, post_date DESC"; 159 159 } 160 160 elseif ($type == 'top-30-days') … … 165 165 $end = date('YmdHis', strtotime("-30 days")); 166 166 $h->vars['filter']['(post_date >= %s AND post_date <= %s)'] = array($end, $start); 167 $h->vars['orderby'] = "post_votes_up DESC ";167 $h->vars['orderby'] = "post_votes_up DESC, post_date DESC"; 168 168 } 169 169 elseif ($type == 'top-365-days') … … 174 174 $end = date('YmdHis', strtotime("-365 days")); 175 175 $h->vars['filter']['(post_date >= %s AND post_date <= %s)'] = array($end, $start); 176 $h->vars['orderby'] = "post_votes_up DESC ";176 $h->vars['orderby'] = "post_votes_up DESC, post_date DESC"; 177 177 } 178 178 elseif ($type == 'top-all-time') … … 180 180 // Filters page to "top" stories in order of votes 181 181 $h->vars['filter']['post_status = %s'] = 'top'; 182 $h->vars['orderby'] = "post_votes_up DESC ";182 $h->vars['orderby'] = "post_votes_up DESC, post_date DESC"; 183 183 } 184 184 elseif ($type == 'top') -
trunk/content/plugins/user_rankings/user_rankings.php
r1304 r1305 177 177 $output .= "<a class='user_rankings_" . $css . "_name' href='" . $h->url(array('user' => $user->name)) . "'>" . $user->name . "</a> \n"; 178 178 } 179 180 $h->vars['user_rankings_output'] = ""; 181 $h->pluginHook('user_rankings_item', '', array('points' => $points, 'css' => $css)); 182 $output .= $h->vars['user_rankings_output']; 179 183 180 184 $output .= "<div class='user_rankings_" . $css . "_points'>" . $points . "</div>\n"; -
trunk/content/plugins/users/libs/UserFunctions.php
r1234 r1305 114 114 $body .= $h->lang['userfunctions_notifymods_body_user_role'] . $user->role . $next_line; 115 115 $body .= $h->lang['userfunctions_notifymods_body_user_email'] . $user->email . $next_line; 116 $body .= $h->lang['userfunctions_notifymods_body_user_account'] . $h->url(array('page'=>'account', 'user'=>$user->name)). $next_line;116 $body .= $h->lang['userfunctions_notifymods_body_user_account'] . BASEURL . "index.php?page=account&user=" . $user->name . $next_line; 117 117 $body .= $h->lang['userfunctions_notifymods_body_user_management'] . BASEURL . "admin_index.php?search_value=" . $user->name . "&plugin=user_manager&page=plugin_settings&type=search"; 118 118 -
trunk/content/plugins/vote/vote.php
r1234 r1305 206 206 } else { 207 207 $h->changePostStatus('buried'); 208 $h->clearCache('html_cache', false); 208 209 $h->pluginHook('vote_post_status_buried'); // Akismet hooks in here to report the post as spam 209 210 } -
trunk/content/themes/default/css/style.css
r1304 r1305 78 78 79 79 .green { background-color: #99FF66; } 80 .yellow { background-color: #fbe760; } 80 81 .red { background-color: #FF6A55; color: #ffffff; } 81 82 .bold_red { color: red; font-weight: bold; } -
trunk/hotaru_settings_default.php
r1081 r1305 41 41 // Paths 42 42 define('BASEURL', "http://www.mysite.com/"); // e.g. http://www.mysite.com/ 43 44 43 // Needs trailing slash (/) 45 44 -
trunk/install/install_tables.php
r1304 r1305 371 371 $sql = "INSERT INTO " . DB_PREFIX . $table_name . " (settings_name, settings_value, settings_default, settings_note) VALUES (%s, %s, %s, %s)"; 372 372 $db->query($db->prepare($sql, 'DEBUG', 'false', 'false', '')); 373 374 // SMTP on 375 $sql = "INSERT INTO " . DB_PREFIX . $table_name . " (settings_name, settings_value, settings_default, settings_note) VALUES (%s, %s, %s, %s)"; 376 $db->query($db->prepare($sql, 'SMTP_ON', 'false', 'false', 'Email auth')); 377 378 // SMTP host 379 $sql = "INSERT INTO " . DB_PREFIX . $table_name . " (settings_name, settings_value, settings_default, settings_note) VALUES (%s, %s, %s, %s)"; 380 $db->query($db->prepare($sql, 'SMTP_HOST', 'mail.example.com', 'mail.example.com', '')); 381 382 // SMTP port 383 $sql = "INSERT INTO " . DB_PREFIX . $table_name . " (settings_name, settings_value, settings_default, settings_note) VALUES (%s, %s, %s, %s)"; 384 $db->query($db->prepare($sql, 'SMTP_PORT', '25', '25', '')); 385 386 // SMTP username 387 $sql = "INSERT INTO " . DB_PREFIX . $table_name . " (settings_name, settings_value, settings_default, settings_note) VALUES (%s, %s, %s, %s)"; 388 $db->query($db->prepare($sql, 'SMTP_USERNAME', '', '', '')); 389 390 // SMTP password 391 $sql = "INSERT INTO " . DB_PREFIX . $table_name . " (settings_name, settings_value, settings_default, settings_note) VALUES (%s, %s, %s, %s)"; 392 $db->query($db->prepare($sql, 'SMTP_PASSWORD', '', '', '')); 373 393 } 374 394 -
trunk/install/upgrade.php
r1304 r1305 346 346 347 347 // 1.1 to 1.1.2 348 if ($old_version == "1.1.1") { $old_version = "1.1.2"; } // update "old version" for next set of upgrades 348 if ($old_version == "1.1.1") { 349 350 // SMTP on 351 $sql = "INSERT INTO " . TABLE_SETTINGS . " (settings_name, settings_value, settings_default, settings_note) VALUES (%s, %s, %s, %s)"; 352 $h->db->query($h->db->prepare($sql, 'SMTP_ON', 'false', 'false', 'Email auth')); 353 354 // SMTP host 355 $sql = "INSERT INTO " . TABLE_SETTINGS . " (settings_name, settings_value, settings_default, settings_note) VALUES (%s, %s, %s, %s)"; 356 $h->db->query($h->db->prepare($sql, 'SMTP_HOST', 'mail.example.com', 'mail.example.com', '')); 357 358 // SMTP port 359 $sql = "INSERT INTO " . TABLE_SETTINGS . " (settings_name, settings_value, settings_default, settings_note) VALUES (%s, %s, %s, %s)"; 360 $h->db->query($h->db->prepare($sql, 'SMTP_PORT', '25', '25', '')); 361 362 // SMTP username 363 $sql = "INSERT INTO " . TABLE_SETTINGS . " (settings_name, settings_value, settings_default, settings_note) VALUES (%s, %s, %s, %s)"; 364 $h->db->query($h->db->prepare($sql, 'SMTP_USERNAME', '', '', '')); 365 366 // SMTP password 367 $sql = "INSERT INTO " . TABLE_SETTINGS . " (settings_name, settings_value, settings_default, settings_note) VALUES (%s, %s, %s, %s)"; 368 $h->db->query($h->db->prepare($sql, 'SMTP_PASSWORD', '', '', '')); 369 370 // update "old version" for next set of upgrades 371 $old_version = "1.1.2"; 372 } 349 373 350 374 // Update Hotaru version number to the database (referred to when upgrading) -
trunk/libs/AdminPages.php
r1120 r1305 134 134 foreach ($loaded_settings as $setting_name) { 135 135 if ($h->cage->post->keyExists($setting_name->settings_name)) { 136 $setting_value = $h->cage->post-> noTags($setting_name->settings_name);136 $setting_value = $h->cage->post->getRaw($setting_name->settings_name); 137 137 if (!$error && $setting_value && $setting_value != $setting_name->settings_value) { 138 138 $this->adminSettingUpdate($h, $setting_name->settings_name, $setting_value); … … 141 141 if (!$setting_value) { 142 142 // empty value 143 $error = 1; 144 } else { 145 // No change to the value 146 $error = 0; 143 $error = 1; 147 144 } 148 145 } 149 146 } else { 150 // error, setting empty. 151 $error = 1; 147 // values that are allowed to be empty: 148 $exempt = array('SMTP_USERNAME', 'SMTP_PASSWORD'); 149 if (!in_array($setting_name->settings_name, $exempt)) { 150 // otherwise flag as an error: 151 $error = 1; 152 } 152 153 } 153 154 } -
trunk/libs/EmailFunctions.php
r1304 r1305 28 28 { 29 29 protected $to = ''; 30 protected $subject = ''; 30 protected $from = ''; 31 protected $subject = 'No Subject'; 31 32 protected $body = ''; 32 33 protected $headers = ''; 33 protected $type = ''; 34 protected $type = 'email'; 35 private $smtp = NULL; 34 36 35 37 /** … … 50 52 return $this->$var; 51 53 } 52 54 53 55 54 56 /** 55 * Constructor 56 * 57 * @param string $to - defaults to SITE_EMAIL 58 * @param string $subject - defaults to "No Subject"; 59 * @param string $body - returns false if empty 60 * @param string $headers e.g. "From: " . SITE_EMAIL . "\r\nReply-To: " . SITE_EMAIL . "\r\nX-Priority: 3\r\n"; 61 * @param string $type - default is "email", but you can write to a "log" file, print to "screen" or "return" the content 62 * @return array - only if $type = "return" 63 */ 64 public function __construct($to = '', $subject = '', $body = '', $headers = '', $type = 'email') 65 { 66 $this->to = $to; 67 $this->subject = $subject; 68 $this->body = $body; 69 $this->headers = $headers; 70 $this->type = $type; 71 72 if (!$this->to) { $this->to = SITE_EMAIL; } 73 if (!$this->subject) { $this->subject = "No Subject"; } 74 if (!$this->body) { return false; } 75 if (!$this->headers) { $this->headers = "From: " . SITE_EMAIL . "\r\nReply-To: " . SITE_EMAIL . "\r\nX-Priority: 3\r\n"; } 76 } 77 78 /** 79 * Send emails 80 * 81 * @param string $to - defaults to SITE_EMAIL 82 * @param string $subject - defaults to "No Subject"; 83 * @param string $body - returns false if empty 84 * @param string $headers default is "From: " . SITE_EMAIL . "\r\nReply-To: " . SITE_EMAIL . "\r\nX-Priority: 3\r\n"; 85 * @param string $type - default is "email", but you can write to a "log" file, print to "screen" or "return" an array of the content 86 * @return array - only if $type = "return" 57 * Send emails - Note: properties must be set before calling this function 87 58 */ 88 59 public function doEmail() 89 { 90 // OVERRIDE THE TYPE HERE BY UNCOMMENTING THE LINE BELOW - Very handy when developing offline with WampServer, etc. 91 // $this->type = 'log'; // this will write all emails to email_log.txt in the cache folder INSTEAD of sending them. 60 { 61 if (!$this->body) { return false; } 62 63 if (!$this->to) { $this->to = SITE_NAME . ' <' . SITE_EMAIL . '>'; } 64 if (!$this->from) { $this->from = SITE_NAME . ' <' . SITE_EMAIL . '>'; } 65 66 if (SMTP_ON == 'true') { 67 // note: this overwrites headers passed to this function: 68 $this->headers = array ('From' => $this->from, 'To' => $this->to, 'Subject' => $this->subject); 69 } else { 70 // if not using SMTP and no headers passed to this function, use default 71 if (!$this->headers) { 72 $this->headers = "From: " . $this->from . "\r\nReply-To: " . SITE_EMAIL . "\r\nX-Priority: 3\r\n"; 73 } 74 } 92 75 93 76 switch ($this->type) … … 113 96 break; 114 97 default: 115 $return_path = "-f " . SITE_EMAIL; 116 mail($this->to, $this->subject, $this->body, $this->headers, $return_path); 98 if (SMTP_ON == 'true') { 99 $this->doSmtpEmail(); 100 } else { 101 $return_path = "-f " . SITE_EMAIL; 102 mail($this->to, $this->subject, $this->body, $this->headers, $return_path); 103 } 117 104 } 105 } 106 107 108 /** 109 * Send email using SMTP authentication and SSL Encryption 110 */ 111 public function doSmtpEmail() 112 { 113 // Only create a new smtp object if we don't already have one: 114 if (!is_object($this->smtp)) 115 { 116 $smtp_array = array ( 117 'host' => SMTP_HOST, 118 'port' => SMTP_PORT, 119 'auth' => true, 120 'username' => SMTP_USERNAME, 121 'password' => SMTP_PASSWORD 122 ); 123 124 require_once "Mail.php"; 125 $this->smtp = Mail::factory('smtp', $smtp_array); 126 } 127 128 $mail = $this->smtp->send($this->to, $this->headers, $this->body); 129 130 131 if (PEAR::isError($mail)) { 132 echo("<p>" . $mail->getMessage() . "</p>"); 133 exit; 134 } 118 135 } 119 136 } -
trunk/libs/Feeds.php
r1081 r1305 79 79 80 80 // Title 81 $output .= "<a href='" . $item->get_permalink() . "'>" . $item->get_title() . "</a><br />";81 $output .= "<a href='" . $item->get_permalink() . "'>" . sanitize($item->get_title(), 'tags') . "</a><br />"; 82 82 83 83 if ($item_count < $items_with_content) … … 96 96 97 97 // Content 98 $output .= substr(s trip_tags($item->get_content()), 0, $max_chars);98 $output .= substr(sanitize($item->get_content(), 'tags'), 0, $max_chars); 99 99 $output .= "... "; 100 100 101 101 // Read more 102 $output .= "<small><a href='" . $item->get_permalink() . "' title='" . $item->get_title() . "'>[" . $lang["admin_news_read_more"] . "]</a>";102 $output .= "<small><a href='" . $item->get_permalink() . "' title='" . sanitize($item->get_title(), 'tags') . "'>[" . $lang["admin_news_read_more"] . "]</a>"; 103 103 $output .= "</small>"; 104 104 } -
trunk/libs/InspektExtras.php
r1234 r1305 163 163 protected function inspekt($text) 164 164 { 165 $config = array('safe' => 1); 165 /* make_tag_strict is OFF because we don't want to convert <u>, etc. to css 166 otherwise the strip_tags won't be able to allow them when requested in sanitize(). */ 167 $config = array('safe' => 1, 'make_tag_strict' => 0); 166 168 167 169 // Allow plugins to alter the value of $config/ -
trunk/libs/extensions/ezSQL/mysql/ez_sql_mysql.php
r1234 r1305 226 226 { 227 227 if (defined(DEBUG) && (DEBUG == 'true')) { 228 $headers = "From: " . SITE_EMAIL . "\r\nReply-To: " . SITE_EMAIL . "\r\nX-Priority: 3\r\n";229 228 $subject = SITE_NAME . " Database Error"; 230 229 $body = SITE_NAME . " Database Error\r\n\r\n"; … … 248 247 // we can avoid using the $h object (which we might not have) by calling EmailFunctions directly. 249 248 require_once(LIBS . 'EmailFunctions.php'); 250 $emailFunctions = new EmailFunctions(SITE_EMAIL, $subject, $body, $headers); 249 $emailFunctions = new EmailFunctions(); 250 $emailFunctions->subject = $subject; 251 $emailFunctions->body = $body; 251 252 $emailFunctions->doEmail(); 252 253 }
Note: See TracChangeset
for help on using the changeset viewer.