Changeset 1375
- Timestamp:
- 03/21/10 12:48:36 (3 years ago)
- Location:
- trunk
- Files:
-
- 52 edited
- 85 copied
-
. (modified) (1 prop)
-
Hotaru.php (modified) (6 diffs)
-
READ_ME.txt (modified) (1 diff)
-
content/admin_language.php (modified) (2 diffs)
-
content/admin_themes/admin_default/admin_home.php (modified) (3 diffs)
-
content/admin_themes/admin_default/index.php (modified) (1 diff)
-
content/admin_themes/admin_default/maintenance.php (modified) (3 diffs)
-
content/plugins (modified) (2 props)
-
content/plugins/comments/comments.php (modified) (6 diffs)
-
content/plugins/comments/readme.txt (modified) (1 diff)
-
content/plugins/contact_us (copied) (copied from branches/1.2/content/plugins/contact_us)
-
content/plugins/contact_us/contact_us.php (copied) (copied from branches/1.2/content/plugins/contact_us/contact_us.php)
-
content/plugins/contact_us/contact_us_settings.php (copied) (copied from branches/1.2/content/plugins/contact_us/contact_us_settings.php)
-
content/plugins/contact_us/css (copied) (copied from branches/1.2/content/plugins/contact_us/css)
-
content/plugins/contact_us/css/contact_us.css (copied) (copied from branches/1.2/content/plugins/contact_us/css/contact_us.css)
-
content/plugins/contact_us/languages (copied) (copied from branches/1.2/content/plugins/contact_us/languages)
-
content/plugins/contact_us/languages/contact_us_language.php (copied) (copied from branches/1.2/content/plugins/contact_us/languages/contact_us_language.php)
-
content/plugins/contact_us/readme.txt (copied) (copied from branches/1.2/content/plugins/contact_us/readme.txt)
-
content/plugins/contact_us/templates (copied) (copied from branches/1.2/content/plugins/contact_us/templates)
-
content/plugins/contact_us/templates/contact_form.php (copied) (copied from branches/1.2/content/plugins/contact_us/templates/contact_form.php)
-
content/plugins/cron (copied) (copied from branches/1.2/content/plugins/cron)
-
content/plugins/cron/cron.php (copied) (copied from branches/1.2/content/plugins/cron/cron.php)
-
content/plugins/cron/cron_settings.php (copied) (copied from branches/1.2/content/plugins/cron/cron_settings.php)
-
content/plugins/cron/readme.txt (copied) (copied from branches/1.2/content/plugins/cron/readme.txt)
-
content/plugins/messaging/libs/MessagingFuncs.php (modified) (1 diff)
-
content/plugins/recaptcha (copied) (copied from branches/1.2/content/plugins/recaptcha)
-
content/plugins/recaptcha/languages (copied) (copied from branches/1.2/content/plugins/recaptcha/languages)
-
content/plugins/recaptcha/languages/recaptcha_language.php (copied) (copied from branches/1.2/content/plugins/recaptcha/languages/recaptcha_language.php)
-
content/plugins/recaptcha/libs (copied) (copied from branches/1.2/content/plugins/recaptcha/libs)
-
content/plugins/recaptcha/libs/LICENSE (copied) (copied from branches/1.2/content/plugins/recaptcha/libs/LICENSE)
-
content/plugins/recaptcha/libs/recaptchalib.php (copied) (copied from branches/1.2/content/plugins/recaptcha/libs/recaptchalib.php)
-
content/plugins/recaptcha/readme.txt (copied) (copied from branches/1.2/content/plugins/recaptcha/readme.txt)
-
content/plugins/recaptcha/recaptcha.php (copied) (copied from branches/1.2/content/plugins/recaptcha/recaptcha.php)
-
content/plugins/recaptcha/recaptcha_settings.php (copied) (copied from branches/1.2/content/plugins/recaptcha/recaptcha_settings.php)
-
content/plugins/sb_base/languages/sb_base_language.php (modified) (1 diff)
-
content/plugins/sb_base/libs/SbBaseFunctions.php (modified) (2 diffs)
-
content/plugins/sb_base/readme.txt (modified) (1 diff)
-
content/plugins/sb_base/sb_base.php (modified) (3 diffs)
-
content/plugins/sb_base/sb_base_settings.php (modified) (5 diffs)
-
content/plugins/submit/libs/SubmitFunctions.php (modified) (1 diff)
-
content/plugins/updown_voting (copied) (copied from branches/1.2/content/plugins/updown_voting)
-
content/plugins/updown_voting/css (copied) (copied from branches/1.2/content/plugins/updown_voting/css)
-
content/plugins/updown_voting/css/updown_voting.css (copied) (copied from branches/1.2/content/plugins/updown_voting/css/updown_voting.css)
-
content/plugins/updown_voting/javascript (copied) (copied from branches/1.2/content/plugins/updown_voting/javascript)
-
content/plugins/updown_voting/javascript/json2.min.js (copied) (copied from branches/1.2/content/plugins/updown_voting/javascript/json2.min.js)
-
content/plugins/updown_voting/javascript/updown_voting.js (copied) (copied from branches/1.2/content/plugins/updown_voting/javascript/updown_voting.js)
-
content/plugins/updown_voting/languages (copied) (copied from branches/1.2/content/plugins/updown_voting/languages)
-
content/plugins/updown_voting/languages/updown_voting_language.php (copied) (copied from branches/1.2/content/plugins/updown_voting/languages/updown_voting_language.php)
-
content/plugins/updown_voting/readme.txt (copied) (copied from branches/1.2/content/plugins/updown_voting/readme.txt)
-
content/plugins/updown_voting/templates (copied) (copied from branches/1.2/content/plugins/updown_voting/templates)
-
content/plugins/updown_voting/templates/updown_voting_alert.php (copied) (copied from branches/1.2/content/plugins/updown_voting/templates/updown_voting_alert.php)
-
content/plugins/updown_voting/templates/updown_voting_button.php (copied) (copied from branches/1.2/content/plugins/updown_voting/templates/updown_voting_button.php)
-
content/plugins/updown_voting/updown_voting.php (copied) (copied from branches/1.2/content/plugins/updown_voting/updown_voting.php)
-
content/plugins/updown_voting/updown_voting_functions.php (copied) (copied from branches/1.2/content/plugins/updown_voting/updown_voting_functions.php)
-
content/plugins/updown_voting/updown_voting_settings.php (copied) (copied from branches/1.2/content/plugins/updown_voting/updown_voting_settings.php)
-
content/plugins/user_manager/css/user_manager.css (modified) (1 diff)
-
content/plugins/user_manager/languages/user_manager_language.php (modified) (1 diff)
-
content/plugins/user_manager/readme.txt (modified) (1 diff)
-
content/plugins/user_manager/templates/user_man_add.php (copied) (copied from branches/1.2/content/plugins/user_manager/templates/user_man_add.php)
-
content/plugins/user_manager/templates/user_man_main.php (modified) (1 diff)
-
content/plugins/user_manager/templates/user_man_perms.php (modified) (1 diff)
-
content/plugins/user_manager/templates/user_man_user_settings.php (modified) (1 diff)
-
content/plugins/user_manager/user_manager.php (modified) (1 diff)
-
content/plugins/user_manager/user_manager_settings.php (modified) (2 diffs)
-
content/plugins/user_signin/readme.txt (modified) (1 diff)
-
content/plugins/user_signin/user_signin.php (modified) (3 diffs)
-
content/plugins/users/css/users.css (modified) (1 diff)
-
content/plugins/users/libs/UserFunctions.php (modified) (1 diff)
-
content/plugins/users/readme.txt (modified) (1 diff)
-
content/plugins/users/users.php (modified) (1 diff)
-
content/themes/cut-here (copied) (copied from branches/1.2/content/themes/cut-here)
-
content/themes/cut-here/404error.php (copied) (copied from branches/1.2/content/themes/cut-here/404error.php)
-
content/themes/cut-here/css (copied) (copied from branches/1.2/content/themes/cut-here/css)
-
content/themes/cut-here/css/960.css (copied) (copied from branches/1.2/content/themes/cut-here/css/960.css)
-
content/themes/cut-here/css/categories.css (copied) (copied from branches/1.2/content/themes/cut-here/css/categories.css)
-
content/themes/cut-here/css/comments.css (copied) (copied from branches/1.2/content/themes/cut-here/css/comments.css)
-
content/themes/cut-here/css/reset.css (copied) (copied from branches/1.2/content/themes/cut-here/css/reset.css)
-
content/themes/cut-here/css/sb_base.css (copied) (copied from branches/1.2/content/themes/cut-here/css/sb_base.css)
-
content/themes/cut-here/css/style.css (copied) (copied from branches/1.2/content/themes/cut-here/css/style.css)
-
content/themes/cut-here/css/tags.css (copied) (copied from branches/1.2/content/themes/cut-here/css/tags.css)
-
content/themes/cut-here/css/text.css (copied) (copied from branches/1.2/content/themes/cut-here/css/text.css)
-
content/themes/cut-here/css/vote.css (copied) (copied from branches/1.2/content/themes/cut-here/css/vote.css)
-
content/themes/cut-here/footer.php (copied) (copied from branches/1.2/content/themes/cut-here/footer.php)
-
content/themes/cut-here/header.php (copied) (copied from branches/1.2/content/themes/cut-here/header.php)
-
content/themes/cut-here/images (copied) (copied from branches/1.2/content/themes/cut-here/images)
-
content/themes/cut-here/images/alert.png (copied) (copied from branches/1.2/content/themes/cut-here/images/alert.png)
-
content/themes/cut-here/images/comment.png (copied) (copied from branches/1.2/content/themes/cut-here/images/comment.png)
-
content/themes/cut-here/images/edit.png (copied) (copied from branches/1.2/content/themes/cut-here/images/edit.png)
-
content/themes/cut-here/images/flag_red.png (copied) (copied from branches/1.2/content/themes/cut-here/images/flag_red.png)
-
content/themes/cut-here/images/flag_yellow.png (copied) (copied from branches/1.2/content/themes/cut-here/images/flag_yellow.png)
-
content/themes/cut-here/images/footer.png (copied) (copied from branches/1.2/content/themes/cut-here/images/footer.png)
-
content/themes/cut-here/images/grigious.png (copied) (copied from branches/1.2/content/themes/cut-here/images/grigious.png)
-
content/themes/cut-here/images/header-bg-cat.png (copied) (copied from branches/1.2/content/themes/cut-here/images/header-bg-cat.png)
-
content/themes/cut-here/images/header-bg-top.png (copied) (copied from branches/1.2/content/themes/cut-here/images/header-bg-top.png)
-
content/themes/cut-here/images/here.png (copied) (copied from branches/1.2/content/themes/cut-here/images/here.png)
-
content/themes/cut-here/images/hotarucms.png (copied) (copied from branches/1.2/content/themes/cut-here/images/hotarucms.png)
-
content/themes/cut-here/images/logo-top.png (copied) (copied from branches/1.2/content/themes/cut-here/images/logo-top.png)
-
content/themes/cut-here/images/rss_10.png (copied) (copied from branches/1.2/content/themes/cut-here/images/rss_10.png)
-
content/themes/cut-here/images/rss_16.png (copied) (copied from branches/1.2/content/themes/cut-here/images/rss_16.png)
-
content/themes/cut-here/images/rss_28.png (copied) (copied from branches/1.2/content/themes/cut-here/images/rss_28.png)
-
content/themes/cut-here/images/scissors.png (copied) (copied from branches/1.2/content/themes/cut-here/images/scissors.png)
-
content/themes/cut-here/images/star.png (copied) (copied from branches/1.2/content/themes/cut-here/images/star.png)
-
content/themes/cut-here/images/tags.png (copied) (copied from branches/1.2/content/themes/cut-here/images/tags.png)
-
content/themes/cut-here/images/tweet-this.png (copied) (copied from branches/1.2/content/themes/cut-here/images/tweet-this.png)
-
content/themes/cut-here/images/vote.png (copied) (copied from branches/1.2/content/themes/cut-here/images/vote.png)
-
content/themes/cut-here/images/voteup.png (copied) (copied from branches/1.2/content/themes/cut-here/images/voteup.png)
-
content/themes/cut-here/index.php (copied) (copied from branches/1.2/content/themes/cut-here/index.php)
-
content/themes/cut-here/navigation.php (copied) (copied from branches/1.2/content/themes/cut-here/navigation.php)
-
content/themes/cut-here/sidebar.php (copied) (copied from branches/1.2/content/themes/cut-here/sidebar.php)
-
content/themes/hotaru-light/css/style.css (modified) (2 diffs)
-
content/themes/hotaru-light/images/alert.png (copied) (copied from branches/1.2/content/themes/hotaru-light/images/alert.png)
-
content/themes/hotaru-light/images/comment.png (copied) (copied from branches/1.2/content/themes/hotaru-light/images/comment.png)
-
content/themes/hotaru-light/images/edit.png (copied) (copied from branches/1.2/content/themes/hotaru-light/images/edit.png)
-
content/themes/hotaru-light/images/star.png (copied) (copied from branches/1.2/content/themes/hotaru-light/images/star.png)
-
content/themes/hotaru-light/images/tags.png (copied) (copied from branches/1.2/content/themes/hotaru-light/images/tags.png)
-
content/themes/hotaru-light/images/tweet-this.png (copied) (copied from branches/1.2/content/themes/hotaru-light/images/tweet-this.png)
-
content/themes/keep-it-simple/css/style.css (modified) (2 diffs)
-
content/themes/shibuya/css/style.css (modified) (2 diffs)
-
content/themes/shibuya/languages (copied) (copied from branches/1.2/content/themes/shibuya/languages)
-
functions/funcs.arrays.php (modified) (1 diff)
-
functions/funcs.strings.php (modified) (2 diffs)
-
htaccess_default (modified) (1 diff)
-
install/install.php (modified) (1 diff)
-
install/install_tables.php (modified) (4 diffs)
-
install/upgrade.php (modified) (1 diff)
-
libs/AdminPages.php (modified) (3 diffs)
-
libs/Caching.php (modified) (3 diffs)
-
libs/Category.php (modified) (1 diff)
-
libs/Debug.php (modified) (3 diffs)
-
libs/EmailFunctions.php (modified) (3 diffs)
-
libs/Feeds.php (modified) (1 diff)
-
libs/IncludeCssJs.php (modified) (1 diff)
-
libs/Initialize.php (modified) (3 diffs)
-
libs/Language.php (modified) (2 diffs)
-
libs/Maintenance.php (modified) (1 diff)
-
libs/Post.php (modified) (1 diff)
-
libs/UserAuth.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/1.2 merged: 1314-1324,1327-1373
- Property svn:mergeinfo changed
-
trunk/Hotaru.php
r1305 r1375 26 26 class Hotaru 27 27 { 28 protected $version = "1.1. 2"; // Hotaru CMS version28 protected $version = "1.1.3"; // Hotaru CMS version 29 29 protected $isDebug = false; // show db queries and page loading time 30 30 protected $isAdmin = false; // flag to tell if we are in Admin or not … … 993 993 */ 994 994 public function updateSetting($setting = '', $value = '', $folder = '') 995 { 995 { 996 996 $pluginSettings = new PluginSettings(); 997 997 return $pluginSettings->updateSetting($this, $setting, $value, $folder); … … 1215 1215 1216 1216 1217 1217 /** 1218 * Generate a system report 1219 * 1220 * @param string $type "log" or "object" 1221 */ 1222 public function generateReport($type = 'log') 1223 { 1224 return $this->debug->generateReport($this, $type); 1225 } 1226 1218 1227 1219 1228 /* ************************************************************* … … 1233 1242 * @return object|false $sp 1234 1243 */ 1235 public function newSimplePie($feed='', $cache=RSS_CACHE _ON, $cache_duration=RSS_CACHE_DURATION)1244 public function newSimplePie($feed='', $cache=RSS_CACHE, $cache_duration=RSS_CACHE_DURATION) 1236 1245 { 1237 1246 require_once(LIBS . 'Feeds.php'); … … 1317 1326 if ($this->currentUser->getPermission('can_access_admin') == 'yes') { return true; } 1318 1327 1319 if ($this->pageName == 'admin_login' ) { return true; }1328 if ($this->pageName == 'admin_login' || $this->pageName == 'api' ) { return true; } 1320 1329 1321 1330 require_once(LIBS . 'Maintenance.php'); … … 1446 1455 return $maintenance->getFiles($dir, $exclude); 1447 1456 } 1457 1458 1459 /** 1460 * System Report is under Debug Functions 1461 */ 1448 1462 1449 1463 -
trunk/READ_ME.txt
r1304 r1375 1 1 HOTARU CMS 2 Version: 1.1. 23 Released: Mar 8th20102 Version: 1.1.3 3 Released: Mar 21st 2010 4 4 5 5 INSTALLATION -
trunk/content/admin_language.php
r1305 r1375 142 142 $lang["admin_maintenance_site_opened"] = SITE_NAME . " will be opened next page view"; 143 143 $lang['admin_maintenance_announcement_updated'] = "Site announcement updated"; 144 $lang['admin_maintenance_system_report_success'] = "New system report generated"; 145 $lang['admin_maintenance_system_report_failure'] = "Unable to generate a system report"; 146 $lang['admin_maintenance_system_report_emailed'] = "System report emailed to HotaruCMS.org"; 147 144 148 $lang["admin_theme_maintenance"] = "Maintenance"; 145 149 $lang["admin_theme_maintenance_title"] = "Hotaru Maintenance"; … … 167 171 $lang["admin_theme_maintenance_rss_cache_desc"] = "deletes cached RSS feeds."; 168 172 $lang["admin_theme_maintenance_debug"] = "Debug:"; 173 $lang["admin_theme_maintenance_system_report"] = "Generate a system report"; 174 $lang["admin_theme_maintenance_email_system_report"] = "Email a system report to HotaruCMS.org"; 175 $lang["admin_theme_maintenance_email_system_report_note"] = "<span style='color: red'>(Only use if requested in the forums)</span>"; 169 176 $lang["admin_theme_maintenance_debug_delete"] = "Clear debug files from the cache"; 170 177 $lang["admin_theme_maintenance_debug_view"] = "Click the filenames to view the logs:"; -
trunk/content/admin_themes/admin_default/admin_home.php
r1081 r1375 35 35 <!-- TITLE FOR ADMIN NEWS --> 36 36 <h2> 37 <a href="http://feeds2.feedburner.com/hotarucms"><img src="<?php echo BASEURL; ?>content/admin_themes/<?php echo ADMIN_THEME; ?>images/rss_16.png" ></a>37 <a href="http://feeds2.feedburner.com/hotarucms"><img src="<?php echo BASEURL; ?>content/admin_themes/<?php echo ADMIN_THEME; ?>images/rss_16.png" alt="rss" /></a> 38 38 <?php echo $h->lang["admin_theme_main_latest"]; ?> 39 39 </h2> … … 41 41 <!-- Feed items, number to show content for, max characters for content --> 42 42 <?php echo $h->adminNews(10, 3, 300); ?> 43 44 <br/> 45 <h2>Join us on Facebook and <a href="http://twitter.com/hotarucms">Twitter</a></h2> 46 <script type="text/javascript" src="http://static.ak.connect.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php/en_US"></script><script type="text/javascript">FB.init("0ad945f33921afd2275ff6ca8997c2a3");</script><fb:fan profile_id="116731959368" stream="" connections="16" width="460"></fb:fan> 47 <div style="font-size:12px; padding-left:10px"><a href="http://www.facebook.com/hotarucms">HotaruCMS on Facebook</a> 48 </div> 49 43 50 </td> 44 51 … … 47 54 <ul id="site-stats"> 48 55 <li>Hotaru CMS v.<?php echo $h->version; ?></li> 56 <?php $h->pluginHook('admin_theme_main_stats_post_version'); ?> 49 57 <?php $h->pluginHook('admin_theme_main_stats', 'users', array('total_users', 'admins', 'supermods', 'moderators')); ?> 50 58 <?php $h->pluginHook('admin_theme_main_stats', 'users', array('approved_users', 'undermod_users', 'pending_users', 'banned_users', 'killspammed_users')); ?> -
trunk/content/admin_themes/admin_default/index.php
r1081 r1375 26 26 * @link http://www.hotarucms.org/ 27 27 */ 28 29 // merge custom admin_language.php if exists in admin theme's languages folder 30 // can be overridden by an admin_languages.php in a user theme's languages folder 31 $h->includeThemeLanguage('admin'); 32 28 33 // plugin hook 29 34 $result = $h->pluginHook('admin_theme_index_top'); -
trunk/content/admin_themes/admin_default/maintenance.php
r1081 r1375 88 88 <h2><?php echo $h->lang["admin_theme_maintenance_debug"]; ?></h2> 89 89 <ul> 90 <li style="margin-bottom: 1em;"><a href="<?php echo BASEURL; ?>admin_index.php?page=maintenance&action=delete_debugs">90 <li><a href="<?php echo BASEURL; ?>admin_index.php?page=maintenance&action=delete_debugs"> 91 91 <?php echo $h->lang["admin_theme_maintenance_debug_delete"]; ?></a></li> 92 <li style="margin-bottom: 1em;"><a href="<?php echo BASEURL; ?>admin_index.php?page=maintenance&action=system_report"> 93 <?php echo $h->lang["admin_theme_maintenance_system_report"]; ?></a></li> 94 <li style="margin-bottom: 1em;"><a href="<?php echo BASEURL; ?>admin_index.php?page=maintenance&action=email_report"> 95 <?php echo $h->lang["admin_theme_maintenance_email_system_report"]; ?></a> 96 <?php echo $h->lang["admin_theme_maintenance_email_system_report_note"]; ?></li> 92 97 </ul> 93 98 … … 95 100 echo $h->lang["admin_theme_maintenance_debug_view"] . "<br />"; 96 101 foreach ($h->vars['debug_files'] as $file) { 97 echo "<a href='" . BASEURL . " cache/debug_logs/" . $file . "'>" . $file . "</a><br />";102 echo "<a href='" . BASEURL . "admin_index.php?page=maintenance&debug=" . $file . "'>" . $file . "</a><br />"; 98 103 } 99 104 } else { … … 109 114 <?php $h->pluginHook('admin_maintenance_database'); ?> 110 115 </ul> 116 117 <?php $h->pluginHook('admin_maintenance_middle'); ?> 111 118 112 119 <br /> -
trunk/content/plugins
- Property svn:mergeinfo changed
/branches/1.2/content/plugins merged: 1315-1316,1319-1320,1322-1324,1329,1332,1334-1335,1337,1339,1351-1354,1357-1358,1363,1365,1370 -
Property
svn:ignore
set to
api
- Property svn:mergeinfo changed
-
trunk/content/plugins/comments/comments.php
r1305 r1375 3 3 * name: Comments 4 4 * description: Enables logged-in users to comment on posts 5 * version: 1. 75 * version: 1.8 6 6 * folder: comments 7 7 * class: Comments … … 258 258 if ($h->comment->content != '') { 259 259 $result = $h->comment->addComment($h); 260 260 261 261 // notify chosen mods of new comment by email if enabled and UserFunctions file exists 262 262 if (($comments_settings['comment_email_notify']) && (file_exists(PLUGINS . 'users/libs/UserFunctions.php'))) … … 266 266 $uf->notifyMods($h, 'comment', $h->comment->status, $h->comment->postId, $h->comment->id); 267 267 } 268 268 269 269 // email comment subscribers if this comment has 'approved' status: 270 270 if ($h->comment->status == 'approved') { … … 807 807 $subscribers = array(); 808 808 $subscriber_ids = array_unique($subscriber_ids); 809 809 810 foreach ($subscriber_ids as $subscriber_id) { 810 811 // remove the current comment author so he/she doesn't get emailed his own comment … … 833 834 $message .= $h->lang["comment_email_unsubscribe"]; 834 835 836 if (!$h->comment->email) { 837 // Get settings from database if they exist... 838 $comments_settings = $h->getSerializedSettings('comments'); 839 $h->comment->email = $comments_settings['comment_email']; 840 } 841 835 842 $from = SITE_EMAIL; 836 843 $to = $h->comment->email; // send email to address specified in Comment Settings; … … 840 847 $bcc = ""; 841 848 } 842 $headers = "From: " . $from . $bcc . "\r\nReply-To: " . $from . "\r\nX-Priority: 3\r\n"; 843 844 /* 845 echo "to: " . $to . "<br />"; 846 echo "bcc: " . $bcc . "<br />"; 847 echo "subject: " . $subject . "<br />"; 848 echo "message: " . $message . "<br />"; 849 echo "headers: " . $headers . "<br />"; 850 exit; 851 */ 852 853 $h->email($to, $subject, $message, $headers); 849 850 if (SMTP == 'true') { 851 $recipients['To'] = $to; 852 $recipients['Bcc'] = $send_to; 853 // no SMTP headers because they get overwritten in EmailFunctions anyway 854 $h->email($recipients, $subject, $message); 855 } else { 856 $recipients = $to; 857 $headers = "From: " . $from . $bcc . "\r\nReply-To: " . $from . "\r\nX-Priority: 3\r\n"; 858 $h->email($recipients, $subject, $message, $headers); 859 } 854 860 } 855 861 } -
trunk/content/plugins/comments/readme.txt
r1305 r1375 15 15 Changelog 16 16 --------- 17 v.1.8 2010/03/18 - Nick - Fix for not sending comment subscriptions when using SMTP email authentication. 17 18 v.1.7 2010/03/11 - Nick - Fix for a previous change that broke the set pending and delete links within comments. 18 19 v.1.6 2010/02/26 - Nick - Adds link to profile navigation; Email changed to go through Hotaru's "email" function -
trunk/content/plugins/messaging/libs/MessagingFuncs.php
r1256 r1375 195 195 196 196 // Hi username... 197 $email_message = "Hi ". $this->to . "," . $skip_line;197 $email_message = $h->lang['messaging_email_greeting'] . $this->to . "," . $skip_line; 198 198 199 199 // You've been sent a private message from... -
trunk/content/plugins/sb_base/languages/sb_base_language.php
r1210 r1375 53 53 /* SB Base Settings */ 54 54 $lang["sb_base_settings_header"] = "SB Base Configuration"; 55 $lang["sb_base_settings_posts_per_page"] = "posts per page <small>(default: 10)</small>"; 55 $lang["sb_base_settings_posts_per_page"] = "Posts per page <small>(default: 10)</small>"; 56 $lang["sb_base_settings_rss_redirect"] = "Automatically redirect RSS links to their original sources"; 56 57 $lang["sb_base_settings_post_archiving"] = "<b>Post Archiving</b>"; 57 58 $lang["sb_base_settings_post_archive_desc"] = "On the Maintenance page, there's a link you can use to archive old posts (or remove an existing archive). Archiving speeds up your site by excluding old posts and their comments, votes and tags from most database usage. Old posts can still be accessed via the search box or when loaded directly (e.g. from Google). <i>Note: Archiving is not automatic. You will need to update the archive periodically from the Maintenance page.</i>"; -
trunk/content/plugins/sb_base/libs/SbBaseFunctions.php
r1305 r1375 411 411 412 412 if ($results) { 413 414 // get sb base settings 415 $sb_base_settings = $h->getSerializedSettings('sb_base'); 416 413 417 foreach ($results as $result) 414 418 { … … 419 423 $title = html_entity_decode(urldecode($result->post_title), ENT_QUOTES,'UTF-8'); 420 424 $item->title = stripslashes($title); 421 $item->link = $h->url(array('page'=>$result->post_id)); 425 426 // if RSS redirecting is enabled, append forward=1 to the url 427 if (isset($sb_base_settings['rss_redirect']) && !empty($sb_base_settings['rss_redirect'])) { 428 $item->link = html_entity_decode($h->url(array('page'=>$result->post_id, 'forward'=>$result->post_id)), ENT_QUOTES,'UTF-8'); 429 } else { 430 $item->link = $h->url(array('page'=>$result->post_id)); 431 } 422 432 $item->setPubDate($result->post_date); 423 433 $item->description = "<![CDATA[ " . stripslashes(urldecode($result->post_content)) . " ]]>"; -
trunk/content/plugins/sb_base/readme.txt
r1309 r1375 14 14 Changelog 15 15 --------- 16 v.0.7 2010/03/15 - Nick - Added option to redirect RSS feeds through your site to their sources [courtesy of Gunaxin.com] 16 17 v.0.6 2010/03/13 - Nick - Lists ranked by vote are now ranked first by vote, second by recency 17 18 v.0.5 2010/02/26 - Nick - Filters hidden from user pages; Added profile navigation link -
trunk/content/plugins/sb_base/sb_base.php
r1309 r1375 3 3 * name: SB Base 4 4 * description: Social Bookmarking base - provides "list" and "post" templates. 5 * version: 0. 65 * version: 0.7 6 6 * folder: sb_base 7 7 * class: SbBase … … 43 43 $sb_base_settings = $h->getSerializedSettings(); 44 44 if (!isset($sb_base_settings['posts_per_page'])) { $sb_base_settings['posts_per_page'] = 10; } 45 if (!isset($sb_base_settings['rss_redirect'])) { $sb_base_settings['rss_redirect'] = ''; } 45 46 if (!isset($sb_base_settings['archive'])) { $sb_base_settings['archive'] = "no_archive"; } 46 47 $h->updateSetting('sb_base_settings', serialize($sb_base_settings)); … … 70 71 if ($h->cage->get->keyExists('sort')) { 71 72 $h->pageName = 'sort'; 73 } 74 75 // check if this is an RSS link forwarding to the source 76 if ($h->cage->get->keyExists('forward')) { 77 $post_id = $h->cage->get->testInt('forward'); 78 if ($post_id) { $post = $h->getPost($post_id); } 79 if (isset($post->post_orig_url)) { 80 header("Location:" . urldecode($post->post_orig_url)); 81 exit; 82 } 72 83 } 73 84 -
trunk/content/plugins/sb_base/sb_base_settings.php
r1081 r1375 45 45 46 46 $posts_per_page = $sb_base_settings['posts_per_page']; 47 $rss_redirect = $sb_base_settings['rss_redirect']; 47 48 $archive = $sb_base_settings['archive']; 48 49 … … 51 52 //...otherwise set to blank: 52 53 if (!$posts_per_page) { $posts_per_page = 10; } 54 if (!$rss_redirect) { $rss_redirect = ''; } 53 55 if (!$archive) { $archive = 'no_archive'; } 54 56 55 57 echo "<form name='sb_base_settings_form' action='" . BASEURL . "admin_index.php?page=plugin_settings&plugin=sb_base' method='post'>\n"; 56 58 59 // posts per page 57 60 echo "<p><input type='text' size=5 name='posts_per_page' value='" . $posts_per_page . "' /> "; 58 61 echo $h->lang["sb_base_settings_posts_per_page"] . "</p>\n"; 62 63 // rss redirecting? 64 echo "<p><input type='checkbox' name='rss_redirect' value='rss_redirect' " . $rss_redirect . " > " . $h->lang["sb_base_settings_rss_redirect"] . "<br />\n"; 59 65 60 66 $h->pluginHook('sb_base_settings_form'); … … 62 68 echo "<br />\n"; 63 69 70 // post archiving 64 71 echo $h->lang["sb_base_settings_post_archiving"] . "<br /><br />\n"; 65 72 echo $h->lang["sb_base_settings_post_archive_desc"] . "<br /><br />\n"; … … 95 102 $posts_per_page = $sb_base_settings['posts_per_page']; 96 103 } 104 105 106 // RSS Redirecting 107 if ($h->cage->post->keyExists('rss_redirect')) { 108 $rss_redirect = 'checked'; 109 } else { 110 $rss_redirect = ''; 111 } 97 112 98 113 // Post Archiving … … 105 120 106 121 $sb_base_settings['posts_per_page'] = $posts_per_page; 122 $sb_base_settings['rss_redirect'] = $rss_redirect; 107 123 $sb_base_settings['archive'] = $archive; 108 124 -
trunk/content/plugins/submit/libs/SubmitFunctions.php
r1210 r1375 703 703 $encoding=trim($matches[1]); 704 704 705 //you need iconv to encode to utf-8 706 if (function_exists("iconv")) 707 { 708 if (strcasecmp($encoding, 'utf-8') != 0) { 709 //convert the html code into utf-8 whatever encoding it is using 710 $string=iconv($encoding, 'UTF-8//IGNORE', $string); 711 } 705 //you need iconv to encode to utf-8 (if not, use custom iconv in funcs.strings.php) 706 if (strcasecmp($encoding, 'utf-8') != 0) { 707 //convert the html code into utf-8 whatever encoding it is using 708 $string=iconv($encoding, 'UTF-8//IGNORE', $string); 712 709 } 713 710 } -
trunk/content/plugins/user_manager/css/user_manager.css
r1307 r1375 21 21 22 22 .user_manager_name_icons { padding: 0.4em; display:none;} 23 24 #user_man_add_user form { border-bottom: 1px solid #ccc; } -
trunk/content/plugins/user_manager/languages/user_manager_language.php
r1081 r1375 126 126 $lang['user_man_no_settings'] = "There haven't been any settings installed by plugins yet"; 127 127 128 129 /* User Man Create User */ 130 131 $lang['user_man_add'] = "Add New User"; 132 $lang['user_man_add_new_user'] = "Add a new user"; 133 $lang["user_man_add_desc"] = "Use this page to add new users, send new passwords and request email validation."; 134 $lang["user_man_add_detail"] = "Enter a username and email address for the new user."; 135 $lang['user_man_add_success_password_sent'] = "User Created and Password Emailed"; 136 $lang['user_man_create_send'] = "Create User & Send Password"; 137 138 $lang["user_man_send_new_password"] = "Send a new random password"; 139 $lang["user_man_send_password_detail"] = "Enter a username for the user you wish to generate a new password for."; 140 $lang['user_man_send_password'] = "Send Password"; 141 $lang['user_man_new_password_sent'] = "New password generated and emailed."; 142 $lang['user_man_user_not_found'] = "Sorry, no user found with that name"; 143 144 $lang["user_man_send_email_validation"] = "Send an email validation request"; 145 $lang["user_man_send_email_validation_detail"] = "Enter a username for the user you wish to send an email validation message to."; 146 $lang['user_man_request_valid_email'] = "Request Email Validation"; 147 $lang['user_man_email_validation_request_sent'] = "Email validation request sent."; 148 128 149 ?> -
trunk/content/plugins/user_manager/readme.txt
r1190 r1375 15 15 Changelog 16 16 --------- 17 v.0.9 2010/03/17 - Nick - New page for creating users, sending new passwords and email validation requests 17 18 v.0.8 2010/02/18 - Nick - Fixes for changing user permissions and pagination 18 19 v.0.7 2010/02/02 - Nick - Improvements for spam management -
trunk/content/plugins/user_manager/templates/user_man_main.php
r1081 r1375 41 41 <b><u><?php echo $h->lang["user_man"]; ?></u></b> 42 42 <?php echo "<a href='" . BASEURL . "admin_index.php?plugin=user_manager&page=plugin_settings&subpage=default_perms'>" . $h->lang["user_man_default_perms"] . "</a>"; ?> 43 <?php echo "<a href='" . BASEURL . "admin_index.php?plugin=user_manager&page=plugin_settings&subpage=default_settings'>" . $h->lang["user_man_default_settings"] . "</a>"; ?> 43 <?php echo "<a href='" . BASEURL . "admin_index.php?plugin=user_manager&page=plugin_settings&subpage=default_settings'>" . $h->lang["user_man_default_settings"] . "</a>"; ?> 44 <?php echo "<a href='" . BASEURL . "admin_index.php?plugin=user_manager&page=plugin_settings&subpage=add_user'>" . $h->lang["user_man_add"] . "</a>"; ?> 44 45 </p> 45 46 -
trunk/content/plugins/user_manager/templates/user_man_perms.php
r1081 r1375 35 35 <a href='<?php echo BASEURL; ?>admin_index.php?plugin=user_manager&page=plugin_settings'><?php echo $h->lang["user_man"]; ?></a> 36 36 <b><u><?php echo $h->lang["user_man_default_perms"]; ?></u></b> 37 <?php echo "<a href='" . BASEURL . "admin_index.php?plugin=user_manager&page=plugin_settings&subpage=default_settings'>" . $h->lang["user_man_default_settings"] . "</a>"; ?> 37 <?php echo "<a href='" . BASEURL . "admin_index.php?plugin=user_manager&page=plugin_settings&subpage=default_settings'>" . $h->lang["user_man_default_settings"] . "</a>"; ?> 38 <?php echo "<a href='" . BASEURL . "admin_index.php?plugin=user_manager&page=plugin_settings&subpage=add_user'>" . $h->lang["user_man_add"] . "</a>"; ?> 38 39 </p> 39 40 -
trunk/content/plugins/user_manager/templates/user_man_user_settings.php
r1081 r1375 39 39 <a href='<?php echo BASEURL; ?>admin_index.php?plugin=user_manager&page=plugin_settings'><?php echo $h->lang["user_man"]; ?></a> 40 40 <?php echo "<a href='" . BASEURL . "admin_index.php?plugin=user_manager&page=plugin_settings&subpage=default_perms'>" . $h->lang["user_man_default_perms"] . "</a>"; ?> 41 <b><u><?php echo $h->lang["user_man_default_settings"]; ?></u></b> 41 <b><u><?php echo $h->lang["user_man_default_settings"]; ?></u></b> 42 <?php echo "<a href='" . BASEURL . "admin_index.php?plugin=user_manager&page=plugin_settings&subpage=add_user'>" . $h->lang["user_man_add"] . "</a>"; ?> 42 43 </p> 43 44 -
trunk/content/plugins/user_manager/user_manager.php
r1190 r1375 3 3 * name: User Manager 4 4 * description: Manage users. 5 * version: 0. 85 * version: 0.9 6 6 * folder: user_manager 7 7 * class: UserManager -
trunk/content/plugins/user_manager/user_manager_settings.php
r1304 r1375 44 44 || ($h->cage->post->testPage('subpage') == 'default_settings')) { 45 45 $this->defaultSettings($h); 46 return true; 47 } 48 49 if (($h->cage->get->testPage('subpage') == 'add_user') 50 || ($h->cage->post->testPage('subpage') == 'add_user')) { 51 $this->addUserPage($h); 46 52 return true; 47 53 } … … 610 616 $h->displayTemplate('user_man_user_settings', 'user_manager'); 611 617 } 618 619 620 /** 621 * add User Page 622 */ 623 public function addUserPage($h) 624 { 625 switch ($h->cage->post->testAlnumLines('submitted')) 626 { 627 case 'new_user': 628 $this->createUser($h); 629 break; 630 case 'new_password': 631 $this->sendPassword($h); 632 break; 633 case 'email_validation': 634 $this->sendEmailValidationRequest($h); 635 break; 636 } 637 638 // one username for each of the three forms, otherwise they all get pre-filled 639 if (!isset($h->vars['user_man_username_1'])) { $h->vars['user_man_username_1'] = ''; } 640 if (!isset($h->vars['user_man_username_2'])) { $h->vars['user_man_username_2'] = ''; } 641 if (!isset($h->vars['user_man_username_3'])) { $h->vars['user_man_username_3'] = ''; } 642 if (!isset($h->vars['user_man_email'])) { $h->vars['user_man_email'] = ''; } 643 644 $h->displayTemplate('user_man_add'); 645 } 646 647 648 /** 649 * Create a new user 650 */ 651 public function createUser($h) 652 { 653 $error = 0; 654 655 // check username 656 $username = $h->cage->post->testUsername('username'); // alphanumeric, dashes and underscores okay, case insensitive 657 if (!$username) { 658 $h->messages[$h->lang['user_signin_register_username_error']] = 'red'; 659 $error = 1; 660 } else { 661 $h->vars['user_man_username_1'] = $username; 662 } 663 664 // check email 665 $email = $h->cage->post->testEmail('email'); 666 if (!$email) { 667 $h->messages[$h->lang['user_signin_register_email_error']] = 'red'; 668 $error = 1; 669 } else { 670 $h->vars['user_man_email'] = $email; 671 } 672 673 // process new user 674 if (!$error) { 675 $us = new UserSignin(); 676 $blocked = $us->checkBlocked($h, $username, $email); // true if blocked, false if safe 677 $exists = $h->userExists(0, $username, $email); 678 if (!$blocked && ($exists == 'no')) { 679 680 // SUCCESS!!! 681 $userAuth = new UserAuth(); 682 $userAuth->name = $username; 683 $userAuth->email = $email; 684 $userAuth->emailValid = 1; 685 $userAuth->password = random_string(10); // temporary until user is created 686 $userAuth->addUserBasic($h); 687 $last_insert_id = $h->db->get_var($h->db->prepare("SELECT LAST_INSERT_ID()")); 688 689 // send password! 690 $passconf = md5(crypt(md5($userAuth->email),md5($userAuth->email))); 691 $userAuth->newRandomPassword($h, $last_insert_id, $passconf); 692 $h->messages[$h->lang['user_man_add_success_password_sent']] = 'green'; 693 694 $user = ''; $email = ''; // clear the form. 695 696 } elseif ($exists == 'id') { 697 $h->messages[$h->lang['user_signin_register_id_exists']] = 'red'; 698 699 } elseif ($exists == 'name') { 700 $h->messages[$h->lang['user_signin_register_username_exists']] = 'red'; 701 702 } elseif ($exists == 'email') { 703 $h->messages[$h->lang['user_signin_register_email_exists']] = 'red'; 704 705 } elseif ($blocked) { 706 $h->messages[$h->lang['user_signin_register_user_blocked']] = 'red'; 707 } 708 } 709 } 710 711 712 /** 713 * Send new password 714 */ 715 public function sendPassword($h) 716 { 717 // check username 718 $username = $h->cage->post->testUsername('username'); 719 720 $userAuth = new UserAuth(); 721 $userAuth->getUserBasic($h, 0, $username); 722 if ($userAuth->id) { 723 // send password! 724 $passconf = md5(crypt(md5($userAuth->email),md5($userAuth->email))); 725 $userAuth->newRandomPassword($h, $userAuth->id, $passconf); 726 $h->messages[$h->lang['user_man_new_password_sent']] = 'green'; 727 } else { 728 $h->vars['user_man_username_2'] = $username; // to fill the username field 729 $h->messages[$h->lang['user_man_user_not_found']] = 'red'; 730 } 731 } 732 733 734 /** 735 * Send email validation request 736 */ 737 public function sendEmailValidationRequest($h) 738 { 739 // check username 740 $username = $h->cage->post->testUsername('username'); 741 $userid = $h->getUserIdFromName($username); 742 743 if ($userid) { 744 // send email validation request 745 $us = new UserSignin(); 746 $us->sendConfirmationEmail($h, $userid); 747 $h->messages[$h->lang['user_man_email_validation_request_sent']] = 'green'; 748 } else { 749 $h->vars['user_man_username_3'] = $username; // to fill the username field 750 $h->messages[$h->lang['user_man_user_not_found']] = 'red'; 751 } 752 } 612 753 } 613 754 ?> -
trunk/content/plugins/user_signin/readme.txt
r1248 r1375 15 15 Changelog 16 16 --------- 17 v.0.4 2010/03/20 - Nick - Fix for emails when using SMTP email authentication 17 18 v.0.3 2010/02/26 - Nick - New plugin hook in the registration form; mail sent through Hotaru's email function 18 19 v.0.2 2010/02/23 - Nick - Throws out killspammed, banned or suspended users when checking the cookie -
trunk/content/plugins/user_signin/user_signin.php
r1248 r1375 3 3 * name: User Signin 4 4 * description: Provides user registration and login 5 * version: 0. 35 * version: 0.4 6 6 * folder: user_signin 7 7 * type: signin … … 589 589 $body .= $h->lang['user_signin_register_emailconf_body_sign']; 590 590 $to = $user->email; 591 $headers = "From: " . SITE_EMAIL . "\r\nReply-To: " . SITE_EMAIL . "\r\nX-Priority: 3\r\n";592 591 593 592 /* … … 598 597 */ 599 598 600 $h->email($to, $subject, $body , $headers);599 $h->email($to, $subject, $body); 601 600 } 602 601 -
trunk/content/plugins/users/css/users.css
r1307 r1375 18 18 19 19 #profile_avatar { float: left; margin: 0.6em 1.0em 1.0em 0; } 20 #profile_bio { float: left; margin: 0.6em 1.0em 1.0em 0; }20 #profile_bio { float: left; margin: 0.6em 0 1.0em 0; width: 80%; } 21 21 #profile_usage { margin: 0 1.0em 1.0em 0; } -
trunk/content/plugins/users/libs/UserFunctions.php
r1305 r1375 122 122 $body .= $h->lang['userfunctions_notifymods_body_sign']; 123 123 $to = $mod['email']; 124 $headers = "From: " . SITE_EMAIL . "\r\nReply-To: " . SITE_EMAIL . "\r\nX-Priority: 3\r\n"; 125 126 $h->email($to, $subject, $body, $headers); 124 125 $h->email($to, $subject, $body); 127 126 } 128 127 -
trunk/content/plugins/users/readme.txt
r1311 r1375 14 14 Changelog 15 15 --------- 16 v.1.7 2010/03/20 - Nick - Fix for moderator email notification when using SMTP email authentication 16 17 v.1.6 2010/03/13 - Nick - Fix for missing user menu when viewing a message 17 18 v.1.5 2010/02/28 - Nick - Fix for undefined $user errors -
trunk/content/plugins/users/users.php
r1311 r1375 3 3 * name: Users 4 4 * description: Provides profile, settings and permission pages 5 * version: 1. 65 * version: 1.7 6 6 * folder: users 7 7 * type: users -
trunk/content/themes/hotaru-light/css/style.css
r1108 r1375 75 75 .red { background-color: #FF6A55; color: #ffffff; } 76 76 .bold_red { color: red; font-weight: bold; } 77 .yellow { background-color: #fbe760; } 77 78 78 79 /* SITE CLOSED MESSAGE */ … … 80 81 #site_closed { background-color: #fff; border-top: 2px solid #000; border-bottom: 2px solid #000; 81 82 text-align: center; margin-top: 4em; font-size: 1.6em; line-height: 1.8em; } 82 83 #site_closed_admin_link { font-size: 8pt; margin-top: 1.0em; } 83 84 84 85 .post_breadcrumbs_links_bar { -
trunk/content/themes/keep-it-simple/css/style.css
r1190 r1375 70 70 p, dl { padding: 10px 15px; } 71 71 72 /* SITE CLOSED MESSAGE */ 73 74 #site_closed { background-color: #fff; border-top: 2px solid #000; border-bottom: 2px solid #000; 75 text-align: center; margin-top: 4em; font-size: 1.6em; line-height: 1.8em; } 76 77 #site_closed_admin_link { font-size: 8pt; margin-top: 1.0em; } 78 72 79 /* Images */ 73 80 img { … … 748 755 } 749 756 757 .green { background-color: #99FF66; } 758 .yellow { background-color: #fbe760; } 759 .red { background-color: #FF6A55; color: #ffffff; } 760 .bold_red { color: red; font-weight: bold; } 761 750 762 /* Search Box */ 751 763 -
trunk/content/themes/shibuya/css/style.css
r1199 r1375 98 98 99 99 .green { background-color: #99FF66; } 100 .yellow { background-color: #fbe760; } 100 101 .red { background-color: #FF6A55; color: #ffffff; } 101 102 .bold_red { color: red; font-weight: bold; } … … 105 106 #site_closed { background-color: #fff; border-top: 2px solid #000; border-bottom: 2px solid #000; 106 107 text-align: center; margin-top: 4em; font-size: 1.6em; line-height: 1.8em; } 108 109 #site_closed_admin_link { font-size: 8pt; margin-top: 1.0em; } 107 110 108 111 /* BREADCRUMBS */ -
trunk/functions/funcs.arrays.php
r1081 r1375 117 117 } 118 118 119 120 /** 121 * Is serialized? 122 * 123 * @param mixed $data 124 * @return bool 125 * @link http://www.weberdev.com/get_example-4099.html 126 */ 127 function is_serialized($data) 128 { 129 if (!$data || !is_string($data)) { 130 return false; 131 } 132 133 if (preg_match("/^(i|s|a|o|d)(.*);/si",$data)) { 134 return true; 135 } 136 return false; 137 } 138 119 139 ?> -
trunk/functions/funcs.strings.php
r1108 r1375 558 558 559 559 560 if(!function_exists("iconv")) 561 { 562 /** 563 * Convert string to requested character encoding if iconv library not installed 564 * 565 * @param string $from 566 * @param string $to 567 * @param string $string 568 * @return string 569 * @link http://www.jpfox.fr/?post/2007/07/25/165-alternative-a-la-fonction-php-iconv 570 */ 571 function iconv($from, $to, $string) 572 { 573 $converted = htmlentities($string, ENT_NOQUOTES, $from); 574 $converted = html_entity_decode($converted, ENT_NOQUOTES, $to); 575 return $converted; 576 } 577 } 578 579 580 /** 581 * Count urls within a block of text 582 * 583 * @return int 584 * @link http://www.liamdelahunty.com/tips/php_url_count_check_for_comment_spam.php 585 */ 586 function countUrls($text = '') 587 { 588 //$http = substr_count($text, "http"); 589 $href = substr_count($text, "href"); 590 $url = substr_count($text, "[url"); 591 592 return $href + $url; 593 } 594 595 560 596 /** 561 597 * Strip foreign characters from latin1/utf8 database yuckiness … … 573 609 return $str; 574 610 } 575 576 577 /**578 * Count urls within a block of text579 *580 * @return int581 * @link http://www.liamdelahunty.com/tips/php_url_count_check_for_comment_spam.php582 */583 function countUrls($text = '')584 {585 //$http = substr_count($text, "http");586 $href = substr_count($text, "href");587 $url = substr_count($text, "[url");588 589 return $href + $url;590 }591 611 ?> -
trunk/htaccess_default
r1234 r1375 8 8 ## If Hotaru is installed in a subfolder, change the below line to RewriteBase /name-of-subfolder 9 9 RewriteBase / 10 ## If installed in a subfolder you may need to add ## to the beginning of the next line10 ## If installed in a subfolder or subdomain you may need to add ## to the beginning of the next line 11 11 RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /.*index\.php\ HTTP/ 12 12 13 ## Remove these two lines if you have a sub -domain like http://bookmarking.myhotarusite.com or http://localhost13 ## Remove these two lines if you have a subdomain like http://bookmarking.myhotarusite.com or http://localhost 14 14 ## Keep if your site url looks like http://www.myhotarusite.com 15 15 RewriteCond %{HTTP_HOST} !^www\. -
trunk/install/install.php
r1081 r1375 325 325 // Insert default settings 326 326 $sql = "INSERT INTO " . TABLE_USERS . " (user_username, user_role, user_date, user_password, user_email, user_permissions) VALUES (%s, %s, CURRENT_TIMESTAMP, %s, %s, %s)"; 327 $h->db->query($h->db->prepare($sql, 'admin', 'admin', 'password', 'admin@ mysite.com', serialize($h->currentUser->getDefaultPermissions($h, 'admin'))));327 $h->db->query($h->db->prepare($sql, 'admin', 'admin', 'password', 'admin@example.com', serialize($h->currentUser->getDefaultPermissions($h, 'admin')))); 328 328 $user_name = 'admin'; 329 $user_email = 'admin@ mysite.com';329 $user_email = 'admin@example.com'; 330 330 $user_password = 'password'; 331 331 } -
trunk/install/install_tables.php
r1305 r1375 343 343 $sql = "INSERT INTO " . DB_PREFIX . $table_name . " (settings_name, settings_value, settings_default, settings_note) VALUES (%s, %s, %s, %s)"; 344 344 $db->query($db->prepare($sql, 'SITE_EMAIL', 'email@example.com', 'email@example.com', 'Must be changed')); 345 346 // GMT Offset 347 $sql = "INSERT INTO " . DB_PREFIX . $table_name . " (settings_name, settings_value, settings_default, settings_note) VALUES (%s, %s, %s, %s)"; 348 $db->query($db->prepare($sql, 'SYS_FEEDBACK', 'true', 'true', 'send system report')); 345 349 346 350 // Database cache 347 351 $sql = "INSERT INTO " . DB_PREFIX . $table_name . " (settings_name, settings_value, settings_default, settings_note) VALUES (%s, %s, %s, %s)"; 348 $db->query($db->prepare($sql, 'DB_CACHE _ON', 'false', 'false', ''));352 $db->query($db->prepare($sql, 'DB_CACHE', 'false', 'false', '')); 349 353 350 354 // Database cache duration (hours) … … 354 358 // RSS cache 355 359 $sql = "INSERT INTO " . DB_PREFIX . $table_name . " (settings_name, settings_value, settings_default, settings_note) VALUES (%s, %s, %s, %s)"; 356 $db->query($db->prepare($sql, 'RSS_CACHE _ON', 'true', 'true', ''));360 $db->query($db->prepare($sql, 'RSS_CACHE', 'true', 'true', '')); 357 361 358 362 // RSS cache duration (hours) … … 362 366 // CSS/JavaScript cache 363 367 $sql = "INSERT INTO " . DB_PREFIX . $table_name . " (settings_name, settings_value, settings_default, settings_note) VALUES (%s, %s, %s, %s)"; 364 $db->query($db->prepare($sql, 'CSS_JS_CACHE _ON', 'true', 'true', ''));368 $db->query($db->prepare($sql, 'CSS_JS_CACHE', 'true', 'true', '')); 365 369 366 370 // HTML cache 367 371 $sql = "INSERT INTO " . DB_PREFIX . $table_name . " (settings_name, settings_value, settings_default, settings_note) VALUES (%s, %s, %s, %s)"; 368 $db->query($db->prepare($sql, 'HTML_CACHE _ON', 'true', 'true', ''));372 $db->query($db->prepare($sql, 'HTML_CACHE', 'true', 'true', '')); 369 373 370 374 // Debug … … 374 378 // SMTP on 375 379 $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'));380 $db->query($db->prepare($sql, 'SMTP', 'false', 'false', 'Email auth')); 377 381 378 382 // SMTP host -
trunk/install/upgrade.php
r1305 r1375 371 371 $old_version = "1.1.2"; 372 372 } 373 374 // 1.1.2 to 1.1.3 375 if ($old_version == "1.1.2") { 376 377 // System Feedback 378 $sql = "INSERT INTO " . TABLE_SETTINGS . " (settings_name, settings_value, settings_default, settings_note) VALUES (%s, %s, %s, %s)"; 379 $h->db->query($h->db->prepare($sql, 'SYS_FEEDBACK', 'true', 'true', 'send system report')); 380 381 // Remove ON from constant names 382 $sql = "UPDATE " . TABLE_SETTINGS . " SET settings_name = %s WHERE settings_name = %s"; 383 $h->db->query($h->db->prepare($sql, 'DB_CACHE', 'DB_CACHE_ON')); 384 385 $sql = "UPDATE " . TABLE_SETTINGS . " SET settings_name = %s WHERE settings_name = %s"; 386 $h->db->query($h->db->prepare($sql, 'RSS_CACHE', 'RSS_CACHE_ON')); 387 388 $sql = "UPDATE " . TABLE_SETTINGS . " SET settings_name = %s WHERE settings_name = %s"; 389 $h->db->query($h->db->prepare($sql, 'CSS_JS_CACHE', 'CSS_JS_CACHE_ON')); 390 391 $sql = "UPDATE " . TABLE_SETTINGS . " SET settings_name = %s WHERE settings_name = %s"; 392 $h->db->query($h->db->prepare($sql, 'HTML_CACHE', 'HTML_CACHE_ON')); 393 394 $sql = "UPDATE " . TABLE_SETTINGS . " SET settings_name = %s WHERE settings_name = %s"; 395 $h->db->query($h->db->prepare($sql, 'SMTP', 'SMTP_ON')); 396 397 // update "old version" for next set of upgrades 398 $old_version = "1.1.3"; 399 } 373 400 374 401 // Update Hotaru version number to the database (referred to when upgrading) -
trunk/libs/AdminPages.php
r1305 r1375 153 153 } 154 154 } 155 156 // cron hook to include SYS_FEEDBACK job 157 if ($h->cage->post->keyExists('SYS_FEEDBACK') == 'true' ) { 158 $timestamp = time(); 159 $recurrence = "daily"; 160 $hook = "cron_hotaru_feedback"; 161 $cron_data = array('timestamp'=>$timestamp, 'recurrence'=>$recurrence, 'hook'=>$hook); 162 $h->pluginHook('cron_update_job', 'cron', $cron_data); 163 } 164 else { 165 $hook = "cron_hotaru_feedback"; 166 $cron_data = array('hook'=>$hook); 167 $h->pluginHook('cron_delete_job', 'cron', $cron_data); 168 } 169 155 170 156 171 if ($error == 0) { … … 246 261 $maintenance->getSiteAnnouncement($h); 247 262 248 $h->vars['debug_files'] = $h->getFiles(CACHE . 'debug_logs'); 249 250 // if no action, return now 251 if (!$action = $h->cage->get->testAlnumLines('action')) { return false; } 263 // check if we're viewing a debug file 264 $debug_file = $h->cage->get->noPath('debug'); 265 if ($debug_file) { 266 // skip the opening die() statement and echo debug file 267 $debug_contents = file_get_contents(CACHE . 'debug_logs/' . $debug_file, NULL, NULL, 16); 268 echo nl2br($debug_contents); 269 exit; 270 } 271 272 // check if we're performing an action 273 $action = $h->cage->get->testAlnumLines('action'); 252 274 253 275 if ($action == 'announcement') { $maintenance->addSiteAnnouncement($h); } … … 270 292 if ($action == 'drop') { $h->dropTable($h->cage->get->testAlnumLines('table')); } 271 293 if ($action == 'remove_settings') { $h->removeSettings($h->cage->get->testAlnumLines('settings')); } 294 if ($action == 'system_report') { $h->generateReport(); } 295 if ($action == 'email_report') { $h->generateReport('email'); } 272 296 if ($action == 'delete_debugs') { 273 297 $h->clearCache('debug_logs'); 274 298 $h->vars['debug_files'] = $h->getFiles(CACHE . 'debug_logs'); 275 299 } 300 301 // get list of debug logs 302 $h->vars['debug_files'] = $h->getFiles(CACHE . 'debug_logs'); 276 303 } 277 304 -
trunk/libs/Caching.php
r1304 r1375 66 66 public function smartCacheHTML($h, $table = '', $timeout = 0, $html = '', $label = '') 67 67 { 68 if (!$table || !$timeout || (HTML_CACHE _ON!= 'true')) { return false; }68 if (!$table || !$timeout || (HTML_CACHE != 'true')) { return false; } 69 69 70 70 if(isset($h->vars['last_updates'][$table])) { … … 159 159 160 160 // use caching? 161 if (DB_CACHE _ON== 'true') {161 if (DB_CACHE == 'true') { 162 162 $h->db->cache_queries = true; // start using cache 163 163 } else { … … 259 259 public function cacheHTML($h, $timeout = 0, $html = '', $label = '') 260 260 { 261 if (!$timeout || (HTML_CACHE _ON!= 'true') || !$label) { return false; }261 if (!$timeout || (HTML_CACHE != 'true') || !$label) { return false; } 262 262 263 263 $cache_length = $timeout*60; // seconds -
trunk/libs/Category.php
r1234 r1375 180 180 181 181 $sql = "SELECT * FROM " . TABLE_CATEGORIES . $where . $orderBy ; 182 print $sql;182 183 183 $categories = $h->db->get_results($h->db->prepare($sql, $where_d)); 184 184 if ($categories) { return $categories; } else { return false; } -
trunk/libs/Debug.php
r1280 r1375 61 61 public function openLog($type = 'debug', $mode = 'a+') 62 62 { 63 $this->log[$type] = CACHE . "debug_logs/" . $type . ".txt"; 64 65 // auto-delete the file after 1 week: 66 /* 67 $last_modified = filemtime($this->log[$type]); 68 $expire = (7 * 24 * 60 * 60); // 1 week 69 if ($last_modified < (time() - $expire)) { unlink ($this->log[$type]); } 70 */ 71 72 // open/create a file: 73 $this->fh[$type] = fopen($this->log[$type], $mode) or die("can't open file"); 63 $this->log[$type] = CACHE . "debug_logs/" . $type . ".php"; 64 65 // delete file if over 500KB 66 if (file_exists($this->log[$type]) && (filesize($this->log[$type]) > 500000)) { 67 unlink($this->log[$type]); 68 } 69 70 // If doesn't exist or rewriting, create a new file with die() at the top 71 if (!file_exists($this->log[$type]) || ($mode != 'a' && $mode != 'a+')) { 72 $this->fh[$type] = fopen($this->log[$type], $mode) or die("Sorry, I can't open cache/debug_logs/" . $type . ".php"); 73 fwrite($this->fh[$type], "<?php die(); ?>\r\n"); 74 } else { 75 // open existing file: 76 $this->fh[$type] = fopen($this->log[$type], $mode) or die("can't open file"); 77 } 74 78 } 75 79 … … 83 87 { 84 88 if ($string) { 85 $string = date('d M Y H:i:s', time()) . " :" . $string . "\n";89 $string = date('d M Y H:i:s', time()) . " " . $string . "\n"; 86 90 fwrite($this->fh[$type], $string); 87 91 } … … 97 101 { 98 102 if (isset($this->fh[$type])) { fclose($this->fh[$type]); } 103 } 104 105 106 /** 107 * Generate a System Report 108 * 109 * @param string $type 'log', 'email' or 'object' 110 */ 111 public function generateReport($h, $type = 'log') 112 { 113 $report = $this->getSystemData($h); 114 115 if ($type == 'object') { return $report; } 116 117 if ($type == 'email') { 118 $to = "admin@hotarucms.org"; // do not change! 119 $subject = "System Report from " . SITE_NAME; 120 $body = $this->logSystemReport($h, $report); 121 $h->email($to, $subject, $body); 122 $h->message = $h->lang['admin_maintenance_system_report_emailed']; 123 $h->messageType = 'green'; 124 return true; 125 } 126 127 $h->openLog('system_report', 'w'); 128 129 // convert object to text 130 $output = $this->logSystemReport($h, $report); 131 if ($output) { 132 $h->writeLog('system_report', $output); 133 $h->closeLog('system_report'); 134 135 $h->message = $h->lang['admin_maintenance_system_report_success']; 136 $h->messageType = 'green'; 137 return true; 138 } else { 139 $h->message = $h->lang['admin_maintenance_system_report_failure']; 140 $h->messageType = 'red'; 141 return false; 142 } 143 } 144 145 /** 146 * Get system data 147 * 148 * @param string $type 'log' or 'object' 149 * @return object 150 */ 151 public function getSystemData($h) 152 { 153 // essentials: 154 155 $report['hotaru_site_name'] = SITE_NAME; 156 $report['hotaru_baseurl'] = BASEURL; 157 158 $report['php_version'] = phpversion(); 159 $report['mysql_version'] = $h->db->get_var("SELECT VERSION() AS VE"); 160 $report['hotaru_version'] = $h->version; 161 $report['php_extensions'] = get_loaded_extensions(); 162 163 $sql = "SELECT miscdata_value FROM " . TABLE_MISCDATA . " WHERE miscdata_key = %s"; 164 $report['hotaru_version_db'] = $h->db->get_var($h->db->prepare($sql, 'hotaru_version')); 165 166 // default permissions 167 168 $sql = "SELECT miscdata_value FROM " . TABLE_MISCDATA . " WHERE miscdata_key = %s"; 169 $report['hotaru_permissions'] = $h->db->get_var($h->db->prepare($sql, 'permissions')); 170 171 // default user settings 172 173 $sql = "SELECT miscdata_value FROM " . TABLE_MISCDATA . " WHERE miscdata_key = %s"; 174 $report['hotaru_user_settings'] = $h->db->get_var($h->db->prepare($sql, 'user_settings')); 175 176 // plugins: folder, enabled, version, order 177 178 $sql = "SELECT plugin_folder, plugin_enabled, plugin_version, plugin_order FROM " . TABLE_PLUGINS . " ORDER BY plugin_order"; 179 $plugins = $h->db->get_results($h->db->prepare($sql)); 180 if ($plugins) { 181 foreach ($plugins as $plugin) { 182 $report['hotaru_plugins'][$plugin->plugin_folder]['enabled'] = $plugin->plugin_enabled; 183 $report['hotaru_plugins'][$plugin->plugin_folder]['version'] = $plugin->plugin_version; 184 $report['hotaru_plugins'][$plugin->plugin_folder]['order'] = $plugin->plugin_order; 185 } 186 } 187 188 // plugin hooks: id, folder, hook name 189 190 $sql = "SELECT phook_id, plugin_folder, plugin_hook FROM " . TABLE_PLUGINHOOKS; 191 $plugins = $h->db->get_results($h->db->prepare($sql)); 192 if ($plugins) { 193 foreach ($plugins as $plugin) { 194 $report['hotaru_plugin_hooks'][$plugin->phook_id]['folder'] = $plugin->plugin_folder; 195 $report['hotaru_plugin_hooks'][$plugin->phook_id]['hook'] = $plugin->plugin_hook; 196 } 197 } 198 199 // plugin settings: folder, setting (can't use value because might include passwords) 200 201 $sql = "SELECT plugin_folder, plugin_setting, plugin_value FROM " . TABLE_PLUGINSETTINGS; 202 $plugins = $h->db->get_results($h->db->prepare($sql)); 203 if ($plugins) { 204 foreach ($plugins as $plugin) { 205 if (is_serialized($plugin->plugin_value)) { $plugin->plugin_value = unserialize($plugin->plugin_value); } 206 $report['hotaru_plugin_settings'][$plugin->plugin_folder][$plugin->plugin_setting] = $this->applyMaskToArrays($h, $plugin->plugin_value); 207 } 208 } 209 210 // Settings: Name, value (excluding SMTP PASSWORD) 211 212 $sql = "SELECT settings_name, settings_value FROM " . TABLE_SETTINGS; 213 $settings = $h->db->get_results($h->db->prepare($sql)); 214 if ($settings) { 215 foreach ($settings as $setting) { 216 // mask sensitive data 217 switch ($setting->settings_name) { 218 case 'SITE_EMAIL': 219 case 'SMTP_HOST': 220 case 'SMTP_PORT': 221 case 'SMTP_USERNAME': 222 case 'SMTP_PASSWORD': 223 $setting->settings_value = preg_replace("/[a-zA-Z0-9]/", "*", $setting->settings_value); 224 break; 225 } 226 $report['hotaru_settings'][$setting->settings_name] = $setting->settings_value; 227 } 228 } 229 230 // Widgets: plugin, function, args 231 232 $sql = "SELECT widget_plugin, widget_function, widget_args FROM " . TABLE_WIDGETS; 233 $widgets = $h->db->get_results($h->db->prepare($sql)); 234 if ($widgets) { 235 foreach ($widgets as $widget) { 236 $report['hotaru_widgets'][$widget->widget_plugin]['function'] = $widget->widget_function; 237 $report['hotaru_widgets'][$widget->widget_plugin]['args'] = $widget->widget_args; 238 } 239 } 240 241 // Counts for all tables 242 243 foreach ( $h->db->get_col("SHOW TABLES",0) as $table_name ) 244 { 245 $report['hotaru_table_count'][$table_name] = $h->db->get_var("SELECT COUNT(*) FROM " . $table_name); 246 } 247 248 return $report; 249 } 250 251 252 /** 253 * Recurse through arrays, applying * mask to all values, but not keys 254 * 255 * @param array $array 256 * @return array 257 */ 258 public function applyMaskToArrays($h, $array) 259 { 260 //echo "<pre>"; print_r($array); echo "</pre>"; exit; 261 if (!is_array($array) && !is_object($array)) { return false; } 262 263 foreach ($array as $key => $value) { 264 if (is_array($value) || is_object($value)) { 265 $array[$key] = $this->applyMaskToArrays($h, $value); 266 } else { 267 $array[$key] = preg_replace("/[a-zA-Z0-9]/", "*", $value); 268 } 269 } 270 return $array; 271 } 272 273 274 /** 275 * Convert report object to text for logging to file 276 * 277 * @param object $report 278 */ 279 public function logSystemReport($h, $report = NULL) 280 { 281 $output = "\n\n"; 282 283 $output .= "Name: " . $report['hotaru_site_name'] . "\n"; 284 $output .= "URL: " . $report['hotaru_baseurl'] . "\n"; 285 $output .= "Hotaru version: " . $report['hotaru_version'] . "\n"; 286 $output .= "Hotaru version in database: " . $report['hotaru_version_db'] . "\n"; 287 $output .= "PHP version: " . $report['php_version'] . "\n"; 288 $output .= "MySQL version: " . $report['mysql_version'] . "\n"; 289 $output .= "PHP extensions: " . implode(', ', $report['php_extensions']) . "\n"; 290 291 $output .= "\n"; 292 293 $output .= "Default site permissions: \n"; 294 $perms = unserialize($report['hotaru_permissions']); 295 unset($perms['options']); // don't need to display these 296 foreach ($perms as $key => $value) { 297 $output .= $key . " => ("; 298 foreach ($value as $k => $v) { 299 $output .= $k . ": " . $v . ", "; 300 } 301 $output = rtrim($output, ", "); 302 $output .= ")\n"; 303 } 304 305 $output .= "\n"; 306 307 $output .= "Default user settings: \n"; 308 $user_settings = unserialize($report['hotaru_user_settings']); 309 foreach ($user_settings as $key => $value) { 310 $output .= $key . " => " . $value . "\n"; 311 } 312 313 $output .= "\n"; 314 315 $output .= "Plugins: \n"; 316 if (isset($report['hotaru_plugins'])) { 317 foreach ($report['hotaru_plugins'] as $key => $value) { 318 $output .= $value['order'] . ". " . $key . " v." . $value['version'] . " "; 319 if ($value['enabled']) { $output .= "[enabled] \n"; } else { $output .= "[disabled] \n"; } 320 } 321 } 322 323 $output .= "\n"; 324 325 $output .= "Plugin Hooks: \n"; 326 if (isset($report['hotaru_plugin_hooks'])) { 327 foreach ($report['hotaru_plugin_hooks'] as $key => $value) { 328 $output .= $key . ". " . $value['folder'] . " => " . $value['hook'] . " \n"; 329 } 330 } 331 332 $output .= "\n"; 333 334 $output .= "Plugin Settings: \n"; 335 if (isset($report['hotaru_plugin_settings'])) { 336 foreach ($report['hotaru_plugin_settings'] as $key => $value) { 337 foreach ($value as $k => $v) { 338 if (!is_array($v)) { 339 $output .= "\nPlugin settings for " . $key . ":\n...." . $k . " = " . $v . " \n"; 340 } else { 341 $output .= "\nPlugin settings for " . $key . ":\n"; 342 $output = $this->outputArrays($h, $v, $output); 343 } 344 } 345 } 346 } 347 348 $output .= "\n"; 349 350 $output .= "Hotaru Settings: \n"; 351 if (isset($report['hotaru_settings'])) { 352 foreach ($report['hotaru_settings'] as $key => $value) { 353 $output .= $key . " => " . $value . " \n"; 354 } 355 } 356 357 $output .= "\n"; 358 359 $output .= "Widgets: \n"; 360 if (isset($report['hotaru_widgets'])) { 361 foreach ($report['hotaru_widgets'] as $key => $value) { 362 $output .= $key . " => " . $value['function']; 363 if ($value['args']) { $output .= " (args: " . $value['args'] . ")"; } 364 $output .= "\n"; 365 } 366 } 367 368 $output .= "\n"; 369 370 $output .= "Number of rows in each table: \n"; 371 if (isset($report['hotaru_table_count'])) { 372 foreach ($report['hotaru_table_count'] as $key => $value) { 373 $output .= $key . " => " . $value . " \n"; 374 } 375 } 376 377 return $output; 378 } 379 380 381 /** 382 * Recurse through arrays, adding them to $output for display 383 * 384 * @param array $array 385 * @return array 386 */ 387 public function outputArrays($h, $array = array(), $output = '') 388 { 389 if (!is_array($array) && !is_object($array)) { return $output; } 390 391 foreach ($array as $key => $value) { 392 if (is_array($value) || is_object($array)) { 393 $output .= "..... " . $key . ":\n"; 394 $output = $this->outputArrays($h, $value, $output); 395 } else { 396 $output .= "..... " . $key . ": " . $value . " \n"; 397 } 398 } 399 return $output; 99 400 } 100 401 } -
trunk/libs/EmailFunctions.php
r1305 r1375 64 64 if (!$this->from) { $this->from = SITE_NAME . ' <' . SITE_EMAIL . '>'; } 65 65 66 if (SMTP _ON== 'true') {66 if (SMTP == 'true') { 67 67 // note: this overwrites headers passed to this function: 68 $this->headers = array ('From' => $this->from, 'To' => $this->to, 'Subject' => $this->subject); 68 if (is_array($this->to)) { $to = $this->to['To']; } else { $to = $this->to; } 69 $this->headers = array ('From' => $this->from, 'To' => $to, 'Subject' => $this->subject); 69 70 } else { 70 71 // if not using SMTP and no headers passed to this function, use default … … 96 97 break; 97 98 default: 98 if (SMTP _ON== 'true') {99 if (SMTP == 'true') { 99 100 $this->doSmtpEmail(); 100 101 } else { … … 127 128 128 129 $mail = $this->smtp->send($this->to, $this->headers, $this->body); 129 130 130 131 131 if (PEAR::isError($mail)) { -
trunk/libs/Feeds.php
r1305 r1375 35 35 * @return object|false $sp 36 36 */ 37 public function newSimplePie($feed='', $cache=RSS_CACHE _ON, $cache_duration=RSS_CACHE_DURATION)37 public function newSimplePie($feed='', $cache=RSS_CACHE, $cache_duration=RSS_CACHE_DURATION) 38 38 { 39 39 include_once(EXTENSIONS . "SimplePie/simplepie.inc"); -
trunk/libs/IncludeCssJs.php
r1280 r1375 273 273 274 274 // get code from archive folder if it exists, otherwise grab latest files, merge and save in archive folder 275 if ((CSS_JS_CACHE _ON== "true") && file_exists($cache . $prefix . $type . '_' . $iETag . '.cache')) {275 if ((CSS_JS_CACHE == "true") && file_exists($cache . $prefix . $type . '_' . $iETag . '.cache')) { 276 276 $sCode = file_get_contents($cache . $prefix . $type . '_' . $iETag . '.cache'); 277 277 } else { -
trunk/libs/Initialize.php
r1234 r1375 86 86 error_reporting(E_ALL); 87 87 88 // log errors to a file - the custom error handler below wasn't catching fatal errors, so using PHP's one 89 ini_set('error_log', CACHE . 'debug_logs/error_log.txt'); 90 /* 91 require_once(EXTENSIONS . 'SWCMS/swcms_error_handler.php'); // error_handler class 92 $error_handler = new swcms_error_handler(0, 0, 1, NULL, CACHE . 'debug_logs/error_log.txt'); 93 set_error_handler(array($error_handler, "handler")); 94 */ 88 // error log filename 89 $filename = CACHE . 'debug_logs/error_log.php'; 90 91 // delete file if over 500KB 92 if (file_exists($filename) && (filesize($filename) > 500000)) { 93 unlink($filename); 94 } 95 96 // If doesn't exist, create a new file with die() at the top 97 if (!file_exists($filename)) { 98 $fh = fopen($filename, 'w') or die("Sorry, I can't open cache/debug_logs/error_log.php"); 99 fwrite($fh, "<?php die(); ?>\r\n"); 100 fclose($fh); 101 } 102 103 // point PHP to our error log 104 ini_set('error_log', $filename); 95 105 } 96 106 … … 214 224 $this->db->cache_timeout = DB_CACHE_DURATION; // Note: this is hours 215 225 $this->db->cache_dir = CACHE . 'db_cache'; 216 if (DB_CACHE _ON== "true") {226 if (DB_CACHE == "true") { 217 227 $this->db->use_disk_cache = true; 218 228 return true; … … 236 246 timer_start(); 237 247 ini_set('display_errors', 1); // show errors 238 ini_set('error_log', CACHE . 'debug_logs/error_log.txt');239 248 return true; 240 249 } else { -
trunk/libs/Language.php
r1081 r1375 101 101 public function includeThemeLanguage($h, $filename = 'main') 102 102 { 103 // Look in the current theme a language file... 103 if ($filename == 'admin') { 104 $this->includeAdminLanguage($h); 105 return true; 106 } 107 108 // Look in the current theme for a language file... 104 109 if (file_exists(THEMES . THEME . 'languages/' . $filename . '_language.php')) { 105 110 include_once(THEMES . THEME . 'languages/' . $filename . '_language.php'); … … 113 118 } 114 119 } 120 121 122 /** 123 * Include admin_language.php 124 * 125 * Hotaru has already got the base admin_language.php file from /content, but 126 * all or parts of it can be overidden. 127 * 128 * First Hotaru looks for admin_languages.php in the admin theme's "languages" folder 129 * Second, it looks for admin_languages.php in the user theme's "languages" folder. 130 * All files are merged with priority in this order: user theme, admin theme, content/admin_language.php 131 */ 132 public function includeAdminLanguage($h) 133 { 134 // 1. We already have admin_language.php from content/admin_language.php 135 136 // 2. Merge in anything from admin_language.php in admin theme languages folder 137 138 if (file_exists(ADMIN_THEMES . ADMIN_THEME . 'languages/admin_language.php')) { 139 include_once(ADMIN_THEMES . ADMIN_THEME . 'languages/admin_language.php'); 140 // Add new language to our lang property 141 if (isset($lang)) { 142 foreach($lang as $l => $text) { 143 $h->lang[$l] = $text; 144 } 145 } 146 } 147 148 // 2. Merge in anything from admin_language.php in user theme languages folder 149 150 if (file_exists(THEMES . THEME . 'languages/admin_language.php')) { 151 include_once(THEMES . THEME . 'languages/admin_language.php'); 152 // Add new language to our lang property 153 if (isset($lang)) { 154 foreach($lang as $l => $text) { 155 $h->lang[$l] = $text; 156 } 157 } 158 } 159 } 115 160 } 116 161 ?> -
trunk/libs/Maintenance.php
r1304 r1375 26 26 class Maintenance 27 27 { 28 /** 29 * System Report is in libs/Debug.php 30 */ 31 32 28 33 /** 29 34 * Calls the delete_files function, then displays a message. -
trunk/libs/Post.php
r1108 r1375 160 160 $this->vars['last_insert_id'] = $last_insert_id; // make it available outside this class 161 161 162 // Update post_date field if $this->date has been declared 163 // Normally used when scheduling or auto-submitting posts 164 if ($this->date) { 165 $date = date('YmdHis', $this->date); 166 $sql = "UPDATE " . TABLE_POSTS . " SET post_date = %s WHERE post_id = %d"; 167 $h->db->query($h->db->prepare($sql, $date, $last_insert_id)); 168 } 169 162 170 // Add tags to the Tags table: 163 171 require_once(LIBS . 'Tags.php'); -
trunk/libs/UserAuth.php
r1234 r1375 282 282 $error = 1; 283 283 } 284 284 285 285 $username_check = $h->cage->post->testUsername('username'); // alphanumeric, dashes and underscores okay, case insensitive 286 286 if (!$username_check) { 287 287 $h->messages[$h->lang['main_user_account_update_username_error']] = 'red'; 288 288 $error = 1; 289 } elseif($h->nameExists($username_check, '', $viewee->id) ) {289 } elseif($h->nameExists($username_check, '', $viewee->id) || $h->isBlocked('user', $username_check)) { 290 290 $h->messages[$h->lang['main_user_account_update_username_exists']] = 'red'; 291 291 $error = 1; … … 299 299 $h->messages[$h->lang['main_user_account_update_email_error']] = 'red'; 300 300 $error = 1; 301 } elseif($h->emailExists($email_check, '', $viewee->id) ) {301 } elseif($h->emailExists($email_check, '', $viewee->id) || $h->isBlocked('email', $email_check)) { 302 302 $h->messages[$h->lang['main_user_account_update_email_exists']] = 'red'; 303 303 $error = 1; … … 490 490 $body .= $h->lang['main_user_email_password_conf_body_sign']; 491 491 $to = $email; 492 $headers = "From: " . SITE_EMAIL . "\r\nReply-To: " . SITE_EMAIL . "\r\nX-Priority: 3\r\n"; 493 494 mail($to, $subject, $body, $headers); 492 493 $h->email($to, $subject, $body); 495 494 496 495 return true; … … 544 543 $body .= $h->lang['main_user_email_password_conf_body_sign']; 545 544 $to = $email; 546 $headers = "From: " . SITE_EMAIL . "\r\nReply-To: " . SITE_EMAIL . "\r\nX-Priority: 3\r\n"; 547 548 mail($to, $subject, $body, $headers); 545 546 $h->email($to, $subject, $body); 549 547 550 548 return true;
Note: See TracChangeset
for help on using the changeset viewer.