Changeset 1509 in ExiteCMS
- Timestamp:
- 07/02/08 18:27:06 (4 years ago)
- Location:
- branches/PLi-Fusion
- Files:
-
- 1 deleted
- 68 edited
- 1 copied
-
404handler.php (modified) (1 diff)
-
administration/forums.php (modified) (3 diffs)
-
administration/modules.php (modified) (7 diffs)
-
administration/settings_forum.php (modified) (1 diff)
-
administration/settings_misc.php (modified) (2 diffs)
-
administration/site_links.php (modified) (4 diffs)
-
administration/tools/language_pack_English.php (modified) (21 diffs)
-
administration/tools/update_geoip_database.php (modified) (3 diffs)
-
administration/upgrade.php (modified) (1 diff)
-
administration/upgrade/rev00730.php (modified) (1 diff)
-
administration/upgrade/rev00740.php (modified) (5 diffs)
-
administration/upgrade/rev00760.php (modified) (1 diff)
-
administration/upgrade/rev00780.php (modified) (1 diff)
-
administration/upgrade/rev00800.php (modified) (1 diff)
-
administration/upgrade/rev00850.php (modified) (1 diff)
-
administration/upgrade/rev00858.php (modified) (1 diff)
-
administration/upgrade/rev00909.php (modified) (1 diff)
-
administration/upgrade/rev00954.php (modified) (1 diff)
-
administration/upgrade/rev01060.php (modified) (1 diff)
-
administration/upgrade/rev01070.php (modified) (1 diff)
-
administration/upgrade/rev01091.php (modified) (1 diff)
-
administration/upgrade/rev01190.php (modified) (1 diff)
-
administration/upgrade/rev01193.php (modified) (1 diff)
-
administration/upgrade/rev01201.php (modified) (1 diff)
-
administration/upgrade/rev01214.php (modified) (1 diff)
-
administration/upgrade/rev01280.php (modified) (1 diff)
-
blogs.php (modified) (2 diffs)
-
config.def (deleted)
-
contact.php (modified) (2 diffs)
-
downloads.php (modified) (4 diffs)
-
edit_profile.php (modified) (1 diff)
-
feeds.php (modified) (1 diff)
-
files/locales/en.main.global.php (modified) (1 diff)
-
files/locales/en.main.setup.php (modified) (1 diff)
-
forum/index.php (modified) (3 diffs)
-
forum/post.php (modified) (6 diffs)
-
forum/viewforum.php (modified) (7 diffs)
-
forum/viewthread.php (modified) (10 diffs)
-
getfile.php (modified) (5 diffs)
-
images/cms-logo-big.png (modified) (previous)
-
images/cms-logo-small.png (modified) (previous)
-
includes/core_functions.php (modified) (14 diffs)
-
includes/db_functions.php (modified) (8 diffs)
-
includes/dbsetup_include.php (modified) (51 diffs)
-
includes/dns_functions.php (modified) (1 diff)
-
includes/forum_functions_include.php (modified) (2 diffs)
-
includes/geoip_include.php (modified) (3 diffs)
-
includes/jscripts/tiny_mce/plugins/save/images/cancel.gif (copied) (copied from trunk/includes/jscripts/tiny_mce/plugins/save/images/cancel.gif)
-
includes/photo_functions_include.php (modified) (2 diffs)
-
includes/smtp_include.php (modified) (1 diff)
-
includes/template-plugins/function.displaysmileys.php (modified) (1 diff)
-
includes/templates/_query_debug.tpl (modified) (2 diffs)
-
includes/templates/admin.forums.tpl (modified) (1 diff)
-
includes/templates/admin.modules.tpl (modified) (4 diffs)
-
includes/templates/admin.news.tpl (modified) (21 diffs)
-
includes/templates/admin.settings_forum.tpl (modified) (1 diff)
-
includes/templates/admin.settings_misc.tpl (modified) (2 diffs)
-
includes/templates/admin.tools.tpl (modified) (1 diff)
-
includes/templates/forum.index.tpl (modified) (2 diffs)
-
includes/templates/forum.post.tpl (modified) (2 diffs)
-
includes/templates/forum.renderpost.tpl (modified) (1 diff)
-
includes/templates/forum.resultdialog.tpl (modified) (1 diff)
-
includes/templates/main.downloads.tpl (modified) (2 diffs)
-
includes/templates/main.register.tpl (modified) (1 diff)
-
includes/theme_functions.php (modified) (2 diffs)
-
includes/user_functions.php (modified) (3 diffs)
-
profile.php (modified) (2 diffs)
-
register.php (modified) (2 diffs)
-
setup.php (modified) (7 diffs)
-
setuser.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/PLi-Fusion/404handler.php
r1192 r1509 109 109 break; 110 110 } else { 111 die("<div style='font-family:Verdana;text-align:center;'><font size=6>404 - PAGE NOT FOUND</font></br /></br /><b>And the '404 page not found' page can not be loaded from the database...</b></div>");111 terminate("<font size=6>404 - PAGE NOT FOUND</font></br /></br /><b>And the '404 page not found' page can not be loaded from the database...</b>"); 112 112 } 113 113 } -
branches/PLi-Fusion/administration/forums.php
r1408 r1509 194 194 if ($cat_name != "") { 195 195 $cat_order = isNum($_POST['cat_order']) ? $_POST['cat_order'] : ""; 196 if(!$cat_order) $cat_order=db result(dbquery("SELECT MAX(forum_order) FROM ".$db_prefix."forums WHERE forum_cat='0'"),0)+1;196 if(!$cat_order) $cat_order=dbfunction("MAX(forum_order)", "forums", "forum_cat='0'")+1; 197 197 $result = dbquery("UPDATE ".$db_prefix."forums SET forum_order=forum_order+1 WHERE forum_cat='0' AND forum_order>='$cat_order'"); 198 198 $result = dbquery("INSERT INTO ".$db_prefix."forums (forum_cat, forum_name, forum_order, forum_description, forum_moderators, forum_access, forum_posting, forum_lastpost, forum_lastuser) VALUES ('0', '$cat_name', '$cat_order', '', '', '0', '0', '0', '0')"); … … 222 222 SELECT DISTINCT u.user_id, u.user_level, u.user_groups 223 223 FROM ".$db_prefix."threads_read tr 224 LEFTJOIN ".$db_prefix."users u ON u.user_id = tr.user_id224 INNER JOIN ".$db_prefix."users u ON u.user_id = tr.user_id 225 225 WHERE tr.thread_id = '".$thread_id."' 226 226 "); … … 241 241 $forum_mods = ""; 242 242 $forum_order = isNum($_POST['forum_order']) ? $_POST['forum_order'] : ""; 243 if(!$forum_order) $forum_order=db result(dbquery("SELECT MAX(forum_order) FROM ".$db_prefix."forums WHERE forum_cat='$forum_cat'"),0)+1;243 if(!$forum_order) $forum_order=dbfunction("MAX(forum_order)", "forums", "forum_cat='$forum_cat'")+1; 244 244 $result = dbquery("UPDATE ".$db_prefix."forums SET forum_order=forum_order+1 WHERE forum_cat='$forum_cat' AND forum_order>='$forum_order'"); 245 245 $result = dbquery("INSERT INTO ".$db_prefix."forums (forum_cat, forum_name, forum_order, forum_description, forum_moderators, forum_access, forum_posting, forum_modgroup, forum_attach, forum_attachtypes, forum_rulespage, forum_banners, forum_lastpost, forum_lastuser) VALUES ('$forum_cat', '$forum_name', '$forum_order', '$forum_description', '$forum_mods', '$forum_access', '$forum_posting', '$forum_modgroup', '$forum_attach', '$forum_attachtypes', '$forum_rulespage', '$forum_banners', '0', '0')"); -
branches/PLi-Fusion/administration/modules.php
r1335 r1509 110 110 111 111 // determine the next order in the menu for this link 112 $link_order = db result(dbquery("SELECT MAX(link_order) FROM ".$db_prefix."site_links WHERE panel_name = '$link_panel'"),0) + 1;112 $link_order = dbfunction("MAX(link_order)", "site_links", "panel_name = '$link_panel'") + 1; 113 113 114 114 // add the new link … … 171 171 // register the installation of this module 172 172 $result = dbquery("INSERT INTO ".$db_prefix."modules (mod_title, mod_folder, mod_version) VALUES ('$mod_title', '$mod_folder', '$mod_version')"); 173 // save the key, we might need it later 174 $mod_id = mysql_insert_id(); 175 176 // if a module is installed, and if reports are defined, install the report links for this module 177 if ($mod_id && isset($mod_report_links) && is_array($mod_report_links) && count($mod_report_links)) { 178 179 // loop through the defined reports 180 foreach ($mod_report_links as $mod_report) { 181 182 // check if the code exists for this report 183 if (isset($mod_report['name']) && file_exists(PATH_MODULES.$mod_folder."/report.".$mod_report['name'].".php")) { 184 // check if the template exists for this report 185 if (file_exists(PATH_MODULES.$mod_folder."/templates/modules.".$mod_folder.".report.".$mod_report['name'].".tpl")) { 186 // verify the other fields 187 $mod_report['visibility'] = (isset($mod_report['visibility']) && isNum($mod_report['visibility']) ? $mod_report['visibility'] : 103); 188 $mod_report['title'] = isset($mod_report['title']) ? $mod_report['title'] : ("Report: ".$mod_report['name']); 189 $mod_report['version'] = isset($mod_report['version']) ? $mod_report['version'] : $mod_version; 190 // add it to the report table 191 $result = dbquery("INSERT INTO ".$db_prefix."reports (report_mod_id, report_name, report_title, report_version, report_visibility) 192 VALUES ('".$mod_id."', '".$mod_report['name']."', '".$mod_report['title']."', '".$mod_report['version']."', '".$mod_report['visibility']."')"); 193 } 194 } 195 } 196 } 197 198 // if a module is installed, and if searches are defined, install the search links for this module 199 if ($mod_id && isset($mod_search_links) && is_array($mod_search_links) && count($mod_search_links)) { 200 201 // loop through the defined reports 202 foreach ($mod_search_links as $mod_search) { 203 204 // check if the code exists for this search 205 if (isset($mod_search['name']) && file_exists(PATH_MODULES.$mod_folder."/search.".$mod_search['name'].".php")) { 206 // check if the template exists for this search 207 if (file_exists(PATH_MODULES.$mod_folder."/templates/modules.".$mod_folder.".search.".$mod_search['name'].".tpl")) { 208 // verify the other fields 209 $mod_search['visibility'] = (isset($mod_search['visibility']) && isNum($mod_search['visibility']) ? $mod_search['visibility'] : 103); 210 $mod_search['title'] = isset($mod_search['title']) ? $mod_search['title'] : ("Search: ".$mod_search['name']); 211 $mod_search['version'] = isset($mod_search['version']) ? $mod_search['version'] : $mod_version; 212 // add it to the search table 213 $result = dbquery("INSERT INTO ".$db_prefix."searches (search_mod_id, search_name, search_title, search_version, search_visibility) 214 VALUES ('".$mod_id."', '".$mod_search['name']."', '".$mod_search['title']."', '".$mod_search['version']."', '".$mod_search['visibility']."')"); 215 } 216 } 217 } 218 } 173 219 174 220 // update the access rights of the site administrators to include this new module … … 303 349 // remove the module from the installed modules list 304 350 $result = dbquery("DELETE FROM ".$db_prefix."modules WHERE mod_id='$id'"); 351 352 // remove any reports associated with this module 353 $result = dbquery("DELETE FROM ".$db_prefix."reports WHERE report_mod_id='$id'"); 354 355 // remove any searches associated with this module 356 $result = dbquery("DELETE FROM ".$db_prefix."searches WHERE search_mod_id='$id'"); 357 } 358 359 if ($action == 'locales' && isset($id)) { 360 361 // make sure the ID passed is numeric 362 if (!isNum($id)) fallback(FUSION_SELF.$aidlink); 363 364 // check if it exists 365 $result = dbquery("SELECT * FROM ".$db_prefix."modules WHERE mod_id='$id'"); 366 if (!$result) fallback(FUSION_SELF.$aidlink); 367 368 // get the module data 369 $data = dbarray($result); 370 371 // load the module installer to start the upgrade 372 include PATH_MODULES.$data['mod_folder']."/module_installer.php"; 373 374 // if locale strings are defined, load them into the database 375 if (isset($localestrings) && is_array($localestrings)) { 376 foreach($localestrings as $locales_code => $locales_strings) { 377 load_localestrings($locales_strings, $locales_code, "modules.".$mod_folder); 378 } 379 } 380 305 381 } 306 382 … … 393 469 if (dbrows($result) == 0) { 394 470 // determine the next order in the menu for this link 395 $link_order = db result(dbquery("SELECT MAX(link_order) FROM ".$db_prefix."site_links WHERE panel_name = '$link_panel'"),0) + 1;471 $link_order = dbfunction("MAX(link_order)", "site_links", "panel_name = '$link_panel'") + 1; 396 472 397 473 // add the new link … … 419 495 foreach($localestrings as $locales_code => $locales_strings) { 420 496 load_localestrings($locales_strings, $locales_code, "modules.".$mod_folder); 497 } 498 } 499 500 // remove any reports associated with this module 501 $result = dbquery("DELETE FROM ".$db_prefix."reports WHERE report_mod_id='$id'"); 502 503 // if a module is installed, and if reports are defined, (re)install the report links for this module 504 if (isset($mod_report_links) && is_array($mod_report_links) && count($mod_report_links)) { 505 506 // loop through the defined reports 507 foreach ($mod_report_links as $mod_report) { 508 509 // check if the code exists for this report 510 if (isset($mod_report['name']) && file_exists(PATH_MODULES.$mod_folder."/report.".$mod_report['name'].".php")) { 511 // check if the template exists for this report 512 if (file_exists(PATH_MODULES.$mod_folder."/templates/modules.".$mod_folder.".report.".$mod_report['name'].".tpl")) { 513 // verify the other fields 514 $mod_report['visibility'] = (isset($mod_report['visibility']) && isNum($mod_report['visibility']) ? $mod_report['visibility'] : 103); 515 $mod_report['title'] = isset($mod_report['title']) ? $mod_report['title'] : ("Report: ".$mod_report['name']); 516 $mod_report['version'] = isset($mod_report['version']) ? $mod_report['version'] : $mod_version; 517 // add it to the report table 518 $result = dbquery("INSERT INTO ".$db_prefix."reports (report_mod_id, report_name, report_title, report_version, report_visibility) 519 VALUES ('".$id."', '".$mod_report['name']."', '".$mod_report['title']."', '".$mod_report['version']."', '".$mod_report['visibility']."')"); 520 } 521 } 522 } 523 524 } 525 526 // remove any searches associated with this module 527 $result = dbquery("DELETE FROM ".$db_prefix."searches WHERE search_mod_id='$id'"); 528 529 // if a module is installed, and if searches are defined, install the search links for this module 530 if (isset($mod_search_links) && is_array($mod_search_links) && count($mod_search_links)) { 531 532 // loop through the defined reports 533 foreach ($mod_search_links as $mod_search) { 534 535 // check if the code exists for this search 536 if (isset($mod_search['name']) && file_exists(PATH_MODULES.$mod_folder."/search.".$mod_search['name'].".php")) { 537 // check if the template exists for this search 538 if (file_exists(PATH_MODULES.$mod_folder."/templates/modules.".$mod_folder.".search.".$mod_search['name'].".tpl")) { 539 // verify the other fields 540 $mod_search['visibility'] = (isset($mod_search['visibility']) && isNum($mod_search['visibility']) ? $mod_search['visibility'] : 103); 541 $mod_search['title'] = isset($mod_search['title']) ? $mod_search['title'] : ("Search: ".$mod_search['name']); 542 $mod_search['version'] = isset($mod_search['version']) ? $mod_search['version'] : $mod_version; 543 // add it to the search table 544 $result = dbquery("INSERT INTO ".$db_prefix."searches (search_mod_id, search_name, search_title, search_version, search_visibility) 545 VALUES ('".$id."', '".$mod_search['name']."', '".$mod_search['title']."', '".$mod_search['version']."', '".$mod_search['visibility']."')"); 546 } 547 } 421 548 } 422 549 } … … 452 579 $mod_check = (isset($mod_title) && $mod_title != ""); 453 580 $mod_check = $mod_check && (isset($mod_version) && $mod_version!= ""); 454 $mod_check = $mod_check && (isset($mod_developer) && $mod_developer!= "");455 $mod_check = $mod_check && (isset($mod_email) && $mod_email!= "");456 581 if (!$mod_check) { 457 582 $mod_errors .= $locale['mod004']; … … 460 585 $this_module['description'] = isset($mod_description) ? $mod_description : ""; 461 586 $this_module['version'] = $mod_version; 462 $this_module['developer'] = $mod_developer;463 $this_module['email'] = $mod_email;587 $this_module['developer'] = isset($mod_developer) ? $mod_developer : ""; 588 $this_module['email'] = isset($mod_email) ? $mod_email : ""; 464 589 $this_module['url'] = isset($mod_weburl) ? $mod_weburl : ""; 465 590 $this_module['type'] = isset($mod_type) ? $mod_type : "M"; -
branches/PLi-Fusion/administration/settings_forum.php
r1227 r1509 38 38 $result = dbquery("UPDATE ".$db_prefix."configuration SET cfg_value = '".(isNum($_POST['thread_notify']) ? $_POST['thread_notify'] : "0")."' WHERE cfg_name = 'thread_notify'"); 39 39 $result = dbquery("UPDATE ".$db_prefix."configuration SET cfg_value = '".(isNum($_POST['unread_threshold']) ? $_POST['unread_threshold'] : "0")."' WHERE cfg_name = 'unread_threshold'"); 40 $result = dbquery("UPDATE ".$db_prefix."configuration SET cfg_value = '".(isNum($_POST['forum_edit_timeout']) ? $_POST['forum_edit_timeout'] : "0")."' WHERE cfg_name = 'forum_edit_timeout'"); 40 41 } 41 42 -
branches/PLi-Fusion/administration/settings_misc.php
r1227 r1509 37 37 $result = dbquery("UPDATE ".$db_prefix."configuration SET cfg_value = '".stripinput($_POST['bad_word_replace'])."' WHERE cfg_name = 'bad_words_replace'"); 38 38 $result = dbquery("UPDATE ".$db_prefix."configuration SET cfg_value = '".(isNum($_POST['guestposts']) ? $_POST['guestposts'] : "0")."' WHERE cfg_name = 'guestposts'"); 39 $result = dbquery("UPDATE ".$db_prefix."configuration SET cfg_value = '".(isNum($_POST['remote_stats']) ? $_POST['remote_stats'] : "0")."' WHERE cfg_name = 'remote_stats'");40 39 $result = dbquery("UPDATE ".$db_prefix."configuration SET cfg_value = '".(isNum($_POST['numofshouts']) ? $_POST['numofshouts'] : "10")."' WHERE cfg_name = 'numofshouts'"); 41 40 $result = dbquery("UPDATE ".$db_prefix."configuration SET cfg_value = '".(isNum($_POST['flood_interval']) ? $_POST['flood_interval'] : "15")."' WHERE cfg_name = 'flood_interval'"); … … 45 44 $result = dbquery("UPDATE ".$db_prefix."configuration SET cfg_value = '".stripinput($_POST['maintenance_color'])."' WHERE cfg_name = 'maintenance_color'"); 46 45 $result = dbquery("UPDATE ".$db_prefix."configuration SET cfg_value = '".stripinput($_POST['debug_querylog'])."' WHERE cfg_name = 'debug_querylog'"); 46 $result = dbquery("UPDATE ".$db_prefix."configuration SET cfg_value = '".(isNum($_POST['debug_sql_explain']) ? $_POST['debug_sql_explain'] : "0")."' WHERE cfg_name = 'debug_sql_explain'"); 47 47 } 48 48 -
branches/PLi-Fusion/administration/site_links.php
r1335 r1509 128 128 +----------------------------------------------------*/ 129 129 130 // display a status panel 131 if (isset($status)) { 132 if ($status == "del") { 133 $variables['message'] = $locale['401']; 134 } else { 135 $variables['message'] = "UNKNOWN STATUS PASSED!"; 136 } 137 // define the message panel variables 138 $variables['bold'] = true; 139 $template_panels[] = array('type' => 'body', 'name' => 'admin.site_links.status', 'title' => $locale['400'], 'template' => '_message_table_panel.tpl'); 140 $template_variables['admin.site_links.status'] = $variables; 141 $variables = array(); 142 } 143 130 144 // generate the list of installed menu panels 131 145 $variables['panel_list'] = array(); … … 137 151 } 138 152 sort($variables['panel_list']); 139 140 // display a status panel141 if (isset($status)) {142 if ($status == "del") {143 $variables['message'] = $locale['401'];144 } else {145 $variables['message'] = "UNKNOWN STATUS PASSED!";146 }147 // define the message panel variables148 $variables['bold'] = true;149 $template_panels[] = array('type' => 'body', 'name' => 'admin.site_links.status', 'title' => $locale['400'], 'template' => '_message_table_panel.tpl');150 $template_variables['admin.site_links.status'] = $variables;151 $variables = array();152 }153 153 154 154 // default panel title … … 209 209 // if the parent has changed, calculate a new link order 210 210 if ($data['link_parent'] != $link_parent) { 211 $link_order = db result(dbquery("SELECT MAX(link_order) FROM ".$db_prefix."site_links WHERE panel_name = '$panel_filename' AND link_parent='$link_parent'".($where==""?"":(" AND ".$where)).""),0)+1;211 $link_order = dbfunction("MAX(link_order)", "site_links", "panel_name = '$panel_filename' AND link_parent='$link_parent'".($where==""?"":(" AND ".$where))."")+1; 212 212 } else { 213 213 // link changed? … … 222 222 // get a linkorder if none given 223 223 if (!$link_order) { 224 $link_order = db result(dbquery("SELECT MAX(link_order) FROM ".$db_prefix."site_links WHERE panel_name = '$panel_filename' AND link_parent='$link_parent'".($where==""?"":(" AND ".$where)).""),0)+1;224 $link_order = dbfunction("MAX(link_order)","site_links","panel_name = '$panel_filename' AND link_parent='$link_parent'".($where==""?"":(" AND ".$where))."")+1; 225 225 } 226 226 $result = dbquery("UPDATE ".$db_prefix."site_links SET link_order=link_order+1 WHERE panel_name = '$panel_filename' AND link_parent='$link_parent' AND link_order >= '$link_order'".($where==""?"":(" AND ".$where)).""); -
branches/PLi-Fusion/administration/tools/language_pack_English.php
r1408 r1509 491 491 $localestrings['236'] = "Language Settings"; 492 492 $localestrings['237'] = "Webmaster Toolbox for"; 493 $localestrings['238'] = "Forum Ranking"; 493 494 $localestrings['250'] = "Website Statistics"; 494 495 $localestrings['251'] = "Registered Members:"; … … 496 497 $localestrings['253'] = "Suspended Members:"; 497 498 $localestrings['255'] = "Deleted Members:"; 498 $localestrings['256'] = " x";499 $localestrings['256'] = "Reports"; 499 500 $localestrings['257'] = "Comments:"; 500 501 $localestrings['258'] = "Shoutbox Posts:"; 501 502 $localestrings['259'] = "Forum Posts:"; 502 $localestrings['260'] = " x";503 $localestrings['260'] = "Searches"; 503 504 $localestrings['261'] = "x"; 504 505 $localestrings['262'] = "Unread Posts:"; … … 600 601 $localestrings['424'] = "There are no modules and plugins available for installation"; 601 602 $localestrings['425'] = "There are no modules and plugins available that match your filter"; 603 $localestrings['426'] = "Refresh the locale strings"; 602 604 $localestrings['mod001'] = "This module requires at least version %s of ExiteCMS.<br />"; 603 605 $localestrings['mod002'] = "This module is written for version %s of ExiteCMS. Please ask the author for an upgrade.<br />"; … … 787 789 788 790 $localestrings = array(); 791 $localestrings['400'] = "Forum Rankings"; 792 $localestrings['401'] = "Add a new ranking"; 793 $localestrings['402'] = "Edit a ranking"; 794 $localestrings['408'] = "There are no forum rankings defined"; 795 $localestrings['409'] = "Note: The rankings are processed in the order shown here. Comparison stops at the first hit. If you use group membership filtering, and you have duplicate post ranges, make sure that the order is correct!"; 796 $localestrings['411'] = "Posts range"; 797 $localestrings['412'] = "Rank title"; 798 $localestrings['413'] = "Rank image"; 799 $localestrings['414'] = "Only for members of"; 800 $localestrings['415'] = "Order"; 801 $localestrings['416'] = "Options"; 802 $localestrings['417'] = "Move this rank up"; 803 $localestrings['418'] = "Move this rank down"; 804 $localestrings['419'] = "Edit this rank"; 805 $localestrings['420'] = "Delete this rank"; 806 $localestrings['421'] = "Posts selection range:"; 807 $localestrings['422'] = "From"; 808 $localestrings['423'] = "To"; 809 $localestrings['424'] = "Posts"; 810 $localestrings['425'] = "Rank title:"; 811 $localestrings['426'] = "Rank image:"; 812 $localestrings['427'] = "- none -"; 813 $localestrings['428'] = "Repeat this image:"; 814 $localestrings['429'] = "Times"; 815 $localestrings['430'] = "Available groups:"; 816 $localestrings['431'] = "Selected groups:"; 817 $localestrings['432'] = "Save this ranking"; 818 $localestrings['433'] = "Apply this ranking to the following user groups only:"; 819 $localestrings['434'] = "Rank order:"; 820 $localestrings['435'] = "Rank group comparison using:"; 821 $localestrings['436'] = " and "; 822 $localestrings['437'] = " or "; 823 $localestrings['438'] = "Rank title color:"; 824 $localestrings['439'] = "Show title as tooltip:"; 825 $localestrings['440'] = "No"; 826 $localestrings['441'] = "Yes"; 827 $localestrings['490'] = "The Post selection range must be filled in, and both values most be positive integers!"; 828 $localestrings['491'] = "The Post selection range must be filled in, and From must be lower than To!"; 829 $localestrings['492'] = "Ranking succesfully deleted"; 830 load_localestrings($localestrings, LP_LOCALE, "admin.ranking", $step); 831 832 $localestrings = array(); 789 833 $localestrings['400'] = "Add new redirect URL"; 790 834 $localestrings['401'] = "Edit redirect URL"; … … 817 861 $localestrings['492'] = "If checked, the site will redirect to the exact URL given"; 818 862 load_localestrings($localestrings, LP_LOCALE, "admin.redirects", $step); 863 864 $localestrings = array(); 865 $localestrings['400'] = "Reporting"; 866 $localestrings['401'] = "Install"; 867 $localestrings['403'] = "Filter on status"; 868 $localestrings['404'] = "x"; 869 $localestrings['405'] = "x"; 870 $localestrings['406'] = "Version"; 871 $localestrings['407'] = "Developer"; 872 $localestrings['408'] = "Contact"; 873 $localestrings['409'] = "Email"; 874 $localestrings['410'] = "Web"; 875 $localestrings['411'] = "Uninstall"; 876 $localestrings['412'] = "Uninstall this report?"; 877 $localestrings['413'] = "x"; 878 $localestrings['414'] = "Not Installed"; 879 $localestrings['415'] = "Installed"; 880 $localestrings['416'] = "Upgrade Available"; 881 $localestrings['417'] = "Error executing installation function: "; 882 $localestrings['418'] = "Not compatible"; 883 $localestrings['419'] = "Error. Unknown command type: "; 884 $localestrings['420'] = "Status"; 885 $localestrings['421'] = "Options"; 886 $localestrings['422'] = "Upgrade"; 887 $localestrings['423'] = "Go"; 888 $localestrings['424'] = "There are no reports available for installation"; 889 $localestrings['425'] = "There are no reports available that match your filter"; 890 $localestrings['mod001'] = "This report requires at least version %s of ExiteCMS.<br />"; 891 $localestrings['mod002'] = "This report is written for version %s of ExiteCMS. Please ask the author for an upgrade.<br />"; 892 $localestrings['mod003'] = "This report requires a minumum ExiteCMS revision level of %s.<br />"; 893 $localestrings['mod004'] = "This report can not be installed. Required information is missing from the report installer.<br />"; 894 $localestrings['mod005'] = "This report does not function beyond ExiteCMS revision level %s.<br />"; 895 load_localestrings($localestrings, LP_LOCALE, "admin.reporting", $step); 896 897 $localestrings = array(); 898 $localestrings['400'] = "Reports"; 899 $localestrings['401'] = "Report Title"; 900 $localestrings['402'] = "Visibility"; 901 $localestrings['403'] = "Options"; 902 $localestrings['404'] = "Deactivate"; 903 $localestrings['405'] = "Activate"; 904 $localestrings['406'] = "Modify this report"; 905 $localestrings['407'] = "Delete this report"; 906 $localestrings['408'] = "Currently there are no reports defined"; 907 $localestrings['409'] = "Add a Report"; 908 $localestrings['410'] = "from"; 909 $localestrings['411'] = "View this report"; 910 load_localestrings($localestrings, LP_LOCALE, "admin.reports", $step); 819 911 820 912 $localestrings = array(); … … 889 981 $localestrings['532'] = "Error: The session timeout value should be greater than the extended login timeout!"; 890 982 $localestrings['533'] = "Error: The extended login timeout should be greater than the standard login timeout!"; 983 $localestrings['534'] = "Forum edit timeout:"; 984 $localestrings['535'] = "Hour"; 985 $localestrings['536'] = "Hours"; 891 986 $localestrings['550'] = "Security"; 892 987 $localestrings['551'] = "Enable registration system?"; … … 944 1039 $localestrings['666'] = "SMTP Username and Password:"; 945 1040 $localestrings['667'] = "In seconds.Only one post per interval is allowed."; 946 $localestrings['668'] = " Use external download statistics:";1041 $localestrings['668'] = "Show results of the Query Optimizer as well:"; 947 1042 $localestrings['669'] = "Maintenance mode background color:"; 948 $localestrings['670'] = "If yes, an external program has to update the download counters.";949 1043 $localestrings['671'] = "Activate SQL query debugging for:"; 950 1044 $localestrings['672'] = "disabled"; … … 1212 1306 $localestrings['es'] = "Spain"; 1213 1307 $localestrings['et'] = "Ethiopia"; 1308 $localestrings['eu'] = "European Union"; 1214 1309 $localestrings['fi'] = "Finland"; 1215 1310 $localestrings['fj'] = "Fiji"; … … 1288 1383 $localestrings['mm'] = "Myanmar"; 1289 1384 $localestrings['mn'] = "Mongolia"; 1385 $localestrings['mo'] = "Macau"; 1290 1386 $localestrings['mp'] = "Northern Mariana Islands"; 1291 1387 $localestrings['mq'] = "Martinique"; … … 1320 1416 $localestrings['pl'] = "Poland"; 1321 1417 $localestrings['pm'] = "Saint Pierre And Miquelon"; 1322 $localestrings['pr'] = "P uerto Rico";1418 $localestrings['pr'] = "Palestinian Territories"; 1323 1419 $localestrings['pt'] = "Portugal"; 1324 1420 $localestrings['pw'] = "Palau"; … … 1362 1458 $localestrings['tv'] = "Tuvalu"; 1363 1459 $localestrings['tw'] = "Taiwan, Province Of China"; 1460 $localestrings['tz'] = "Tanzania"; 1364 1461 $localestrings['ua'] = "Ukraine"; 1365 1462 $localestrings['ug'] = "Uganda"; … … 2162 2259 $localestrings['517'] = "Toggle smileys"; 2163 2260 $localestrings['518'] = "pixels"; 2261 $localestrings['519'] = ""; 2164 2262 $localestrings['520'] = "Moderator Options:"; 2165 2263 $localestrings['521'] = "Delete Thread"; … … 2324 2422 $localestrings['472']['16'] = "white"; 2325 2423 $localestrings['473'] = "Comments (Max.length: 255 characters):"; 2424 $localestrings['474'] = "Toggle Message"; 2326 2425 $localestrings['480'] = " Make this Thread Sticky"; 2327 2426 $localestrings['481'] = " Show My Signature in this Post"; … … 2471 2570 $localestrings = array(); 2472 2571 $localestrings['400'] = "Forum:"; 2572 $localestrings['401'] = "writes:"; 2473 2573 load_localestrings($localestrings, LP_LOCALE, "main.feeds", $step); 2474 2574 … … 2898 2998 2899 2999 $localestrings = array(); 3000 $localestrings['rpt400'] = "Available Reports"; 3001 $localestrings['rpt401'] = "Report"; 3002 $localestrings['rpt402'] = "View"; 3003 $localestrings['rpt403'] = "Currently there are no reports defined"; 3004 $localestrings['rpt404'] = "Result for the requested report"; 3005 $localestrings['rpt405'] = "Report List"; 3006 load_localestrings($localestrings, LP_LOCALE, "main.reports", $step); 3007 3008 $localestrings = array(); 2900 3009 $localestrings['400'] = "Search"; 2901 3010 $localestrings['401'] = "Search for:"; … … 3018 3127 $localestrings['475'] = "News"; 3019 3128 $localestrings['476'] = "Panels"; 3020 $localestrings['477'] = " x";3129 $localestrings['477'] = "Reports"; 3021 3130 $localestrings['478'] = "PHP Info"; 3022 3131 $localestrings['479'] = "Polls"; 3023 $localestrings['480'] = " x";3132 $localestrings['480'] = "Searches"; 3024 3133 $localestrings['481'] = "Menu System"; 3025 3134 $localestrings['482'] = "x"; … … 3047 3156 $localestrings['507'] = "Search"; 3048 3157 $localestrings['508'] = "Register"; 3158 $localestrings['509'] = "Reports"; 3049 3159 $localestrings['520'] = "Main Menu"; 3050 3160 $localestrings['521'] = "Online Users"; … … 3154 3264 if (!function_exists('load_localestrings')) { 3155 3265 function load_localestrings($localestrings, $locales_code, $locales_name, $step="") { 3156 global $db_prefix ;3266 global $db_prefix, $_db_log; 3157 3267 3158 3268 // if this is an upgrade, remove the old locale strings first … … 3160 3270 $result = dbquery("DELETE FROM ".$db_prefix."locales WHERE locales_code = '$locales_code' AND locales_name = '$locales_name'"); 3161 3271 } 3162 3272 3273 // temporary disable query logging 3274 $dblog = $_db_log; $_db_log = false; 3163 3275 // proces the imported locale strings 3164 3276 foreach ($localestrings as $key => $value) { … … 3168 3280 $result = dbquery("INSERT INTO ".$db_prefix."locales (locales_code, locales_name, locales_key, locales_value, locales_datestamp) VALUES ('$locales_code', '$locales_name', '".mysql_escape_string($key)."', '".mysql_escape_string($value)."', '".time()."')"); 3169 3281 } 3282 $_db_log = $dblog; 3170 3283 return true; 3171 3284 } … … 3177 3290 if (!defined('LP_CHARSET')) define('LP_CHARSET', "iso-8859-1"); 3178 3291 if (!defined('LP_VERSION')) define('LP_VERSION', "7.10"); 3179 if (!defined('LP_DATE')) define('LP_DATE', "121 0855263");3180 $lp_date = "121 0855263";3292 if (!defined('LP_DATE')) define('LP_DATE', "1214934137"); 3293 $lp_date = "1214934137"; 3181 3294 3182 3295 /*---------------------------------------------------+ -
branches/PLi-Fusion/administration/tools/update_geoip_database.php
r1227 r1509 42 42 43 43 // load the theme functions when not in CLI mode 44 if (!CMS_CLI) require_once PATH_INCLUDES."theme_functions.php"; 44 if (!CMS_CLI) { 45 require_once PATH_INCLUDES."theme_functions.php"; 46 } else { 47 echo "Running in CLI mode...\n"; 48 } 45 49 46 50 // load the GeoIP include module … … 58 62 // verify if the download succeeded 59 63 if (file_exists('/tmp/GeoIPCountryCSV.zip')) { 64 65 // save the debug log setting, then disable it 66 $db_log = $_db_log; 67 $_db_log = false; 60 68 61 69 // unzip the new file … … 139 147 display("Update finished!"); 140 148 149 // restore the debug log status 150 $_db_log = $db_log; 151 141 152 // delete the download and temporary files 142 153 if (file_exists('/tmp/GeoIPCountryWhois.csv')) unlink("/tmp/GeoIPCountryWhois.csv"); -
branches/PLi-Fusion/administration/upgrade.php
r1227 r1509 74 74 // stage 2: perform the upgrades 75 75 $variables['stage'] = 2; 76 // switch to MySQL4 mode to avoid errors 77 $result = dbquery("SET SESSION sql_mode='MYSQL40'"); 76 78 // start with the current revision number 77 79 $new_revision = $settings['revision']; -
branches/PLi-Fusion/administration/upgrade/rev00730.php
r955 r1509 31 31 32 32 // database changes 33 $commands[] = array('type' => 'db', 'value' => "ALTER TABLE ##PREFIX##settings ADD news_columns TINYINT UNSIGNED NOT NULL DEFAULT '1'AFTER news_style");34 $commands[] = array('type' => 'db', 'value' => "ALTER TABLE ##PREFIX##settings ADD news_items TINYINT UNSIGNED NOT NULL DEFAULT '4'AFTER news_columns");35 $commands[] = array('type' => 'db', 'value' => "ALTER TABLE ##PREFIX##redirects ADD url_parms TINYINT(1) UNSIGNED NOT NULL DEFAULT '0'");33 $commands[] = array('type' => 'db', 'value' => "ALTER TABLE ##PREFIX##settings ADD news_columns TINYINT UNSIGNED NOT NULL DEFAULT 1 AFTER news_style"); 34 $commands[] = array('type' => 'db', 'value' => "ALTER TABLE ##PREFIX##settings ADD news_items TINYINT UNSIGNED NOT NULL DEFAULT 4 AFTER news_columns"); 35 $commands[] = array('type' => 'db', 'value' => "ALTER TABLE ##PREFIX##redirects ADD url_parms TINYINT(1) UNSIGNED NOT NULL DEFAULT 1"); 36 36 $commands[] = array('type' => 'db', 'value' => "ALTER TABLE ##PREFIX##settings CHANGE version version DECIMAL(5,2) NOT NULL DEFAULT '7.00'"); 37 $commands[] = array('type' => 'db', 'value' => "ALTER TABLE ##PREFIX##settings CHANGE subversion revision SMALLINT UNSIGNED NOT NULL DEFAULT '0'");38 $commands[] = array('type' => 'db', 'value' => "ALTER TABLE ##PREFIX##settings CHANGE news_style news_headline TINYINT UNSIGNED NOT NULL DEFAULT '0'");37 $commands[] = array('type' => 'db', 'value' => "ALTER TABLE ##PREFIX##settings CHANGE subversion revision SMALLINT UNSIGNED NOT NULL DEFAULT 0"); 38 $commands[] = array('type' => 'db', 'value' => "ALTER TABLE ##PREFIX##settings CHANGE news_style news_headline TINYINT UNSIGNED NOT NULL DEFAULT 0"); 39 39 $commands[] = array('type' => 'db', 'value' => "ALTER TABLE ##PREFIX##users CHANGE user_offset user_offset CHAR(6) NOT NULL DEFAULT ''"); 40 40 -
branches/PLi-Fusion/administration/upgrade/rev00740.php
r955 r1509 43 43 pm_id smallint(5) unsigned NOT NULL auto_increment, 44 44 pm_subject varchar(100) NOT NULL default '', 45 pm_message text NOT NULL default '',46 pm_recipients text NOT NULL default '',47 pm_smileys tinyint(1) unsigned NOT NULL default '1',48 pm_size smallint(5) unsigned NOT NULL default '0',49 pm_datestamp int(10) unsigned NOT NULL default '0',45 pm_message text NOT NULL, 46 pm_recipients text NOT NULL, 47 pm_smileys tinyint(1) unsigned NOT NULL default 1, 48 pm_size smallint(5) unsigned NOT NULL default 0, 49 pm_datestamp int(10) unsigned NOT NULL default 0, 50 50 PRIMARY KEY (pm_id) 51 51 ) ENGINE=MyISAM;"); … … 53 53 pmindex_id smallint(5) unsigned NOT NULL auto_increment, 54 54 pm_id smallint(5) unsigned NOT NULL, 55 pmindex_user_id smallint(5) unsigned NOT NULL default '0',56 pmindex_reply_id smallint(5) unsigned NOT NULL default '0',57 pmindex_from_id smallint(5) unsigned NOT NULL default '0',55 pmindex_user_id smallint(5) unsigned NOT NULL default 0, 56 pmindex_reply_id smallint(5) unsigned NOT NULL default 0, 57 pmindex_from_id smallint(5) unsigned NOT NULL default 0, 58 58 pmindex_from_email varchar(100) NOT NULL default '', 59 pmindex_to_id smallint(5) unsigned NOT NULL default '0',59 pmindex_to_id smallint(5) unsigned NOT NULL default 0, 60 60 pmindex_to_email varchar(100) NOT NULL default '', 61 pmindex_to_group tinyint(1) unsigned NOT NULL default '0',62 pmindex_read_datestamp int(10) unsigned NOT NULL default '0',63 pmindex_read_requested tinyint(1) unsigned NOT NULL default '0',64 pmindex_folder tinyint(1) unsigned NOT NULL default '0',65 pmindex_locked tinyint(1) unsigned NOT NULL default '0',61 pmindex_to_group tinyint(1) unsigned NOT NULL default 0, 62 pmindex_read_datestamp int(10) unsigned NOT NULL default 0, 63 pmindex_read_requested tinyint(1) unsigned NOT NULL default 0, 64 pmindex_folder tinyint(1) unsigned NOT NULL default 0, 65 pmindex_locked tinyint(1) unsigned NOT NULL default 0, 66 66 PRIMARY KEY (pmindex_id) 67 67 ) ENGINE=MyISAM;"); … … 69 69 pmconfig_id smallint(5) unsigned NOT NULL auto_increment, 70 70 user_id smallint(5) unsigned NOT NULL, 71 pmconfig_save_sent tinyint(1) unsigned NOT NULL default '1',72 pmconfig_read_notify tinyint(1) unsigned NOT NULL default '1',73 pmconfig_email_notify tinyint(1) unsigned NOT NULL default '0',71 pmconfig_save_sent tinyint(1) unsigned NOT NULL default 0, 72 pmconfig_read_notify tinyint(1) unsigned NOT NULL default 0, 73 pmconfig_email_notify tinyint(1) unsigned NOT NULL default 0, 74 74 pmconfig_auto_archive smallint(5) unsigned NOT NULL default '90', 75 pmconfig_view tinyint(1) unsigned NOT NULL default '0',75 pmconfig_view tinyint(1) unsigned NOT NULL default 0, 76 76 PRIMARY KEY (pmconfig_id) 77 77 ) ENGINE=MyISAM;"); … … 79 79 pmattach_id smallint(5) unsigned NOT NULL auto_increment, 80 80 pm_id smallint(5) unsigned NOT NULL, 81 pmattach_name varchar(100) collate latin1_general_ciNOT NULL default '',82 pmattach_realname varchar(100) collate latin1_general_ciNOT NULL default '',83 pmattach_comment varchar(255) collate latin1_general_ciNOT NULL default '',84 pmattach_ext varchar(5) collate latin1_general_ciNOT NULL default '',85 pmattach_size int(20) unsigned NOT NULL default '0',81 pmattach_name varchar(100) NOT NULL default '', 82 pmattach_realname varchar(100) NOT NULL default '', 83 pmattach_comment varchar(255) NOT NULL default '', 84 pmattach_ext varchar(5) NOT NULL default '', 85 pmattach_size int(20) unsigned NOT NULL default 0, 86 86 PRIMARY KEY (pmattach_id) 87 87 ) ENGINE=MyISAM;"); … … 93 93 $commands[] = array('type' => 'db', 'value' => "UPDATE ##PREFIX##admin SET admin_image = 'images.gif', admin_title = 'Image Settings', admin_link = 'settings_image.php' WHERE admin_link = 'settings_photo.php' AND admin_page = '3'"); 94 94 $commands[] = array('type' => 'db', 'value' => "UPDATE ##PREFIX##admin SET admin_image = 'adverts.gif' WHERE admin_link = 'adverts.php' AND admin_page = '1'"); 95 $commands[] = array('type' => 'db', 'value' => "ALTER TABLE ##PREFIX##settings ADD pm_inbox SMALLINT(5) UNSIGNED NOT NULL DEFAULT '25'");96 $commands[] = array('type' => 'db', 'value' => "ALTER TABLE ##PREFIX##settings ADD pm_sentbox SMALLINT(5) UNSIGNED NOT NULL DEFAULT '25'");97 $commands[] = array('type' => 'db', 'value' => "ALTER TABLE ##PREFIX##settings ADD pm_savebox SMALLINT(5) UNSIGNED NOT NULL DEFAULT '25'");98 $commands[] = array('type' => 'db', 'value' => "ALTER TABLE ##PREFIX##settings ADD pm_send2group SMALLINT(5) UNSIGNED NOT NULL DEFAULT '103'");99 $commands[] = array('type' => 'db', 'value' => "ALTER TABLE ##PREFIX##settings ADD pm_hide_rcpts TINYINT(1) UNSIGNED NOT NULL DEFAULT '0'");95 $commands[] = array('type' => 'db', 'value' => "ALTER TABLE ##PREFIX##settings ADD pm_inbox SMALLINT(5) UNSIGNED NOT NULL DEFAULT 25"); 96 $commands[] = array('type' => 'db', 'value' => "ALTER TABLE ##PREFIX##settings ADD pm_sentbox SMALLINT(5) UNSIGNED NOT NULL DEFAULT 25"); 97 $commands[] = array('type' => 'db', 'value' => "ALTER TABLE ##PREFIX##settings ADD pm_savebox SMALLINT(5) UNSIGNED NOT NULL DEFAULT 25"); 98 $commands[] = array('type' => 'db', 'value' => "ALTER TABLE ##PREFIX##settings ADD pm_send2group SMALLINT(5) UNSIGNED NOT NULL DEFAULT 103"); 99 $commands[] = array('type' => 'db', 'value' => "ALTER TABLE ##PREFIX##settings ADD pm_hide_rcpts TINYINT(1) UNSIGNED NOT NULL DEFAULT 0"); 100 100 101 101 $commands[] = array('type' => 'function', 'value' => "migrate_messages"); -
branches/PLi-Fusion/administration/upgrade/rev00760.php
r955 r1509 44 44 45 45 // added option to disable the display of banners on a per-forum basis 46 $commands[] = array('type' => 'db', 'value' => "ALTER TABLE ##PREFIX##forums ADD forum_banners TINYINT(1) UNSIGNED NOT NULL DEFAULT '1'");46 $commands[] = array('type' => 'db', 'value' => "ALTER TABLE ##PREFIX##forums ADD forum_banners TINYINT(1) UNSIGNED NOT NULL DEFAULT 1"); 47 47 48 48 // support new homepage news assignments 49 49 $commands[] = array('type' => 'db', 'value' => "ALTER TABLE ##PREFIX##news DROP news_latest_item"); 50 $commands[] = array('type' => 'db', 'value' => "ALTER TABLE ##PREFIX##news CHANGE news_sticky news_headline TINYINT(1) UNSIGNED NOT NULL DEFAULT '0'");51 $commands[] = array('type' => 'db', 'value' => "ALTER TABLE ##PREFIX##news ADD news_latest_news TINYINT(3) UNSIGNED NOT NULL DEFAULT '0'AFTER news_headline");50 $commands[] = array('type' => 'db', 'value' => "ALTER TABLE ##PREFIX##news CHANGE news_sticky news_headline TINYINT(1) UNSIGNED NOT NULL DEFAULT 0"); 51 $commands[] = array('type' => 'db', 'value' => "ALTER TABLE ##PREFIX##news ADD news_latest_news TINYINT(3) UNSIGNED NOT NULL DEFAULT 0 AFTER news_headline"); 52 52 53 53 // make more room to support timezones at half-hours or quaters -
branches/PLi-Fusion/administration/upgrade/rev00780.php
r955 r1509 39 39 40 40 // add seperate max dimensions for images in the forum posts 41 $commands[] = array('type' => 'db', 'value' => "ALTER TABLE ##PREFIX##settings ADD forum_max_w SMALLINT(4) NOT NULL DEFAULT '600'AFTER forum_flags");42 $commands[] = array('type' => 'db', 'value' => "ALTER TABLE ##PREFIX##settings ADD forum_max_h SMALLINT(4) NOT NULL DEFAULT '600'AFTER forum_max_w");41 $commands[] = array('type' => 'db', 'value' => "ALTER TABLE ##PREFIX##settings ADD forum_max_w SMALLINT(4) NOT NULL DEFAULT 600 AFTER forum_flags"); 42 $commands[] = array('type' => 'db', 'value' => "ALTER TABLE ##PREFIX##settings ADD forum_max_h SMALLINT(4) NOT NULL DEFAULT 600 AFTER forum_max_w"); 43 43 44 44 // new user field to indicate that this user is a webmaster 45 $commands[] = array('type' => 'db', 'value' => "ALTER TABLE ##PREFIX##users ADD user_webmaster TINYINT( 1 ) UNSIGNED NOT NULL DEFAULT '0'AFTER user_password");45 $commands[] = array('type' => 'db', 'value' => "ALTER TABLE ##PREFIX##users ADD user_webmaster TINYINT( 1 ) UNSIGNED NOT NULL DEFAULT 0 AFTER user_password"); 46 46 ?> -
branches/PLi-Fusion/administration/upgrade/rev00800.php
r955 r1509 38 38 39 39 // add the aidlink switch to the site_links table 40 $commands[] = array('type' => 'db', 'value' => "ALTER TABLE ##PREFIX##site_links ADD link_aid TINYINT(1) UNSIGNED DEFAULT '0'AFTER link_window");41 $commands[] = array('type' => 'db', 'value' => "ALTER TABLE ##PREFIX##site_links ADD link_parent TINYINT(3) UNSIGNED DEFAULT '0'AFTER link_aid");40 $commands[] = array('type' => 'db', 'value' => "ALTER TABLE ##PREFIX##site_links ADD link_aid TINYINT(1) UNSIGNED DEFAULT 0 AFTER link_window"); 41 $commands[] = array('type' => 'db', 'value' => "ALTER TABLE ##PREFIX##site_links ADD link_parent TINYINT(3) UNSIGNED DEFAULT 0 AFTER link_aid"); 42 42 43 43 // add the news_latest switch to the settings table 44 $commands[] = array('type' => 'db', 'value' => "ALTER TABLE ##PREFIX##settings ADD news_latest TINYINT(1) UNSIGNED DEFAULT '0'AFTER news_items");44 $commands[] = array('type' => 'db', 'value' => "ALTER TABLE ##PREFIX##settings ADD news_latest TINYINT(1) UNSIGNED DEFAULT 0 AFTER news_items"); 45 45 46 46 // drop the panel_state table. Not needed anymore, replaced by cookies -
branches/PLi-Fusion/administration/upgrade/rev00850.php
r1236 r1509 62 62 $result = dbquery("UPDATE ".$db_prefix."user_groups SET group_ident = 'wE01' WHERE group_id = '".$data['group_id']."'"); 63 63 } else { 64 $result = dbquery("INSERT INTO ".$db_prefix."user_groups (group_ident, group_name, group_ description, group_visible) VALUES ('wE01', 'Sponsors', 'Website Sponsors', '0'");64 $result = dbquery("INSERT INTO ".$db_prefix."user_groups (group_ident, group_name, group_groups, group_rights, group_description, group_visible) VALUES ('wE01', 'Sponsors', '', '', 'Website Sponsors', '0'"); 65 65 } 66 66 } -
branches/PLi-Fusion/administration/upgrade/rev00858.php
r955 r1509 1031 1031 locale_code varchar(8) NOT NULL default '', 1032 1032 locale_name varchar(50) NOT NULL default '', 1033 locale_active tinyint(1) NOT NULL default '0',1033 locale_active tinyint(1) NOT NULL default 0, 1034 1034 PRIMARY KEY (locale_id) 1035 1035 ) ENGINE=MyISAM;"); -
branches/PLi-Fusion/administration/upgrade/rev00909.php
r955 r1509 36 36 cfg_id smallint(5) unsigned NOT NULL auto_increment, 37 37 cfg_name varchar(25) NOT NULL default '', 38 cfg_value TEXT NOT NULL default '',38 cfg_value TEXT NOT NULL, 39 39 PRIMARY KEY (cfg_id) 40 40 ) ENGINE=MyISAM;"); -
branches/PLi-Fusion/administration/upgrade/rev00954.php
r955 r1509 33 33 // create new captcha table 34 34 $commands[] = array('type' => 'db', 'value' => "CREATE TABLE ##PREFIX##captcha ( 35 captcha_datestamp INT(10) UNSIGNED NOT NULL default '0',35 captcha_datestamp INT(10) UNSIGNED NOT NULL default 0, 36 36 captcha_ip VARCHAR(20) NOT NULL, 37 37 captcha_encode VARCHAR(32) NOT NULL default '', -
branches/PLi-Fusion/administration/upgrade/rev01060.php
r1065 r1509 36 36 37 37 // new user field to indicate that this user is a webmaster 38 $commands[] = array('type' => 'db', 'value' => "ALTER TABLE ##PREFIX##users ADD user_bad_email INT(10) UNSIGNED NOT NULL DEFAULT '0'AFTER user_email");38 $commands[] = array('type' => 'db', 'value' => "ALTER TABLE ##PREFIX##users ADD user_bad_email INT(10) UNSIGNED NOT NULL DEFAULT 0 AFTER user_email"); 39 39 ?> -
branches/PLi-Fusion/administration/upgrade/rev01070.php
r1408 r1509 41 41 locales_name varchar(50) NOT NULL default '', 42 42 locales_key varchar(25) NOT NULL default '', 43 locales_value TEXT NOT NULL default '',43 locales_value TEXT NOT NULL, 44 44 locales_datestamp INT(10) UNSIGNED NOT NULL default 0, 45 45 PRIMARY KEY (locales_id) -
branches/PLi-Fusion/administration/upgrade/rev01091.php
r1124 r1509 31 31 32 32 // add the translator user_id to the locales table to track who changed what (we have the datestamp for the when) 33 $commands[] = array('type' => 'db', 'value' => "ALTER TABLE ##PREFIX##locales ADD locales_translator SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0'AFTER locales_value");33 $commands[] = array('type' => 'db', 'value' => "ALTER TABLE ##PREFIX##locales ADD locales_translator SMALLINT(5) UNSIGNED NOT NULL DEFAULT 0 AFTER locales_value"); 34 34 35 35 // add a locales key index to the locales table -
branches/PLi-Fusion/administration/upgrade/rev01190.php
r1227 r1509 31 31 // update the tables 32 32 $commands[] = array('type' => 'db', 'value' => "ALTER TABLE ".$db_prefix."admin CHANGE admin_id admin_id SMALLINT(5) UNSIGNED NOT NULL AUTO_INCREMENT"); 33 $commands[] = array('type' => 'db', 'value' => "ALTER TABLE ".$db_prefix."articles CHANGE article_name article_name MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT '1'");34 $commands[] = array('type' => 'db', 'value' => "ALTER TABLE ".$db_prefix."articles CHANGE article_reads article_reads MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT '0'");35 $commands[] = array('type' => 'db', 'value' => "ALTER TABLE ".$db_prefix."forums CHANGE forum_lastuser forum_lastuser MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT '0'");33 $commands[] = array('type' => 'db', 'value' => "ALTER TABLE ".$db_prefix."articles CHANGE article_name article_name MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT 1"); 34 $commands[] = array('type' => 'db', 'value' => "ALTER TABLE ".$db_prefix."articles CHANGE article_reads article_reads MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT 0"); 35 $commands[] = array('type' => 'db', 'value' => "ALTER TABLE ".$db_prefix."forums CHANGE forum_lastuser forum_lastuser MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT 0"); 36 36 $commands[] = array('type' => 'db', 'value' => "ALTER TABLE ".$db_prefix."forum_attachments CHANGE attach_id attach_id MEDIUMINT(8) UNSIGNED NOT NULL AUTO_INCREMENT"); 37 $commands[] = array('type' => 'db', 'value' => "ALTER TABLE ".$db_prefix."forum_attachments CHANGE thread_id thread_id MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT '0'");38 $commands[] = array('type' => 'db', 'value' => "ALTER TABLE ".$db_prefix."forum_attachments CHANGE post_id post_id MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT '0'");37 $commands[] = array('type' => 'db', 'value' => "ALTER TABLE ".$db_prefix."forum_attachments CHANGE thread_id thread_id MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT 0"); 38 $commands[] = array('type' => 'db', 'value' => "ALTER TABLE ".$db_prefix."forum_attachments CHANGE post_id post_id MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT 0"); 39 39 $commands[] = array('type' => 'db', 'value' => "ALTER TABLE ".$db_prefix."forum_polls CHANGE poll_id poll_id MEDIUMINT(8) UNSIGNED NOT NULL AUTO_INCREMENT"); 40 $commands[] = array('type' => 'db', 'value' => "ALTER TABLE ".$db_prefix."forum_polls CHANGE thread_id thread_id MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT '0'");41 $commands[] = array('type' => 'db', 'value' => "ALTER TABLE ".$db_prefix."forum_polls CHANGE post_id post_id MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT '0'");40 $commands[] = array('type' => 'db', 'value' => "ALTER TABLE ".$db_prefix."forum_polls CHANGE thread_id thread_id MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT 0"); 41 $commands[] = array('type' => 'db', 'value' => "ALTER TABLE ".$db_prefix."forum_polls CHANGE post_id post_id MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT 0"); 42 42 $commands[] = array('type' => 'db', 'value' => "ALTER TABLE ".$db_prefix."forum_poll_options CHANGE option_id option_id MEDIUMINT(8) UNSIGNED NOT NULL AUTO_INCREMENT"); 43 $commands[] = array('type' => 'db', 'value' => "ALTER TABLE ".$db_prefix."forum_poll_options CHANGE poll_id poll_id MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT '0'");44 $commands[] = array('type' => 'db', 'value' => "ALTER TABLE ".$db_prefix."forum_poll_votes CHANGE poll_id poll_id MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT '0'");45 $commands[] = array('type' => 'db', 'value' => "ALTER TABLE ".$db_prefix."forum_poll_votes CHANGE user_id user_id MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT '0'");46 $commands[] = array('type' => 'db', 'value' => "ALTER TABLE ".$db_prefix."news CHANGE news_name news_name MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT '1'");43 $commands[] = array('type' => 'db', 'value' => "ALTER TABLE ".$db_prefix."forum_poll_options CHANGE poll_id poll_id MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT 0"); 44 $commands[] = array('type' => 'db', 'value' => "ALTER TABLE ".$db_prefix."forum_poll_votes CHANGE poll_id poll_id MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT 0"); 45 $commands[] = array('type' => 'db', 'value' => "ALTER TABLE ".$db_prefix."forum_poll_votes CHANGE user_id user_id MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT 0"); 46 $commands[] = array('type' => 'db', 'value' => "ALTER TABLE ".$db_prefix."news CHANGE news_name news_name MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT 1"); 47 47 $commands[] = array('type' => 'db', 'value' => "ALTER TABLE ".$db_prefix."pm CHANGE pm_id pm_id MEDIUMINT(8) UNSIGNED NOT NULL AUTO_INCREMENT"); 48 $commands[] = array('type' => 'db', 'value' => "ALTER TABLE ".$db_prefix."pm CHANGE pm_size pm_size MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT '0'");48 $commands[] = array('type' => 'db', 'value' => "ALTER TABLE ".$db_prefix."pm CHANGE pm_size pm_size MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT 0"); 49 49 $commands[] = array('type' => 'db', 'value' => "ALTER TABLE ".$db_prefix."pm_attachments CHANGE pmattach_id pmattach_id MEDIUMINT(8) UNSIGNED NOT NULL AUTO_INCREMENT"); 50 $commands[] = array('type' => 'db', 'value' => "ALTER TABLE ".$db_prefix."pm_attachments CHANGE pm_id pm_id MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT '0'");50 $commands[] = array('type' => 'db', 'value' => "ALTER TABLE ".$db_prefix."pm_attachments CHANGE pm_id pm_id MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT 0"); 51 51 $commands[] = array('type' => 'db', 'value' => "ALTER TABLE ".$db_prefix."pm_config CHANGE pmconfig_id pmconfig_id MEDIUMINT(8) UNSIGNED NOT NULL AUTO_INCREMENT"); 52 $commands[] = array('type' => 'db', 'value' => "ALTER TABLE ".$db_prefix."pm_config CHANGE user_id user_id MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT '0'");52 $commands[] = array('type' => 'db', 'value' => "ALTER TABLE ".$db_prefix."pm_config CHANGE user_id user_id MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT 0"); 53 53 $commands[] = array('type' => 'db', 'value' => "ALTER TABLE ".$db_prefix."pm_index CHANGE pmindex_id pmindex_id MEDIUMINT(8) UNSIGNED NOT NULL AUTO_INCREMENT"); 54 $commands[] = array('type' => 'db', 'value' => "ALTER TABLE ".$db_prefix."pm_index CHANGE pm_id pm_id MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT '0'");55 $commands[] = array('type' => 'db', 'value' => "ALTER TABLE ".$db_prefix."pm_index CHANGE pmindex_user_id pmindex_user_id MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT '0'");56 $commands[] = array('type' => 'db', 'value' => "ALTER TABLE ".$db_prefix."pm_index CHANGE pmindex_reply_id pmindex_reply_id MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT '0'");57 $commands[] = array('type' => 'db', 'value' => "ALTER TABLE ".$db_prefix."pm_index CHANGE pmindex_from_id pmindex_from_id MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT '0'");58 $commands[] = array('type' => 'db', 'value' => "ALTER TABLE ".$db_prefix."pm_index CHANGE pmindex_to_id pmindex_to_id MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT '0'");59 $commands[] = array('type' => 'db', 'value' => "ALTER TABLE ".$db_prefix."posts CHANGE thread_id thread_id MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT '0'");54 $commands[] = array('type' => 'db', 'value' => "ALTER TABLE ".$db_prefix."pm_index CHANGE pm_id pm_id MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT 0"); 55 $commands[] = array('type' => 'db', 'value' => "ALTER TABLE ".$db_prefix."pm_index CHANGE pmindex_user_id pmindex_user_id MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT 0"); 56 $commands[] = array('type' => 'db', 'value' => "ALTER TABLE ".$db_prefix."pm_index CHANGE pmindex_reply_id pmindex_reply_id MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT 0"); 57 $commands[] = array('type' => 'db', 'value' => "ALTER TABLE ".$db_prefix."pm_index CHANGE pmindex_from_id pmindex_from_id MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT 0"); 58 $commands[] = array('type' => 'db', 'value' => "ALTER TABLE ".$db_prefix."pm_index CHANGE pmindex_to_id pmindex_to_id MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT 0"); 59 $commands[] = array('type' => 'db', 'value' => "ALTER TABLE ".$db_prefix."posts CHANGE thread_id thread_id MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT 0"); 60 60 $commands[] = array('type' => 'db', 'value' => "ALTER TABLE ".$db_prefix."posts CHANGE post_id post_id MEDIUMINT(8) UNSIGNED NOT NULL AUTO_INCREMENT"); 61 $commands[] = array('type' => 'db', 'value' => "ALTER TABLE ".$db_prefix."posts CHANGE post_reply_id post_reply_id MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT '0'");62 $commands[] = array('type' => 'db', 'value' => "ALTER TABLE ".$db_prefix."posts CHANGE post_author post_author MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT '0'");63 $commands[] = array('type' => 'db', 'value' => "ALTER TABLE ".$db_prefix."posts CHANGE post_edituser post_edituser MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT '0'");64 $commands[] = array('type' => 'db', 'value' => "ALTER TABLE ".$db_prefix."ratings CHANGE rating_user rating_user MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT '0'");61 $commands[] = array('type' => 'db', 'value' => "ALTER TABLE ".$db_prefix."posts CHANGE post_reply_id post_reply_id MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT 0"); 62 $commands[] = array('type' => 'db', 'value' => "ALTER TABLE ".$db_prefix."posts CHANGE post_author post_author MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT 0"); 63 $commands[] = array('type' => 'db', 'value' => "ALTER TABLE ".$db_prefix."posts CHANGE post_edituser post_edituser MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT 0"); 64 $commands[] = array('type' => 'db', 'value' => "ALTER TABLE ".$db_prefix."ratings CHANGE rating_user rating_user MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT 0"); 65 65 $commands[] = array('type' => 'db', 'value' => "ALTER TABLE ".$db_prefix."threads CHANGE thread_id thread_id MEDIUMINT(8) UNSIGNED NOT NULL AUTO_INCREMENT"); 66 $commands[] = array('type' => 'db', 'value' => "ALTER TABLE ".$db_prefix."threads CHANGE thread_author thread_author MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT '0'");67 $commands[] = array('type' => 'db', 'value' => "ALTER TABLE ".$db_prefix."threads CHANGE thread_views thread_views MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT '0'");68 $commands[] = array('type' => 'db', 'value' => "ALTER TABLE ".$db_prefix."threads CHANGE thread_lastuser thread_lastuser MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT '0'");69 $commands[] = array('type' => 'db', 'value' => "ALTER TABLE ".$db_prefix."thread_notify CHANGE thread_id thread_id MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT '0'");70 $commands[] = array('type' => 'db', 'value' => "ALTER TABLE ".$db_prefix."thread_notify CHANGE notify_user notify_user MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT '0'");66 $commands[] = array('type' => 'db', 'value' => "ALTER TABLE ".$db_prefix."threads CHANGE thread_author thread_author MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT 0"); 67 $commands[] = array('type' => 'db', 'value' => "ALTER TABLE ".$db_prefix."threads CHANGE thread_views thread_views MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT 0"); 68 $commands[] = array('type' => 'db', 'value' => "ALTER TABLE ".$db_prefix."threads CHANGE thread_lastuser thread_lastuser MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT 0"); 69 $commands[] = array('type' => 'db', 'value' => "ALTER TABLE ".$db_prefix."thread_notify CHANGE thread_id thread_id MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT 0"); 70 $commands[] = array('type' => 'db', 'value' => "ALTER TABLE ".$db_prefix."thread_notify CHANGE notify_user notify_user MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT 0"); 71 71 $commands[] = array('type' => 'db', 'value' => "ALTER TABLE ".$db_prefix."users CHANGE user_id user_id MEDIUMINT(8) UNSIGNED NOT NULL AUTO_INCREMENT"); 72 $commands[] = array('type' => 'db', 'value' => "ALTER TABLE ".$db_prefix."users CHANGE user_posts user_posts MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT '0'");73 $commands[] = array('type' => 'db', 'value' => "ALTER TABLE ".$db_prefix."users CHANGE user_newsletters user_newsletters TINYINT(1) UNSIGNED NOT NULL DEFAULT '1'");72 $commands[] = array('type' => 'db', 'value' => "ALTER TABLE ".$db_prefix."users CHANGE user_posts user_posts MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT 0"); 73 $commands[] = array('type' => 'db', 'value' => "ALTER TABLE ".$db_prefix."users CHANGE user_newsletters user_newsletters TINYINT(1) UNSIGNED NOT NULL DEFAULT 1"); 74 74 ?> -
branches/PLi-Fusion/administration/upgrade/rev01193.php
r1227 r1509 30 30 31 31 // add the user_forum_datestamp field to the users table 32 $commands[] = array('type' => 'db', 'value' => "ALTER TABLE ##PREFIX##users ADD user_forum_datestamp INT(10) NOT NULL DEFAULT '0'AFTER user_forum_fullscreen");32 $commands[] = array('type' => 'db', 'value' => "ALTER TABLE ##PREFIX##users ADD user_forum_datestamp INT(10) NOT NULL DEFAULT 0 AFTER user_forum_fullscreen"); 33 33 34 34 // create the threads_read table 35 35 $commands[] = array('type' => 'db', 'value' => "CREATE TABLE ##PREFIX##threads_read ( 36 user_id mediumint(8) NOT NULL default '0',37 forum_id smallint(5) NOT NULL default '0',38 thread_id mediumint(8) NOT NULL default '0',39 thread_page smallint(5) NOT NULL default '0',40 thread_last_read int(10) NOT NULL default '0',36 user_id mediumint(8) NOT NULL default 0, 37 forum_id smallint(5) NOT NULL default 0, 38 thread_id mediumint(8) NOT NULL default 0, 39 thread_page smallint(5) NOT NULL default 0, 40 thread_last_read int(10) NOT NULL default 0, 41 41 PRIMARY KEY (user_id,forum_id,thread_id) 42 42 ) ENGINE=MyISAM;"); -
branches/PLi-Fusion/administration/upgrade/rev01201.php
r1227 r1509 36 36 37 37 // add the new user groups for the module "blogs" 38 $commands[] = array('type' => 'db', 'value' => "INSERT INTO ##PREFIX##user_groups (group_ident, group_name, group_ description, group_forumname, group_visible) VALUES ('BG01', 'Blog Editors', 'Blog Editors', 'Blog Editor', '1')");39 $commands[] = array('type' => 'db', 'value' => "INSERT INTO ##PREFIX##user_groups (group_ident, group_name, group_ description, group_forumname, group_visible) VALUES ('BG02', 'Blog Moderators', 'Blog Moderators', 'Blog Moderator', '1')");38 $commands[] = array('type' => 'db', 'value' => "INSERT INTO ##PREFIX##user_groups (group_ident, group_name, group_groups, group_rights, group_description, group_forumname, group_visible) VALUES ('BG01', 'Blog Editors', '', '', 'Blog Editors', 'Blog Editor', '1')"); 39 $commands[] = array('type' => 'db', 'value' => "INSERT INTO ##PREFIX##user_groups (group_ident, group_name, group_groups, group_rights, group_description, group_forumname, group_visible) VALUES ('BG02', 'Blog Moderators', '', '', 'Blog Moderators', 'Blog Moderator', '1')"); 40 40 41 41 // add the tables for the new module "blogs" 42 42 $commands[] = array('type' => 'db', 'value' => "CREATE TABLE ##PREFIX##blogs ( 43 43 blog_id mediumint(8) NOT NULL AUTO_INCREMENT, 44 blog_subject VARCHAR(50) NOT NULL default '',45 blog_text TEXT NOT NULL default '',46 blog_reads mediumint(8) NOT NULL default '0',47 blog_breaks CHAR(1) NOT NULL,48 blog_comments TINYINT(1) NOT NULL default '0',49 blog_ratings TINYINT(1) NOT NULL default '0',50 blog_author mediumint(8) NOT NULL default '0',51 blog_datestamp int(10) NOT NULL default '0',52 blog_editor mediumint(8) NOT NULL default '0',53 blog_edittime int(10) NOT NULL default '0',44 blog_subject varchar(50) NOT NULL default '', 45 blog_text text NOT NULL, 46 blog_reads mediumint(8) NOT NULL default 0, 47 blog_breaks char(1) NOT NULL default 'n', 48 blog_comments tinyint(1) NOT NULL default 0, 49 blog_ratings tinyint(1) NOT NULL default 0, 50 blog_author mediumint(8) NOT NULL default 0, 51 blog_datestamp int(10) NOT NULL default 0, 52 blog_editor mediumint(8) NOT NULL default 0, 53 blog_edittime int(10) NOT NULL default 0, 54 54 PRIMARY KEY (blog_id) 55 55 ) ENGINE=MyISAM;"); -
branches/PLi-Fusion/administration/upgrade/rev01214.php
r1227 r1509 39 39 session_id CHAR(50) NOT NULL default '', 40 40 session_ua CHAR(32) NOT NULL default '', 41 session_started int(10) NOT NULL default '0',42 session_expire int(10) NOT NULL default '0',43 session_user_id mediumint(8) NOT NULL default '0',41 session_started int(10) NOT NULL default 0, 42 session_expire int(10) NOT NULL default 0, 43 session_user_id mediumint(8) NOT NULL default 0, 44 44 session_ip CHAR(15) NOT NULL default '', 45 session_data TEXT NOT NULL default '',45 session_data TEXT, 46 46 PRIMARY KEY (session_id) 47 47 ) ENGINE=MyISAM;"); -
branches/PLi-Fusion/administration/upgrade/rev01280.php
r1335 r1509 30 30 31 31 // add an automatic timestamp to the configuration table 32 $commands[] = array('type' => 'db', 'value' => "ALTER TABLE ##PREFIX##users ADD user_posts_unread TINYINT(1) NOT NULL DEFAULT '1'AFTER user_sponsor");32 $commands[] = array('type' => 'db', 'value' => "ALTER TABLE ##PREFIX##users ADD user_posts_unread TINYINT(1) NOT NULL DEFAULT 1 AFTER user_sponsor"); 33 33 ?> -
branches/PLi-Fusion/blogs.php
r1227 r1509 222 222 $bloglimit = time() - $settings['blogs_indexage'] * 86400; 223 223 // select all authors 224 $result = dbquery("SELECT DISTINCT b.blog_author, u.user_name, count(*) AS count FROM ".$db_prefix."blogs b, ".$db_prefix."users u WHERE b.blog_author = u.user_id AND (blog_datestamp > '".$bloglimit."' OR blog_edittime > '".$bloglimit."')GROUP BY blog_author ORDER BY count DESC, user_name ASC");224 $result = dbquery("SELECT DISTINCT b.blog_author, u.user_name, count(*) AS count FROM ".$db_prefix."blogs b, ".$db_prefix."users u WHERE b.blog_author = u.user_id GROUP BY blog_author ORDER BY count DESC, user_name ASC"); 225 225 } 226 226 $variables['list'] = array(); … … 234 234 $variables['list'][] = $data; 235 235 } 236 237 236 break; 238 237 } -
branches/PLi-Fusion/contact.php
r1335 r1509 15 15 require_once dirname(__FILE__)."/includes/core_functions.php"; 16 16 require_once PATH_ROOT."/includes/theme_functions.php"; 17 18 // include the secureimage class19 require_once PATH_INCLUDES."secureimage-1.0.3/securimage.php";20 17 21 18 // temp storage for template variables … … 44 41 // error initialisation 45 42 $errors = array(); 43 // include the secureimage class 44 require_once PATH_INCLUDES."secureimage-1.0.3/securimage.php"; 46 45 // captcha check 47 46 $securimage = new Securimage(); -
branches/PLi-Fusion/downloads.php
r1227 r1509 66 66 // if a download ID is given... 67 67 if (isset($download_id)) { 68 $res = 0;69 68 // and it exists ... 70 69 if ($data = dbarray(dbquery("SELECT download_url,download_cat FROM ".$db_prefix."downloads WHERE download_id='$download_id'"))) { … … 72 71 // and the user has access to it... 73 72 if (checkgroup($cdata['download_cat_access'])) { 74 $res = 1;75 73 // update the download counter (if we're using internal statistics) 76 if (!isset($settings[' remote_stats']) || !$settings['remote_stats']) $result = dbquery("UPDATE ".$db_prefix."downloads SET download_count=download_count+1 WHERE download_id='$download_id'");74 if (!isset($settings['dlstats_remote']) || !$settings['dlstats_remote']) $result = dbquery("UPDATE ".$db_prefix."downloads SET download_count=download_count+1 WHERE download_id='$download_id'"); 77 75 // if a URL is given for the download, redirect to it, else fall back to the download category 78 76 if ($data['download_url']) { 77 // download statistics plugin installed but no remote stats used? Then update the IP counters 78 if (isset($settings['dlstats_remote']) && !$settings['dlstats_remote']) { 79 if (USER_IP != "0.0.0.0") { 80 $result = dbquery("INSERT INTO ".$db_prefix."dlstats_ips (dlsi_ip, dlsi_ccode, dlsi_counter) VALUES ('".USER_IP."', '".USER_CC."', '1') ON DUPLICATE KEY UPDATE dlsi_counter = dlsi_counter + 1"); 81 } 82 } 79 83 redirect($data['download_url']); 80 84 exit; … … 107 111 $variables['subcats'] = false; 108 112 $result = dbquery("SELECT * FROM ".$db_prefix."download_cats WHERE download_parent='0' AND ".groupaccess('download_cat_access').($where==""?"":(" AND ".$where))." ORDER BY download_datestamp DESC"); 109 if ( $result) {113 if (!$result) { 110 114 // any downloads in the 'root' are public, and ordered by download_id DESC, by default! 111 115 $variables['parent'] = array('download_cat_access' => 0, 'download_cat_sorting' => 'download_id DESC'); 112 116 $cat_id = 0; 113 } else {114 die('oops');115 117 } 116 118 } … … 139 141 } 140 142 143 // check if we have categories at all 144 $variables['have_cats'] = dbfunction("COUNT(*)", "download_cats"); 145 141 146 // define the body panel variables 142 147 $template_panels[] = array('type' => 'body', 'name' => 'downloads', 'template' => 'main.downloads.tpl', 'locale' => "main.downloads"); -
branches/PLi-Fusion/edit_profile.php
r1335 r1509 96 96 $error .= sprintf($locale['489'], $email_domain)."<br><br>\n"; 97 97 } else { 98 if (!$mail-> Recipient($email)) {98 if (!$mail->CheckRecipient($email)) { 99 99 // mail server doesn't respond to RCPT TO message 100 100 $error .= sprintf($locale['490'], $email, $mailhost)."<br><br>\n"; -
branches/PLi-Fusion/feeds.php
r1408 r1509 70 70 $item['title'] = "<![CDATA[ ".$data['post_subject']." ]]>"; 71 71 $item['link'] = $settings['siteurl']."forum/viewthread.php?forum_id=".$data['forum_id']."&thread_id=".$data['thread_id']."&pid=".$data['post_id']."#post_".$data['post_id']; 72 $item['description'] = "<![CDATA[ ".(strlen($data['post_message']) > 500 ? (substr($data['post_message'],0,496)." ...") : $data['post_message'])." ]]>"; 72 $item['description'] = "<![CDATA[ <b>".$data['user_name']." ".$locale['401']."</b> ".(strlen($data['post_message']) > 500 ? (substr($data['post_message'],0,496)." ...") : $data['post_message'])." ]]>"; 73 // locale must be english for this to work! 74 $loc = setlocale("LC_TIME", "en_US"); 73 75 $item['pubDate'] = strftime("%a, %d %b %G %T %z", $data['post_datestamp']); 76 setlocale("LC_TIME", $loc); 74 77 $item['guid'] = $item['link']; // make the guid equal to the link, we don't have a need for permalinks 75 78 $feed[] = $item; -
branches/PLi-Fusion/files/locales/en.main.global.php
r1408 r1509 3 3 // locale : English 4 4 // locale name : main.global 5 // generated on : Thu May 15 2008, 22:16:36 CEST 5 // generated on : Wed Jul 2 2008, 11:38:41 CEST 6 // translators : ExiteCMS team,WanWizard 6 7 // ---------------------------------------------------------- 7 8 $locale['001'] = "Navigation"; -
branches/PLi-Fusion/files/locales/en.main.setup.php
r1408 r1509 3 3 // locale : English 4 4 // locale name : main.setup 5 // generated on : T hu May 15 2008, 14:41:03CEST5 // generated on : Tue Jul 1 2008, 19:42:17 CEST 6 6 // translators : ExiteCMS team,WanWizard 7 7 // ---------------------------------------------------------- -
branches/PLi-Fusion/forum/index.php
r1335 r1509 45 45 $result = dbquery( 46 46 "SELECT f.*, COUNT(t.thread_id) AS thread_count, MAX(t.thread_lastpost) AS last_post, f2.forum_name AS forum_cat_name, f2.forum_id as cat_id, u.user_id, u.user_name FROM ".$db_prefix."forums f 47 LEFTJOIN ".$db_prefix."threads t USING(forum_id)48 LEFTJOIN ".$db_prefix."forums f2 ON f.forum_cat = f2.forum_id49 LEFTJOIN ".$db_prefix."users u ON f.forum_lastuser = u.user_id47 INNER JOIN ".$db_prefix."threads t USING(forum_id) 48 INNER JOIN ".$db_prefix."forums f2 ON f.forum_cat = f2.forum_id 49 INNER JOIN ".$db_prefix."users u ON f.forum_lastuser = u.user_id 50 50 WHERE ".groupaccess('f.forum_access')." AND f.forum_cat != '0' GROUP BY forum_id ORDER BY f2.forum_order ASC, f.forum_order ASC" 51 51 ); … … 84 84 SELECT count(*) as unread 85 85 FROM ".$db_prefix."posts p 86 LEFTJOIN ".$db_prefix."threads_read tr ON p.thread_id = tr.thread_id86 INNER JOIN ".$db_prefix."threads_read tr ON p.thread_id = tr.thread_id 87 87 WHERE tr.user_id = '".$userdata['user_id']."' 88 88 AND tr.forum_id = '".$data['forum_id']."' … … 95 95 SELECT count(*) as unread 96 96 FROM ".$db_prefix."posts p 97 LEFTJOIN ".$db_prefix."threads_read tr ON p.thread_id = tr.thread_id97 INNER JOIN ".$db_prefix."threads_read tr ON p.thread_id = tr.thread_id 98 98 WHERE tr.user_id = '".$userdata['user_id']."' 99 99 AND tr.forum_id = '".$data['forum_id']."' -
branches/PLi-Fusion/forum/post.php
r1335 r1509 122 122 // if it's an image, see if we need to make a thumbnail 123 123 if (in_array($attachext, $imagetypes)) { 124 if (@ getimagesize($tmp_name) && @verify_image($tmp_name)) {124 if (@verify_image($tmp_name)) { 125 125 // it's a valid image. See if we need to generate a thumbnail 126 126 $imagefile = @getimagesize($tmp_name); … … 424 424 $preview['cc_flag'] = GeoIP_Code2Flag($settings['country']); 425 425 } else { 426 $preview['cc_flag'] = GeoIP_IP2Flag($userdata['user_ip']);426 $preview['cc_flag'] = !empty($userdata['user_cc']) ? GeoIP_Code2Flag($userdata['user_cc']) : GeoIP_IP2Flag($userdata['user_ip']); 427 427 } 428 428 } else { … … 434 434 $preview['post_edituser'] = 0; 435 435 $preview['post_ip'] = $userdata['user_ip']; 436 $preview['post_cc'] = $userdata['user_cc']; 436 437 $preview['group_names'] = array(); 437 438 $preview['group_names'][] = array('type' => 'U', 'level' => $userdata['user_level'], 'name' => getuserlevel($userdata['user_level'])); … … 599 600 } 600 601 // check if this isn't a reload, back-post, or double submit 601 if (isset($_ COOKIE['post_'.$random_id])) {602 if (isset($_SESSION['posts'][$random_id])) { 602 603 $error = $locale['458']; 603 604 } else { 604 605 if (!$flood) { 605 setcookie("post_".$random_id, "posted", time()+60*60, "/", "", "0"); 606 if (!isset($_SESSION['posts']) || !is_array($_SESSION['posts'])) $_SESSION['posts'] = array(); 607 $_SESSION['posts'][$random_id] = time()+60*60*12; 606 608 $result = dbquery("UPDATE ".$db_prefix."forums SET forum_lastpost='".time()."', forum_lastuser='".$userdata['user_id']."' WHERE forum_id='$forum_id'"); 607 609 switch ($action) { … … 616 618 break; 617 619 } 618 $result = dbquery("INSERT INTO ".$db_prefix."posts (forum_id, thread_id, post_reply_id, post_subject, post_message, post_showsig, post_smileys, post_author, post_datestamp, post_ip, post_ edituser, post_edittime) VALUES ('$forum_id', '$thread_id', '$reply_id', '$subject', '$message', '$sig', '$smileys', '".$userdata['user_id']."', '".time()."', '".USER_IP."', '0', '0')");620 $result = dbquery("INSERT INTO ".$db_prefix."posts (forum_id, thread_id, post_reply_id, post_subject, post_message, post_showsig, post_smileys, post_author, post_datestamp, post_ip, post_cc, post_edituser, post_edittime) VALUES ('$forum_id', '$thread_id', '$reply_id', '$subject', '$message', '$sig', '$smileys', '".$userdata['user_id']."', '".time()."', '".USER_IP."', '".$userdata['user_cc']."', '0', '0')"); 619 621 $post_id = mysql_insert_id(); 620 622 $result = dbquery("UPDATE ".$db_prefix."users SET user_posts=user_posts+1 WHERE user_id='".$userdata['user_id']."'"); … … 931 933 case "edit": 932 934 $variables['message'] = $pdata['post_message']; 933 $variables['org_message'] = $pdata['post_message'];934 935 break; 935 936 case "quote": 936 937 $variables['message'] = $variables['orgauthor'] == "" ? "[quote]" : "[quote=".$variables['orgauthor']."]"; 937 938 $variables['message'] .= $pdata['post_message']."[/quote]"; 938 $variables['org_message'] = "";939 939 break; 940 940 default: 941 941 $variables['message'] = ""; 942 $variables['org_message'] = "";943 }942 } 943 $variables['org_message'] = $pdata['post_message']; 944 944 $variables['post_author'] = $pdata['post_author']; 945 945 $variables['is_smiley_disabled'] = ($pdata['post_smileys'] == "0"); -
branches/PLi-Fusion/forum/viewforum.php
r1335 r1509 38 38 if (file_exists(PATH_MODULES."advertising/get_ad.php")) { 39 39 require_once PATH_MODULES."advertising/get_ad.php"; 40 $variables['advert'] = get_ad(array(1,2)); 40 $variables['ad1'] = get_ad(array(1,2,5)); 41 $variables['ad1'] = get_ad(array(4,5)); 41 42 } else { 42 $variables['advert'] = ""; 43 $variables['ad1'] = ""; 44 $variables['ad2'] = ""; 43 45 } 44 46 … … 50 52 "SELECT f.*, f2.forum_name AS forum_cat_name, f2.forum_id as forum_cat_id 51 53 FROM ".$db_prefix."forums f 52 LEFTJOIN ".$db_prefix."forums f2 ON f.forum_cat=f2.forum_id54 INNER JOIN ".$db_prefix."forums f2 ON f.forum_cat=f2.forum_id 53 55 WHERE f.forum_id='".$forum_id."'" 54 56 ); … … 90 92 SELECT p.thread_id 91 93 FROM ".$db_prefix."posts p 92 LEFTJOIN ".$db_prefix."threads_read tr ON p.thread_id = tr.thread_id94 INNER JOIN ".$db_prefix."threads_read tr ON p.thread_id = tr.thread_id 93 95 WHERE tr.user_id = '".$userdata['user_id']."' 94 96 AND tr.forum_id = '".$forum_id."' … … 110 112 SELECT count(*) as unread 111 113 FROM ".$db_prefix."posts p 112 LEFTJOIN ".$db_prefix."threads_read tr ON p.thread_id = tr.thread_id114 INNER JOIN ".$db_prefix."threads_read tr ON p.thread_id = tr.thread_id 113 115 WHERE tr.user_id = '".$userdata['user_id']."' 114 116 AND tr.forum_id = '".$forum_id."' … … 121 123 SELECT count(*) as unread 122 124 FROM ".$db_prefix."posts p 123 LEFTJOIN ".$db_prefix."threads_read tr ON p.thread_id = tr.thread_id125 INNER JOIN ".$db_prefix."threads_read tr ON p.thread_id = tr.thread_id 124 126 WHERE tr.user_id = '".$userdata['user_id']."' 125 127 AND tr.forum_id = '".$forum_id."' … … 148 150 "SELECT t.*, MAX(p.post_id) AS last_post, COUNT(p.post_id) AS thread_replies, tu1.user_name AS user_author, tu1.user_ip AS user_ip, 149 151 tu2.user_name AS user_lastuser, tu1.user_cc_code AS user_cc_code FROM ".$db_prefix."threads t 150 LEFTJOIN ".$db_prefix."posts p USING ( thread_id )151 LEFTJOIN ".$db_prefix."users tu1 ON t.thread_author = tu1.user_id152 LEFTJOIN ".$db_prefix."users tu2 ON t.thread_lastuser = tu2.user_id152 INNER JOIN ".$db_prefix."posts p USING ( thread_id ) 153 INNER JOIN ".$db_prefix."users tu1 ON t.thread_author = tu1.user_id 154 INNER JOIN ".$db_prefix."users tu2 ON t.thread_lastuser = tu2.user_id 153 155 WHERE t.forum_id = '".$forum_id."' 154 156 GROUP BY thread_id … … 173 175 SELECT count(*) as unread, MIN(p.post_id) as post_id 174 176 FROM ".$db_prefix."posts p 175 LEFTJOIN ".$db_prefix."threads_read tr ON p.thread_id = tr.thread_id177 INNER JOIN ".$db_prefix."threads_read tr ON p.thread_id = tr.thread_id 176 178 WHERE tr.user_id = '".$userdata['user_id']."' 177 179 AND tr.thread_id = '".$data['thread_id']."' -
branches/PLi-Fusion/forum/viewthread.php
r1408 r1509 86 86 "SELECT f.*, f2.forum_name AS forum_cat_name 87 87 FROM ".$db_prefix."forums f 88 LEFTJOIN ".$db_prefix."forums f2 ON f.forum_cat=f2.forum_id88 INNER JOIN ".$db_prefix."forums f2 ON f.forum_cat=f2.forum_id 89 89 WHERE f.forum_id='".$forum_id."'" 90 90 ); … … 158 158 } 159 159 // check if this isn't a reload, back-post, or double submit 160 if (isset($_ COOKIE['post_'.$random_id])) {160 if (isset($_SESSION['posts'][$random_id])) { 161 161 redirect("post.php?action=quickreply&forum_id=$forum_id&thread_id=$thread_id&post_id=0&errorcode=3"); 162 162 } else { 163 163 if (!$flood) { 164 setcookie("post_".$random_id, "posted", time() + 60*60, "/", "", "0"); 164 if (!isset($_SESSION['posts']) || !is_array($_SESSION['posts'])) $_SESSION['posts'] = array(); 165 $_SESSION['posts'][$random_id] = time()+60*60*12; 165 166 $sig = ($userdata['user_sig'] ? '1' :'0'); 166 167 $smileys = isset($_POST['disable_smileys']) ? "0" : "1"; … … 199 200 SELECT count(*) as unread, tr.thread_first_read, tr.thread_last_read 200 201 FROM ".$db_prefix."posts p 201 LEFTJOIN ".$db_prefix."threads_read tr ON p.thread_id = tr.thread_id202 INNER JOIN ".$db_prefix."threads_read tr ON p.thread_id = tr.thread_id 202 203 WHERE tr.user_id = '".$userdata['user_id']."' 203 204 AND tr.thread_id = '".$thread_id."' … … 212 213 SELECT count(*) as unread, tr.thread_first_read, tr.thread_last_read 213 214 FROM ".$db_prefix."posts p 214 LEFTJOIN ".$db_prefix."threads_read tr ON p.thread_id = tr.thread_id215 INNER JOIN ".$db_prefix."threads_read tr ON p.thread_id = tr.thread_id 215 216 WHERE tr.user_id = '".$userdata['user_id']."' 216 217 AND p.post_author != '".$userdata['user_id']."' … … 261 262 $result = dbquery( 262 263 "SELECT p.*, u.*, u2.user_name AS edit_name, u2.user_status AS edit_status FROM ".$db_prefix."posts p 263 LEFTJOIN ".$db_prefix."users u ON p.post_author = u.user_id264 INNER JOIN ".$db_prefix."users u ON p.post_author = u.user_id 264 265 LEFT JOIN ".$db_prefix."users u2 ON p.post_edituser = u2.user_id AND post_edituser > '0' 265 266 WHERE p.thread_id='$thread_id' ORDER BY post_sticky DESC, post_datestamp ASC LIMIT $rowstart,".$settings['numofthreads'] … … 267 268 $variables['posts'] = array(); 268 269 while ($data = dbarray($result)) { 270 271 // default, show no ranking information 272 $data['show_ranking'] = false; 269 273 270 274 // check for a system-post (author = 0 ), use some of the webmasters details for this … … 278 282 $data['user_sig'] = ""; 279 283 $data['user_status'] = "0"; 284 } else { 285 // check if a ranking is defined for this poster 286 $result2 = dbquery("SELECT * FROM ".$db_prefix."forum_ranking WHERE rank_posts_from <= '".$data['user_posts']."' AND rank_posts_to >= '".$data['user_posts']."' ORDER BY rank_order"); 287 while ($data2 = dbarray($result2)) { 288 // get the grouplist for this ranking 289 if (strpos($data2['rank_groups'], ",")) { 290 $groups = explode(",", $data2['rank_groups']); 291 } else { 292 if (empty($data2['rank_groups'])) { 293 $groups = ""; 294 } else { 295 $groups = array($data2['rank_groups']); 296 } 297 } 298 if (is_array($groups)) { 299 // check for group matching as well, assume a match will be found 300 $ranking_match = true; 301 foreach($groups as $group) { 302 if ($data2['rank_groups_and']) { 303 // all should match 304 if (!checkusergroup($data['post_author'], $group)) { 305 // bail out if a non-match has been found 306 $ranking_match = false; 307 break; 308 } 309 } else { 310 // one match is sufficient 311 if (checkusergroup($data['post_author'], $group)) { 312 $ranking_match = true; 313 break; 314 } 315 } 316 } 317 } else { 318 // no groups to test, must be a match on posts range 319 $ranking_match = true; 320 } 321 // if we had a match, add the ranking information to the post data 322 if ($ranking_match) { 323 $data['ranking'] = $data2; 324 $data['show_ranking'] = true; 325 break; 326 } 327 } 280 328 } 281 329 … … 301 349 $last_post_datestamp = max($data['post_datestamp'], $data['post_edittime'], $last_post_datestamp); 302 350 303 // check what options to show for this post 304 $data['user_can_edit'] = iMEMBER && $data['post_author'] != 0 && (iMOD || iSUPERADMIN || (!$tdata['thread_locked'] && $userdata['user_id'] == $data['post_author'])); 351 // check if the user can edit this post. Assume the user can't 352 $data['user_can_edit'] = false; 353 if (iMEMBER) { 354 // webmasters and forum moderators may always edit 355 if (iSUPERADMIN || iMOD) { 356 $data['user_can_edit'] = true; 357 } else { 358 // check if this is not a system post 359 if ($data['post_author'] != 0) { 360 // check if the thread is not locked 361 if (!$tdata['thread_locked']) { 362 // check if this is the users own post 363 if ($userdata['user_id'] == $data['post_author']) { 364 // check if the edit time is not expired 365 if ($settings['forum_edit_timeout'] == 0 || ($data['post_datestamp'] + $settings['forum_edit_timeout'] * 3600) > time()) { 366 $data['user_can_edit'] = true; 367 } 368 } 369 } 370 } 371 } 372 } 373 374 // check if we can show the poster's IP address 305 375 $data['show_ip'] = (iMOD || iSUPERADMIN && ($data['post_ip'] != "0.0.0.0" && file_exists(PATH_THEME."images/ip.gif"))); 306 376 … … 311 381 $data['cc_flag'] = GeoIP_Code2Flag($settings['country']); 312 382 } else { 313 $data['cc_flag'] = GeoIP_IP2Flag($data['post_ip']);383 $data['cc_flag'] = !empty($data['post_cc']) ? GeoIP_Code2Flag($data['post_cc']) : GeoIP_IP2Flag($data['post_ip']); 314 384 } 315 385 } else { … … 324 394 // user & group memberships 325 395 $data['group_names'] = array(); 396 // if a ranking is present, and a rank title is defined, display that first 397 if (isset($data['ranking']) && !empty($data['ranking']['rank_title']) && !$data['ranking']['rank_tooltip']) { 398 $data['group_names'][] = array('type' => 'R', 'color' => $data['ranking']['rank_color'], 'name' => $data['ranking']['rank_title']); 399 } 400 // display the standard user level next 326 401 $data['group_names'][] = array('type' => 'U', 'level' => $data['user_level'], 'name' => getuserlevel($data['user_level'])); 327 402 -
branches/PLi-Fusion/getfile.php
r931 r1509 311 311 // parameter validation 312 312 if (!isset($file_id) || !isNum($file_id)) { 313 die("<div style='font-family:Verdana;font-size:11px;text-align:center;'><b>Invalid or missing file ID.</b></div>");313 terminate("<b>Invalid or missing file ID.</b>"); 314 314 } 315 315 if (!isset($type)) { 316 die("<div style='font-family:Verdana;font-size:11px;text-align:center;'><b>Missing file type.</b></div>");316 terminate("<b>Missing file type.</b>"); 317 317 } 318 318 … … 330 330 $attachment = dbarray(dbquery("SELECT * FROM ".$db_prefix."forum_attachments WHERE attach_id='$file_id'")); 331 331 if (!is_array($attachment)) { 332 die("<div style='font-family:Verdana;font-size:11px;text-align:center;'><b>Invalid file ID.</b></div>");332 terminate("<b>Invalid file ID.</b>"); 333 333 } 334 334 // check if the post this attachment belongs to exists, if so retrieve the information 335 335 $post = dbarray(dbquery("SELECT * FROM ".$db_prefix."posts WHERE thread_id = '".$attachment['thread_id']."' AND post_id='".$attachment['post_id']."'")); 336 336 if (!is_array($post)) { 337 die("<div style='font-family:Verdana;font-size:11px;text-align:center;'><b>Invalid file ID.</b></div>");337 terminate("<b>Invalid file ID.</b>"); 338 338 } 339 339 $forum = dbarray(dbquery("SELECT * FROM ".$db_prefix."forums WHERE forum_id = '".$post['forum_id']."'")); 340 340 if (!is_array($forum)) { 341 die("<div style='font-family:Verdana;font-size:11px;text-align:center;'><b>Invalid file ID.</b></div>");341 terminate("<b>Invalid file ID.</b>"); 342 342 } 343 343 // if logged in, check if the user has access to this file. if not, print an error and give up 344 344 if (iMEMBER && !getfilegroup($forum['forum_access'], $userdata['user_level'])) { 345 die("<div style='font-family:Verdana;font-size:11px;text-align:center;'><b>You don't have access to the requested file ID.</b></div>");345 terminate("<b>You don't have access to the requested file ID.</b>"); 346 346 } 347 347 // if not logged in, and authorisation required, check if userid and password is given and valid … … 362 362 $attachment = dbarray(dbquery("SELECT * FROM ".$db_prefix."pm_attachments WHERE pmattach_id='$file_id'")); 363 363 if (!is_array($attachment)) { 364 die("<div style='font-family:Verdana;font-size:11px;text-align:center;'><b>Invalid file ID.</b></div>");364 terminate("<b>Invalid file ID.</b>"); 365 365 } 366 366 // if not logged in, check if userid and password is given and valid (authorisation is required!) … … 372 372 $result = dbquery("SELECT * FROM ".$db_prefix."pm_index WHERE pm_id = '".$attachment['pm_id']."' AND pmindex_user_id = '".$userdata['user_id']."'"); 373 373 if (dbrows($result) == 0) { 374 die("<div style='font-family:Verdana;font-size:11px;text-align:center;'><b>You don't have access to the requested file ID.</b></div>");374 terminate("<b>You don't have access to the requested file ID.</b>"); 375 375 } 376 376 // define the required parameters for the download … … 381 381 382 382 default: 383 die("< div style='font-family:Verdana;font-size:11px;text-align:center;'><b>Invalid file type.</b></div>");383 die("<b>Invalid file type.</b>"); 384 384 } 385 385 -
branches/PLi-Fusion/includes/core_functions.php
r1408 r1509 14 14 +----------------------------------------------------*/ 15 15 if (eregi("core_functions.php", $_SERVER['PHP_SELF'])) die(); 16 17 // disable error reporting, we don't want to give anything away 18 error_reporting(E_USER_ERROR); 16 19 17 20 // code to calculate the page loading time, this can be used … … 80 83 define("PATH_ADMIN", PATH_ROOT."administration/"); 81 84 define("PATH_THEMES", PATH_ROOT."themes/"); 82 define("PATH_PHOTOS", PATH_ROOT."images/ photoalbum/");85 define("PATH_PHOTOS", PATH_ROOT."images/gallery/"); 83 86 define("PATH_IMAGES", PATH_ROOT."images/"); 84 87 define("PATH_IMAGES_A", PATH_IMAGES."articles/"); … … 97 100 98 101 // load the config file 99 if (file_exists(PATH_ROOT."config.php")) { 100 @include_once PATH_ROOT."config.php"; 102 @include_once PATH_ROOT."configpath.php"; 103 if (substr(CONFIG_PATH,0,1) == "/") { 104 if(is_file(CONFIG_PATH."/config.php")) { 105 @include_once CONFIG_PATH."/config.php"; 106 } 107 } else { 108 if(is_file(PATH_ROOT.CONFIG_PATH."/config.php")) { 109 @include_once PATH_ROOT.CONFIG_PATH."/config.php"; 110 } 101 111 } 102 112 103 113 // if config.php is absent or empty, bail out with an error 104 if (!isset($db_name)) die('FATAL ERROR: config file is missing. Check the documentationon how to run the setup');114 if (!isset($db_name)) terminate('FATAL ERROR: config file is missing. Check our Wiki at http://exitecms.exite.eu on how to run the setup'); 105 115 106 116 // load the database functions, and establish a database connection … … 186 196 require_once PATH_INCLUDES."user_functions.php"; 187 197 188 // activate query log debugging if set 189 if ($settings['debug_querylog'] != "") { 190 $_db_log = checkgroup($settings['debug_querylog']); 198 // set the query log debugging switch, enable error reporting if needed 199 $_db_log = checkgroup($settings['debug_querylog'], false); 200 // if debugging is requested, also activate some other debugging features 201 if ($_db_log) { 202 error_reporting(E_ALL); 191 203 } 192 204 … … 221 233 222 234 // image types we can generate a thumbnail from 223 $thumbtypes = array(".gif",".jpg",".jpeg",".png", );235 $thumbtypes = array(".gif",".jpg",".jpeg",".png",".bmp", ".psd"); 224 236 225 237 // debug function, handy to print a standard debug text … … 227 239 228 240 if (is_array($text)) { 241 echo "<br /><hr /><br /><pre>"; print_r($text); echo "</pre><br /><hr /><br />"; 242 } elseif (is_object($text)) { 229 243 echo "<br /><hr /><br /><pre>"; print_r($text); echo "</pre><br /><hr /><br />"; 230 244 } else { … … 352 366 } 353 367 354 // Parse smiley bbcode into HTML images 355 function parsesmileys($message) { 356 $smiley = array( 357 "#\:oops\:#si" => "<img src='".IMAGES."smiley/more/redface.gif' alt='smiley' />", 358 "#\;\)#si" => "<img src='".IMAGES."smiley/wink.gif' alt='smiley' />", 359 "#\:\(#si" => "<img src='".IMAGES."smiley/sad.gif' alt='smiley' />", 360 "#\:\|#si" => "<img src='".IMAGES."smiley/frown.gif' alt='smiley' />", 361 "#\:o#si" => "<img src='".IMAGES."smiley/shock.gif' alt='smiley' />", 362 "#\:p#si" => "<img src='".IMAGES."smiley/pfft.gif' alt='smiley' />", 363 "#b\)#si" => "<img src='".IMAGES."smiley/cool.gif' alt='smiley' />", 364 "#\:d#si" => "<img src='".IMAGES."smiley/grin.gif' alt='smiley' />", 365 "#\:@#si" => "<img src='".IMAGES."smiley/angry.gif' alt='smiley' />", 366 "#\:thumbleft#si" => "<img src='".IMAGES."smiley/more/icon_thumleft.gif' alt='smiley' />", 367 "#\:thumbright#si" => "<img src='".IMAGES."smiley/more/icon_thumright.gif' alt='smiley' />", 368 "#=D>#si" => "<img src='".IMAGES."smiley/more/eusa_clap.gif' alt='smiley' />", 369 "#\\\:D/#si" => "<img src='".IMAGES."smiley/more/eusa_dance.gif' alt='smiley' />", 370 "#\:D#si" => "<img src='".IMAGES."smiley/more/biggrin.gif' alt='smiley' />", 371 "#\:smt014#si" => "<img src='".IMAGES."smiley/more/014.gif' alt='smiley' />", 372 "#\:boring#si" => "<img src='".IMAGES."smiley/more/015.gif' alt='smiley' />", 373 "#\:smt018#si" => "<img src='".IMAGES."smiley/more/018.gif' alt='smiley' />", 374 "#\:smt022#si" => "<img src='".IMAGES."smiley/more/022.gif' alt='smiley' />", 375 "#\:smt071#si" => "<img src='".IMAGES."smiley/more/071.gif' alt='smiley' />", 376 "#\:smt102#si" => "<img src='".IMAGES."smiley/more/102.gif' alt='smiley' />", 377 "#\:smt100#si" => "<img src='".IMAGES."smiley/more/100.gif' alt='smiley' />", 378 "#\:\-D#si" => "<img src='".IMAGES."smiley/more/003.gif' alt='smiley' />", 379 "#\:\-\)#si" => "<img src='".IMAGES."smiley/more/001.gif' alt='smiley' />", 380 "#\:\(#si" => "<img src='".IMAGES."smiley/more/sad.gif' alt='smiley' />", 381 "#\:o#si" => "<img src='".IMAGES."smiley/more/surprised.gif' alt='smiley' />", 382 "#\:shock\:#si" => "<img src='".IMAGES."smiley/more/shock.gif' alt='smiley' />", 383 "#8\)#si" => "<img src='".IMAGES."smiley/more/cool.gif' alt='smiley' />", 384 "#\:lol\:#si" => "<img src='".IMAGES."smiley/more/lol.gif' alt='smiley' />", 385 "#\:x#si" => "<img src='".IMAGES."smiley/more/mad.gif' alt='smiley' />", 386 "#\:\-x#si" => "<img src='".IMAGES."smiley/more/icon_mad.gif' alt='smiley' />", 387 "#\:P#si" => "<img src='".IMAGES."smiley/more/icon_razz.gif' alt='smiley' />", 388 "#\:razz\:#si" => "<img src='".IMAGES."smiley/more/razz.gif' alt='smiley' />", 389 "#\:cry\:#si" => "<img src='".IMAGES."smiley/more/cry.gif' alt='smiley' />", 390 "#\:evil\:#si" => "<img src='".IMAGES."smiley/more/evil.gif' alt='smiley' />", 391 "#\:twisted\:#si" => "<img src='".IMAGES."smiley/more/icon_twisted.gif' alt='smiley' />", 392 "#\:roll\:#si" => "<img src='".IMAGES."smiley/more/rolleyes.gif' alt='smiley' />", 393 "#\:wink\:#si" => "<img src='".IMAGES."smiley/more/wink.gif' alt='smiley' />", 394 "#\;\-\)#si" => "<img src='".IMAGES."smiley/more/002.gif' alt='smiley' />", 395 "#\:\!\:#si" => "<img src='".IMAGES."smiley/more/exclaim.gif' alt='smiley' />", 396 "#\:\?\:#si" => "<img src='".IMAGES."smiley/more/question.gif' alt='smiley' />", 397 "#\:\?#si" => "<img src='".IMAGES."smiley/more/confused.gif' alt='smiley' />", 398 "#\:idea\:#si" => "<img src='".IMAGES."smiley/more/idea.gif' alt='smiley' />", 399 "#\:arrow\:#si" => "<img src='".IMAGES."smiley/more/arrow.gif' alt='smiley' />", 400 "#\:\|#si" => "<img src='".IMAGES."smiley/more/neutral.gif' alt='smiley' />", 401 "#\:mrgreen\:#si" => "<img src='".IMAGES."smiley/more/icon_mrgreen.gif' alt='smiley' />", 402 "#\:badgrin\:#si" => "<img src='".IMAGES."smiley/more/badgrin.gif' alt='smiley' />", 403 "#\:doubt\:#si" => "<img src='".IMAGES."smiley/more/doubt.gif' alt='smiley' />", 404 "#\#\-o#si" => "<img src='".IMAGES."smiley/more/eusa_doh.gif' alt='smiley' />", 405 "#\=P\~#si" => "<img src='".IMAGES."smiley/more/eusa_drool.gif' alt='smiley' />", 406 "#\:\^o#si" => "<img src='".IMAGES."smiley/more/eusa_liar.gif' alt='smiley' />", 407 "#\[\-X#si" => "<img src='".IMAGES."smiley/more/eusa_naughty.gif' alt='smiley' />", 408 "#\[\-o\<\;#si" => "<img src='".IMAGES."smiley/more/eusa_pray.gif' alt='smiley' />", 409 "#8\-\[#si" => "<img src='".IMAGES."smiley/more/eusa_shifty.gif' alt='smiley' />", 410 "#\[\-\(#si" => "<img src='".IMAGES."smiley/more/eusa_snooty.gif' alt='smiley' />", 411 "#\:\-k#si" => "<img src='".IMAGES."smiley/more/eusa_think.gif' alt='smiley' />", 412 "#\]\(\*\,\)#si" => "<img src='".IMAGES."smiley/more/eusa_wall.gif' alt='smiley' />", 413 // "#\:\-\"#si" => "<img src='".IMAGES."smiley/more/eusa_whistle.gif' alt='smiley' />", 414 "#O\:\)#si" => "<img src='".IMAGES."smiley/more/eusa_angel.gif' alt='smiley' />", 415 "#\=\;#si" => "<img src='".IMAGES."smiley/more/eusa_hand.gif' alt='smiley' />", 416 "#\:\-\&#si" => "<img src='".IMAGES."smiley/more/eusa_sick.gif' alt='smiley' />", 417 "#\:\-\(\{\|\=#si" => "<img src='".IMAGES."smiley/more/eusa_boohoo.gif' alt='smiley' />", 418 "#\:\-\$#si" => "<img src='".IMAGES."smiley/more/eusa_shhh.gif' alt='smiley' />", 419 "#\:\-s#si" => "<img src='".IMAGES."smiley/more/eusa_eh.gif' alt='smiley' />", 420 "#\:\-\##si" => "<img src='".IMAGES."smiley/more/eusa_silenced.gif' alt='smiley' />", 421 "#\:smt004#si" => "<img src='".IMAGES."smiley/more/004.gif' alt='smiley' />", 422 "#\:smt005#si" => "<img src='".IMAGES."smiley/more/005.gif' alt='smiley' />", 423 "#\:smt006#si" => "<img src='".IMAGES."smiley/more/006.gif' alt='smiley' />", 424 "#\:smt007#si" => "<img src='".IMAGES."smiley/more/007.gif' alt='smiley' />", 425 "#\:smt008#si" => "<img src='".IMAGES."smiley/more/008.gif' alt='smiley' />", 426 "#\:smt009#si" => "<img src='".IMAGES."smiley/more/009.gif' alt='smiley' />", 427 "#\:smt010#si" => "<img src='".IMAGES."smiley/more/010.gif' alt='smiley' />", 428 "#\:smt011#si" => "<img src='".IMAGES."smiley/more/011.gif' alt='smiley' />", 429 "#\:smt012#si" => "<img src='".IMAGES."smiley/more/012.gif' alt='smiley' />", 430 "#\:smt013#si" => "<img src='".IMAGES."smiley/more/013.gif' alt='smiley' />", 431 "#\:smt016#si" => "<img src='".IMAGES."smiley/more/016.gif' alt='smiley' />", 432 "#\:smt017#si" => "<img src='".IMAGES."smiley/more/017.gif' alt='smiley' />", 433 "#\:smt019#si" => "<img src='".IMAGES."smiley/more/019.gif' alt='smiley' />", 434 "#\:smt020#si" => "<img src='".IMAGES."smiley/more/020.gif' alt='smiley' />", 435 "#\:smt021#si" => "<img src='".IMAGES."smiley/more/021.gif' alt='smiley' />", 436 "#\:smt023#si" => "<img src='".IMAGES."smiley/more/023.gif' alt='smiley' />", 437 "#\:smt024#si" => "<img src='".IMAGES."smiley/more/024.gif' alt='smiley' />", 438 "#\:smt025#si" => "<img src='".IMAGES."smiley/more/025.gif' alt='smiley' />", 439 "#\:smt026#si" => "<img src='".IMAGES."smiley/more/026.gif' alt='smiley' />", 440 "#\:smt027#si" => "<img src='".IMAGES."smiley/more/027.gif' alt='smiley' />", 441 "#\:smt028#si" => "<img src='".IMAGES."smiley/more/028.gif' alt='smiley' />", 442 "#\:smt029#si" => "<img src='".IMAGES."smiley/more/029.gif' alt='smiley' />", 443 "#\:smt030#si" => "<img src='".IMAGES."smiley/more/030.gif' alt='smiley' />", 444 "#\:smt031#si" => "<img src='".IMAGES."smiley/more/031.gif' alt='smiley' />", 445 "#\:smt032#si" => "<img src='".IMAGES."smiley/more/032.gif' alt='smiley' />", 446 "#\:smt033#si" => "<img src='".IMAGES."smiley/more/033.gif' alt='smiley' />", 447 "#\:smt034#si" => "<img src='".IMAGES."smiley/more/034.gif' alt='smiley' />", 448 "#\:smt035#si" => "<img src='".IMAGES."smiley/more/035.gif' alt='smiley' />", 449 "#\:smt036#si" => "<img src='".IMAGES."smiley/more/036.gif' alt='smiley' />", 450 "#\:smt037#si" => "<img src='".IMAGES."smiley/more/037.gif' alt='smiley' />", 451 "#\:smt038#si" => "<img src='".IMAGES."smiley/more/038.gif' alt='smiley' />", 452 "#\:smt039#si" => "<img src='".IMAGES."smiley/more/039.gif' alt='smiley' />", 453 "#\:smt040#si" => "<img src='".IMAGES."smiley/more/040.gif' alt='smiley' />", 454 "#\:smt041#si" => "<img src='".IMAGES."smiley/more/041.gif' alt='smiley' />", 455 "#\:smt042#si" => "<img src='".IMAGES."smiley/more/042.gif' alt='smiley' />", 456 "#\:smt043#si" => "<img src='".IMAGES."smiley/more/043.gif' alt='smiley' />", 457 "#\:smt044#si" => "<img src='".IMAGES."smiley/more/044.gif' alt='smiley' />", 458 "#\:smt045#si" => "<img src='".IMAGES."smiley/more/045.gif' alt='smiley' />", 459 "#\:smt046#si" => "<img src='".IMAGES."smiley/more/046.gif' alt='smiley' />", 460 "#\:smt047#si" => "<img src='".IMAGES."smiley/more/047.gif' alt='smiley' />", 461 "#\:smt048#si" => "<img src='".IMAGES."smiley/more/048.gif' alt='smiley' />", 462 "#\:smt049#si" => "<img src='".IMAGES."smiley/more/049.gif' alt='smiley' />", 463 "#\:smt050#si" => "<img src='".IMAGES."smiley/more/050.gif' alt='smiley' />", 464 "#\:smt051#si" => "<img src='".IMAGES."smiley/more/051.gif' alt='smiley' />", 465 "#\:smt052#si" => "<img src='".IMAGES."smiley/more/052.gif' alt='smiley' />", 466 "#\:smt053#si" => "<img src='".IMAGES."smiley/more/053.gif' alt='smiley' />", 467 "#\:smt054#si" => "<img src='".IMAGES."smiley/more/054.gif' alt='smiley' />", 468 "#\:smt055#si" => "<img src='".IMAGES."smiley/more/055.gif' alt='smiley' />", 469 "#\:smt056#si" => "<img src='".IMAGES."smiley/more/056.gif' alt='smiley' />", 470 "#\:smt057#si" => "<img src='".IMAGES."smiley/more/057.gif' alt='smiley' />", 471 "#\:smt058#si" => "<img src='".IMAGES."smiley/more/058.gif' alt='smiley' />", 472 "#\:smt059#si" => "<img src='".IMAGES."smiley/more/059.gif' alt='smiley' />", 473 "#\:smt060#si" => "<img src='".IMAGES."smiley/more/060.gif' alt='smiley' />", 474 "#\:smt061#si" => "<img src='".IMAGES."smiley/more/061.gif' alt='smiley' />", 475 "#\:smt062#si" => "<img src='".IMAGES."smiley/more/062.gif' alt='smiley' />", 476 "#\:smt063#si" => "<img src='".IMAGES."smiley/more/063.gif' alt='smiley' />", 477 "#\:smt064#si" => "<img src='".IMAGES."smiley/more/064.gif' alt='smiley' />", 478 "#\:smt065#si" => "<img src='".IMAGES."smiley/more/065.gif' alt='smiley' />", 479 "#\:smt066#si" => "<img src='".IMAGES."smiley/more/066.gif' alt='smiley' />", 480 "#\:smt067#si" => "<img src='".IMAGES."smiley/more/067.gif' alt='smiley' />", 481 "#\:smt068#si" => "<img src='".IMAGES."smiley/more/068.gif' alt='smiley' />", 482 "#\:smt069#si" => "<img src='".IMAGES."smiley/more/069.gif' alt='smiley' />", 483 "#\:smt070#si" => "<img src='".IMAGES."smiley/more/070.gif' alt='smiley' />", 484 "#\:smt073#si" => "<img src='".IMAGES."smiley/more/073.gif' alt='smiley' />", 485 "#\:smt074#si" => "<img src='".IMAGES."smiley/more/074.gif' alt='smiley' />", 486 "#\:smt075#si" => "<img src='".IMAGES."smiley/more/075.gif' alt='smiley' />", 487 "#\:smt076#si" => "<img src='".IMAGES."smiley/more/076.gif' alt='smiley' />", 488 "#\:smt077#si" => "<img src='".IMAGES."smiley/more/077.gif' alt='smiley' />", 489 "#\:smt078#si" => "<img src='".IMAGES."smiley/more/078.gif' alt='smiley' />", 490 "#\:smt079#si" => "<img src='".IMAGES."smiley/more/079.gif' alt='smiley' />", 491 "#\:smt080#si" => "<img src='".IMAGES."smiley/more/080.gif' alt='smiley' />", 492 "#\:smt081#si" => "<img src='".IMAGES."smiley/more/081.gif' alt='smiley' />", 493 "#\:smt082#si" => "<img src='".IMAGES."smiley/more/082.gif' alt='smiley' />", 494 "#\:smt083#si" => "<img src='".IMAGES."smiley/more/083.gif' alt='smiley' />", 495 "#\:smt084#si" => "<img src='".IMAGES."smiley/more/084.gif' alt='smiley' />", 496 "#\:smt085#si" => "<img src='".IMAGES."smiley/more/085.gif' alt='smiley' />", 497 "#\:smt086#si" => "<img src='".IMAGES."smiley/more/086.gif' alt='smiley' />", 498 "#\:smt087#si" => "<img src='".IMAGES."smiley/more/087.gif' alt='smiley' />", 499 "#\:smt088#si" => "<img src='".IMAGES."smiley/more/088.gif' alt='smiley' />", 500 "#\:smt089#si" => "<img src='".IMAGES."smiley/more/089.gif' alt='smiley' />", 501 "#\:smt090#si" => "<img src='".IMAGES."smiley/more/090.gif' alt='smiley' />", 502 "#\:smt091#si" => "<img src='".IMAGES."smiley/more/091.gif' alt='smiley' />", 503 "#\:smt092#si" => "<img src='".IMAGES."smiley/more/092.gif' alt='smiley' />", 504 "#\:smt093#si" => "<img src='".IMAGES."smiley/more/093.gif' alt='smiley' />", 505 "#\:smt084#si" => "<img src='".IMAGES."smiley/more/094.gif' alt='smiley' />", 506 "#\:smt095#si" => "<img src='".IMAGES."smiley/more/095.gif' alt='smiley' />", 507 "#\:smt096#si" => "<img src='".IMAGES."smiley/more/096.gif' alt='smiley' />", 508 "#\:smt097#si" => "<img src='".IMAGES."smiley/more/097.gif' alt='smiley' />", 509 "#\:smt098#si" => "<img src='".IMAGES."smiley/more/098.gif' alt='smiley' />", 510 "#\:smt099#si" => "<img src='".IMAGES."smiley/more/099.gif' alt='smiley' />", 511 "#\:smt101#si" => "<img src='".IMAGES."smiley/more/101.gif' alt='smiley' />", 512 "#\:smt103#si" => "<img src='".IMAGES."smiley/more/103.gif' alt='smiley' />", 513 "#\:smt104#si" => "<img src='".IMAGES."smiley/more/104.gif' alt='smiley' />", 514 "#\:smt105#si" => "<img src='".IMAGES."smiley/more/105.gif' alt='smiley' />", 515 "#\:smt106#si" => "<img src='".IMAGES."smiley/more/106.gif' alt='smiley' />", 516 "#\:smt107#si" => "<img src='".IMAGES."smiley/more/107.gif' alt='smiley' />", 517 "#\:smt108#si" => "<img src='".IMAGES."smiley/more/108.gif' alt='smiley' />", 518 "#\:smt109#si" => "<img src='".IMAGES."smiley/more/109.gif' alt='smiley' />", 519 "#\:smt110#si" => "<img src='".IMAGES."smiley/more/110.gif' alt='smiley' />", 520 "#\:smt111#si" => "<img src='".IMAGES."smiley/more/111.gif' alt='smiley' />", 521 "#\:smt112#si" => "<img src='".IMAGES."smiley/more/112.gif' alt='smiley' />", 522 "#\:smt113#si" => "<img src='".IMAGES."smiley/more/113.gif' alt='smiley' />", 523 "#\:smt114#si" => "<img src='".IMAGES."smiley/more/114.gif' alt='smiley' />", 524 "#\:smt115#si" => "<img src='".IMAGES."smiley/more/115.gif' alt='smiley' />", 525 "#\:smt116#si" => "<img src='".IMAGES."smiley/more/116.gif' alt='smiley' />", 526 "#\:smt117#si" => "<img src='".IMAGES."smiley/more/117.gif' alt='smiley' />", 527 "#\:smt118#si" => "<img src='".IMAGES."smiley/more/118.gif' alt='smiley' />", 528 "#\:smt119#si" => "<img src='".IMAGES."smiley/more/119.gif' alt='smiley' />", 529 "#\:smt120#si" => "<img src='".IMAGES."smiley/more/120.gif' alt='smiley' />", 530 "#\:\)#si" => "<img src='".IMAGES."smiley/smile.gif' alt='smiley' />" 531 ); 532 foreach($smiley as $key=>$smiley_img) { 533 $message = preg_replace($key, $smiley_img, $message); 534 } 535 return $message; 536 } 537 538 // internal function: preg_replace_callback for parseubb, to validate the URL found in [url] 539 function _parseubb_checkurl($matches) { 540 541 // if it's a old-style bbcode (not [url=][/url] but [url][/url]), convert it before checking 542 if (empty($matches[2])) { 543 $matches[2] = $matches[3]; 544 } 368 // validate an IP address 369 function isIP($value){ 370 return preg_match("/^([1-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(\.([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])){3}$/", $value); 371 } 372 373 // validate an URL 374 function isURL($value, $onlyhttp=false) { 545 375 546 376 // Build the regex to check the URL 547 $scheme = "(https?|s?ftp|mailto|svn|cvs|callto|mms|skype)\:\/\/"; // SCHEMES supported 377 if ($onlyhttp) { 378 $scheme = "(https?)\:\/\/"; // HTTP SCHEMES supported 379 } else { 380 $scheme = "(https?|s?ftp|mailto|svn|cvs|callto|mms|skype)\:\/\/"; // ALL SCHEMES supported 381 } 548 382 $urlregex = "^(".$scheme.")?"; // make the scheme optional 549 383 $urlregex .= "([a-z0-9+!*(),;?&=\$_.-]+(\:[a-z0-9+!*(),;?&=\$_.-]+)?@)?"; // USERID + PASSWORD (optional) … … 553 387 $urlregex .= "(\?[a-z+&\$_.-][a-z0-9;:@/&%=+\$_.-]*)?"; // GET querystring (optional) 554 388 $urlregex .= "(#[a-z_.-][a-z0-9+\$_.-]*)?\$"; // ANCHOR (optional) 389 // validate the URL 390 return eregi($urlregex, $value); 391 } 392 393 // Parse smiley bbcode into HTML images 394 function parsesmileys($message) { 395 $smiley = array( 396 "\:oops\:" => "<img src='".IMAGES."smiley/more/redface.gif' alt='smiley' />", 397 "\:doubt\:" => "<img src='".IMAGES."smiley/more/doubt.gif' alt='smiley' />", 398 "\:thumbleft" => "<img src='".IMAGES."smiley/more/icon_thumleft.gif' alt='smiley' />", 399 "\:thumbright" => "<img src='".IMAGES."smiley/more/icon_thumright.gif' alt='smiley' />", 400 "\:smt004" => "<img src='".IMAGES."smiley/more/004.gif' alt='smiley' />", 401 "\:smt005" => "<img src='".IMAGES."smiley/more/005.gif' alt='smiley' />", 402 "\:smt006" => "<img src='".IMAGES."smiley/more/006.gif' alt='smiley' />", 403 "\:smt007" => "<img src='".IMAGES."smiley/more/007.gif' alt='smiley' />", 404 "\:smt008" => "<img src='".IMAGES."smiley/more/008.gif' alt='smiley' />", 405 "\:smt009" => "<img src='".IMAGES."smiley/more/009.gif' alt='smiley' />", 406 "\:smt010" => "<img src='".IMAGES."smiley/more/010.gif' alt='smiley' />", 407 "\:smt011" => "<img src='".IMAGES."smiley/more/011.gif' alt='smiley' />", 408 "\:smt012" => "<img src='".IMAGES."smiley/more/012.gif' alt='smiley' />", 409 "\:smt013" => "<img src='".IMAGES."smiley/more/013.gif' alt='smiley' />", 410 "\:smt014" => "<img src='".IMAGES."smiley/more/014.gif' alt='smiley' />", 411 "\:smt016" => "<img src='".IMAGES."smiley/more/016.gif' alt='smiley' />", 412 "\:smt017" => "<img src='".IMAGES."smiley/more/017.gif' alt='smiley' />", 413 "\:smt018" => "<img src='".IMAGES."smiley/more/018.gif' alt='smiley' />", 414 "\:smt019" => "<img src='".IMAGES."smiley/more/019.gif' alt='smiley' />", 415 "\:smt020" => "<img src='".IMAGES."smiley/more/020.gif' alt='smiley' />", 416 "\:smt021" => "<img src='".IMAGES."smiley/more/021.gif' alt='smiley' />", 417 "\:smt022" => "<img src='".IMAGES."smiley/more/022.gif' alt='smiley' />", 418 "\:smt023" => "<img src='".IMAGES."smiley/more/023.gif' alt='smiley' />", 419 "\:smt024" => "<img src='".IMAGES."smiley/more/024.gif' alt='smiley' />", 420 "\:smt025" => "<img src='".IMAGES."smiley/more/025.gif' alt='smiley' />", 421 "\:smt026" => "<img src='".IMAGES."smiley/more/026.gif' alt='smiley' />", 422 "\:smt027" => "<img src='".IMAGES."smiley/more/027.gif' alt='smiley' />", 423 "\:smt028" => "<img src='".IMAGES."smiley/more/028.gif' alt='smiley' />", 424 "\:smt029" => "<img src='".IMAGES."smiley/more/029.gif' alt='smiley' />", 425 "\:smt030" => "<img src='".IMAGES."smiley/more/030.gif' alt='smiley' />", 426 "\:smt031" => "<img src='".IMAGES."smiley/more/031.gif' alt='smiley' />", 427 "\:smt032" => "<img src='".IMAGES."smiley/more/032.gif' alt='smiley' />", 428 "\:smt033" => "<img src='".IMAGES."smiley/more/033.gif' alt='smiley' />", 429 "\:smt034" => "<img src='".IMAGES."smiley/more/034.gif' alt='smiley' />", 430 "\:smt035" => "<img src='".IMAGES."smiley/more/035.gif' alt='smiley' />", 431 "\:smt036" => "<img src='".IMAGES."smiley/more/036.gif' alt='smiley' />", 432 "\:smt037" => "<img src='".IMAGES."smiley/more/037.gif' alt='smiley' />", 433 "\:smt038" => "<img src='".IMAGES."smiley/more/038.gif' alt='smiley' />", 434 "\:smt039" => "<img src='".IMAGES."smiley/more/039.gif' alt='smiley' />", 435 "\:smt040" => "<img src='".IMAGES."smiley/more/040.gif' alt='smiley' />", 436 "\:smt041" => "<img src='".IMAGES."smiley/more/041.gif' alt='smiley' />", 437 "\:smt042" => "<img src='".IMAGES."smiley/more/042.gif' alt='smiley' />", 438 "\:smt043" => "<img src='".IMAGES."smiley/more/043.gif' alt='smiley' />", 439 "\:smt044" => "<img src='".IMAGES."smiley/more/044.gif' alt='smiley' />", 440 "\:smt045" => "<img src='".IMAGES."smiley/more/045.gif' alt='smiley' />", 441 "\:smt046" => "<img src='".IMAGES."smiley/more/046.gif' alt='smiley' />", 442 "\:smt047" => "<img src='".IMAGES."smiley/more/047.gif' alt='smiley' />", 443 "\:smt048" => "<img src='".IMAGES."smiley/more/048.gif' alt='smiley' />", 444 "\:smt049" => "<img src='".IMAGES."smiley/more/049.gif' alt='smiley' />", 445 "\:smt050" => "<img src='".IMAGES."smiley/more/050.gif' alt='smiley' />", 446 "\:smt051" => "<img src='".IMAGES."smiley/more/051.gif' alt='smiley' />", 447 "\:smt052" => "<img src='".IMAGES."smiley/more/052.gif' alt='smiley' />", 448 "\:smt053" => "<img src='".IMAGES."smiley/more/053.gif' alt='smiley' />", 449 "\:smt054" => "<img src='".IMAGES."smiley/more/054.gif' alt='smiley' />", 450 "\:smt055" => "<img src='".IMAGES."smiley/more/055.gif' alt='smiley' />", 451 "\:smt056" => "<img src='".IMAGES."smiley/more/056.gif' alt='smiley' />", 452 "\:smt057" => "<img src='".IMAGES."smiley/more/057.gif' alt='smiley' />", 453 "\:smt058" => "<img src='".IMAGES."smiley/more/058.gif' alt='smiley' />", 454 "\:smt059" => "<img src='".IMAGES."smiley/more/059.gif' alt='smiley' />", 455 "\:smt060" => "<img src='".IMAGES."smiley/more/060.gif' alt='smiley' />", 456 "\:smt061" => "<img src='".IMAGES."smiley/more/061.gif' alt='smiley' />", 457 "\:smt062" => "<img src='".IMAGES."smiley/more/062.gif' alt='smiley' />", 458 "\:smt063" => "<img src='".IMAGES."smiley/more/063.gif' alt='smiley' />", 459 "\:smt064" => "<img src='".IMAGES."smiley/more/064.gif' alt='smiley' />", 460 "\:smt065" => "<img src='".IMAGES."smiley/more/065.gif' alt='smiley' />", 461 "\:smt066" => "<img src='".IMAGES."smiley/more/066.gif' alt='smiley' />", 462 "\:smt067" => "<img src='".IMAGES."smiley/more/067.gif' alt='smiley' />", 463 "\:smt068" => "<img src='".IMAGES."smiley/more/068.gif' alt='smiley' />", 464 "\:smt069" => "<img src='".IMAGES."smiley/more/069.gif' alt='smiley' />", 465 "\:smt070" => "<img src='".IMAGES."smiley/more/070.gif' alt='smiley' />", 466 "\:smt073" => "<img src='".IMAGES."smiley/more/073.gif' alt='smiley' />", 467 "\:smt074" => "<img src='".IMAGES."smiley/more/074.gif' alt='smiley' />", 468 "\:smt075" => "<img src='".IMAGES."smiley/more/075.gif' alt='smiley' />", 469 "\:smt076" => "<img src='".IMAGES."smiley/more/076.gif' alt='smiley' />", 470 "\:smt077" => "<img src='".IMAGES."smiley/more/077.gif' alt='smiley' />", 471 "\:smt078" => "<img src='".IMAGES."smiley/more/078.gif' alt='smiley' />", 472 "\:smt079" => "<img src='".IMAGES."smiley/more/079.gif' alt='smiley' />", 473 "\:smt080" => "<img src='".IMAGES."smiley/more/080.gif' alt='smiley' />", 474 "\:smt081" => "<img src='".IMAGES."smiley/more/081.gif' alt='smiley' />", 475 "\:smt082" => "<img src='".IMAGES."smiley/more/082.gif' alt='smiley' />", 476 "\:smt083" => "<img src='".IMAGES."smiley/more/083.gif' alt='smiley' />", 477 "\:smt084" => "<img src='".IMAGES."smiley/more/084.gif' alt='smiley' />", 478 "\:smt085" => "<img src='".IMAGES."smiley/more/085.gif' alt='smiley' />", 479 "\:smt086" => "<img src='".IMAGES."smiley/more/086.gif' alt='smiley' />", 480 "\:smt087" => "<img src='".IMAGES."smiley/more/087.gif' alt='smiley' />", 481 "\:smt088" => "<img src='".IMAGES."smiley/more/088.gif' alt='smiley' />", 482 "\:smt089" => "<img src='".IMAGES."smiley/more/089.gif' alt='smiley' />", 483 "\:smt090" => "<img src='".IMAGES."smiley/more/090.gif' alt='smiley' />", 484 "\:smt091" => "<img src='".IMAGES."smiley/more/091.gif' alt='smiley' />", 485 "\:smt092" => "<img src='".IMAGES."smiley/more/092.gif' alt='smiley' />", 486 "\:smt093" => "<img src='".IMAGES."smiley/more/093.gif' alt='smiley' />", 487 "\:smt084" => "<img src='".IMAGES."smiley/more/094.gif' alt='smiley' />", 488 "\:smt095" => "<img src='".IMAGES."smiley/more/095.gif' alt='smiley' />", 489 "\:smt096" => "<img src='".IMAGES."smiley/more/096.gif' alt='smiley' />", 490 "\:smt097" => "<img src='".IMAGES."smiley/more/097.gif' alt='smiley' />", 491 "\:smt098" => "<img src='".IMAGES."smiley/more/098.gif' alt='smiley' />", 492 "\:smt099" => "<img src='".IMAGES."smiley/more/099.gif' alt='smiley' />", 493 "\:smt101" => "<img src='".IMAGES."smiley/more/101.gif' alt='smiley' />", 494 "\:smt103" => "<img src='".IMAGES."smiley/more/103.gif' alt='smiley' />", 495 "\:smt104" => "<img src='".IMAGES."smiley/more/104.gif' alt='smiley' />", 496 "\:smt105" => "<img src='".IMAGES."smiley/more/105.gif' alt='smiley' />", 497 "\:smt106" => "<img src='".IMAGES."smiley/more/106.gif' alt='smiley' />", 498 "\:smt107" => "<img src='".IMAGES."smiley/more/107.gif' alt='smiley' />", 499 "\:smt108" => "<img src='".IMAGES."smiley/more/108.gif' alt='smiley' />", 500 "\:smt109" => "<img src='".IMAGES."smiley/more/109.gif' alt='smiley' />", 501 "\:smt110" => "<img src='".IMAGES."smiley/more/110.gif' alt='smiley' />", 502 "\:smt111" => "<img src='".IMAGES."smiley/more/111.gif' alt='smiley' />", 503 "\:smt112" => "<img src='".IMAGES."smiley/more/112.gif' alt='smiley' />", 504 "\:smt113" => "<img src='".IMAGES."smiley/more/113.gif' alt='smiley' />", 505 "\:smt114" => "<img src='".IMAGES."smiley/more/114.gif' alt='smiley' />", 506 "\:smt115" => "<img src='".IMAGES."smiley/more/115.gif' alt='smiley' />", 507 "\:smt116" => "<img src='".IMAGES."smiley/more/116.gif' alt='smiley' />", 508 "\:smt117" => "<img src='".IMAGES."smiley/more/117.gif' alt='smiley' />", 509 "\:smt118" => "<img src='".IMAGES."smiley/more/118.gif' alt='smiley' />", 510 "\:smt119" => "<img src='".IMAGES."smiley/more/119.gif' alt='smiley' />", 511 "\:smt120" => "<img src='".IMAGES."smiley/more/120.gif' alt='smiley' />", 512 "\:boring" => "<img src='".IMAGES."smiley/more/015.gif' alt='smiley' />", 513 "\:smt071" => "<img src='".IMAGES."smiley/more/071.gif' alt='smiley' />", 514 "\:smt102" => "<img src='".IMAGES."smiley/more/102.gif' alt='smiley' />", 515 "\:smt100" => "<img src='".IMAGES."smiley/more/100.gif' alt='smiley' />", 516 "\:shock\:" => "<img src='".IMAGES."smiley/more/shock.gif' alt='smiley' />", 517 "\:lol\:" => "<img src='".IMAGES."smiley/more/lol.gif' alt='smiley' />", 518 "\:razz\:" => "<img src='".IMAGES."smiley/more/razz.gif' alt='smiley' />", 519 "\:cry\:" => "<img src='".IMAGES."smiley/more/cry.gif' alt='smiley' />", 520 "\:evil\:" => "<img src='".IMAGES."smiley/more/evil.gif' alt='smiley' />", 521 "\:twisted\:" => "<img src='".IMAGES."smiley/more/icon_twisted.gif' alt='smiley' />", 522 "\:roll\:" => "<img src='".IMAGES."smiley/more/rolleyes.gif' alt='smiley' />", 523 "\:wink\:" => "<img src='".IMAGES."smiley/more/wink.gif' alt='smiley' />", 524 "\:idea\:" => "<img src='".IMAGES."smiley/more/idea.gif' alt='smiley' />", 525 "\:arrow\:" => "<img src='".IMAGES."smiley/more/arrow.gif' alt='smiley' />", 526 "\:mrgreen\:" => "<img src='".IMAGES."smiley/more/icon_mrgreen.gif' alt='smiley' />", 527 "\:badgrin\:" => "<img src='".IMAGES."smiley/more/badgrin.gif' alt='smiley' />", 528 "\;\)" => "<img src='".IMAGES."smiley/wink.gif' alt='smiley' />", 529 "\:\(" => "<img src='".IMAGES."smiley/sad.gif' alt='smiley' />", 530 "\:\|" => "<img src='".IMAGES."smiley/frown.gif' alt='smiley' />", 531 "\:o" => "<img src='".IMAGES."smiley/shock.gif' alt='smiley' />", 532 "\:p" => "<img src='".IMAGES."smiley/pfft.gif' alt='smiley' />", 533 "b\)" => "<img src='".IMAGES."smiley/cool.gif' alt='smiley' />", 534 "\:d" => "<img src='".IMAGES."smiley/grin.gif' alt='smiley' />", 535 "\:@" => "<img src='".IMAGES."smiley/angry.gif' alt='smiley' />", 536 "=D>" => "<img src='".IMAGES."smiley/more/eusa_clap.gif' alt='smiley' />", 537 "\\\:D/" => "<img src='".IMAGES."smiley/more/eusa_dance.gif' alt='smiley' />", 538 "\:D" => "<img src='".IMAGES."smiley/more/biggrin.gif' alt='smiley' />", 539 "\:\-D" => "<img src='".IMAGES."smiley/more/003.gif' alt='smiley' />", 540 "\:\-\)" => "<img src='".IMAGES."smiley/more/001.gif' alt='smiley' />", 541 "\:\(" => "<img src='".IMAGES."smiley/more/sad.gif' alt='smiley' />", 542 "\:o" => "<img src='".IMAGES."smiley/more/surprised.gif' alt='smiley' />", 543 "8\)" => "<img src='".IMAGES."smiley/more/cool.gif' alt='smiley' />", 544 "\:x" => "<img src='".IMAGES."smiley/more/mad.gif' alt='smiley' />", 545 "\:\-x" => "<img src='".IMAGES."smiley/more/icon_mad.gif' alt='smiley' />", 546 "\:P" => "<img src='".IMAGES."smiley/more/icon_razz.gif' alt='smiley' />", 547 "\;\-\)" => "<img src='".IMAGES."smiley/more/002.gif' alt='smiley' />", 548 "\:\!\:" => "<img src='".IMAGES."smiley/more/exclaim.gif' alt='smiley' />", 549 "\:\?\:" => "<img src='".IMAGES."smiley/more/question.gif' alt='smiley' />", 550 "\:\?" => "<img src='".IMAGES."smiley/more/confused.gif' alt='smiley' />", 551 "\:\|" => "<img src='".IMAGES."smiley/more/neutral.gif' alt='smiley' />", 552 "\#\-o" => "<img src='".IMAGES."smiley/more/eusa_doh.gif' alt='smiley' />", 553 "\=P\~" => "<img src='".IMAGES."smiley/more/eusa_drool.gif' alt='smiley' />", 554 "\:\^o" => "<img src='".IMAGES."smiley/more/eusa_liar.gif' alt='smiley' />", 555 "\[\-X" => "<img src='".IMAGES."smiley/more/eusa_naughty.gif' alt='smiley' />", 556 "\[\-o\<\;" => "<img src='".IMAGES."smiley/more/eusa_pray.gif' alt='smiley' />", 557 "8\-\[" => "<img src='".IMAGES."smiley/more/eusa_shifty.gif' alt='smiley' />", 558 "\[\-\(" => "<img src='".IMAGES."smiley/more/eusa_snooty.gif' alt='smiley' />", 559 "\:\-k" => "<img src='".IMAGES."smiley/more/eusa_think.gif' alt='smiley' />", 560 "\]\(\*\,\)" => "<img src='".IMAGES."smiley/more/eusa_wall.gif' alt='smiley' />", 561 "\:\-\"" => "<img src='".IMAGES."smiley/more/eusa_whistle.gif' alt='smiley' />", 562 "O\:\)" => "<img src='".IMAGES."smiley/more/eusa_angel.gif' alt='smiley' />", 563 "\=\;" => "<img src='".IMAGES."smiley/more/eusa_hand.gif' alt='smiley' />", 564 "\:\-\&" => "<img src='".IMAGES."smiley/more/eusa_sick.gif' alt='smiley' />", 565 "\:\-\(\{\|\=" => "<img src='".IMAGES."smiley/more/eusa_boohoo.gif' alt='smiley' />", 566 "\:\-\$" => "<img src='".IMAGES."smiley/more/eusa_shhh.gif' alt='smiley' />", 567 "\:\-s" => "<img src='".IMAGES."smiley/more/eusa_eh.gif' alt='smiley' />", 568 "\:\-\#" => "<img src='".IMAGES."smiley/more/eusa_silenced.gif' alt='smiley' />", 569 "\:\)" => "<img src='".IMAGES."smiley/smile.gif' alt='smiley' />" 570 ); 571 foreach($smiley as $key=>$smiley_img) { 572 $search = "#([[:space:]])".$key."([[:space:]])?#si"; 573 $replace = "\\1".$smiley_img."\\2"; 574 $message = preg_replace($search, $replace, $message); 575 } 576 return $message; 577 } 578 579 // internal function: preg_replace_callback for parseubb, to validate the URL found in [url] 580 function _parseubb_checkurl($matches) { 581 582 // if it's a old-style bbcode (not [url=][/url] but [url][/url]), convert it before checking 583 if (empty($matches[2])) { 584 $matches[2] = $matches[3]; 585 } 555 586 556 587 // validate the URL (in $matches[1]) 557 if ( eregi($urlregex,$matches[2])) {588 if (isURL($matches[2])) { 558 589 // check if the URL is prefixed. If not, assume http:// 559 if (!eregi("^( ".$scheme."){1}", $matches[2])) {590 if (!eregi("^((https?|s?ftp|mailto|svn|cvs|callto|mms|skype)\:\/\/){1}", $matches[2])) { 560 591 $matches[2] = "http://".$matches[2]; 561 592 } … … 566 597 return stripinput($matches[0]); 567 598 } 599 } 600 601 // internal function: preg_replace_callback for parseubb, to validate the IMG found in [img] 602 function _parseubb_checkimg($matches) { 603 global $locale; 604 605 // validate the URL (in $matches[1]) 606 if (isURL($matches[1], true)) { 607 if (verify_image($matches[1])) { 608 return "<img src=\"".$matches[1]."\" style=\"border:0px\" alt=\"\" />"; 609 } 610 } 611 // return a sanitized version of the orginal BBcode 612 return stripinput($matches[0]); 568 613 } 569 614 … … 580 625 $text = preg_replace('#\[center\](.*?)\[/center\]#si', '<center>\1</center>', $text); 581 626 582 // new youtube bbcode583 $text = preg_replace('#\[youtube\](.*?)\[/youtube\]#si', '<object type="application/x-shockwave-flash" width="425" height="350" data="http://www.youtube.com/v/\1"><param name="movie" value="http://www.youtube.com/v/\1"></param><param name="wmode" value="transparent"></param></object>', $text);584 585 627 // new wiki bbcode 586 628 if (isset($settings['wiki_forum_links']) && $settings['wiki_forum_links']) { 587 629 // add the link to the wiki page 588 $text = preg_replace('#\[wiki\](.*?)\[/wiki\]#si', '<a href="'.BASEDIR.'modules/wiki/index.php?wakka=\1" class="wiki_link" title=" ExiteCMS Wiki">\1</a>', $text);630 $text = preg_replace('#\[wiki\](.*?)\[/wiki\]#si', '<a href="'.BASEDIR.'modules/wiki/index.php?wakka=\1" class="wiki_link" title="'.$settings['wiki_wakka_name'].'">\1</a>', $text); 589 631 } else { 590 632 // strip the wiki bbcode … … 601 643 $text = preg_replace('#\[mail\]([\r\n]*)([^\s\'\";:\+]*?)([\r\n]*)\[/mail\]#si', '<a href=\'mailto:\2\'>\2</a>', $text); 602 644 $text = preg_replace('#\[mail=([\r\n]*)([^\s\'\";:\+]*?)\](.*?)([\r\n]*)\[/mail\]#si', '<a href=\'mailto:\2\'>\3</a>', $text); 603 645 // small 604 646 $text = preg_replace('#\[small\](.*?)\[/small\]#si', '<span class=\'small\'>\1</span>', $text); 647 // color 605 648 $text = preg_replace('#\[color=(\#[0-9a-fA-F]{6}|black|blue|brown|cyan|grey|green|lime|maroon|navy|olive|orange|purple|red|silver|violet|white|yellow)\](.*?)\[/color\]#si', '<span style=\'color:\1\'>\2</span>', $text); 606 649 // new youtube bbcode 650 $text = preg_replace('#\[youtube\](.*?)\[/youtube\]#si', '<object type="application/x-shockwave-flash" width="425" height="350" data="http://www.youtube.com/v/\1"><param name="movie" value="http://www.youtube.com/v/\1"></param><param name="wmode" value="transparent"></param></object>', $text); 651 // flash movies 607 652 $text = preg_replace('#\[flash width=([0-9]*?) height=([0-9]*?)\]([^\s\'\";:\+]*?)(\.swf)\[/flash\]#si', '<object classid=\'clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\' codebase=\'http://active.macromedia.com/flash6/cabs/swflash.cab#version=6,0,0,0\' id=\'\3\4\' width=\'\1\' height=\'\2\'><param name=movie value=\'\3\4\'><param name=\'quality\' value=\'high\'><param name=\'bgcolor\' value=\'#ffffff\'><embed src=\'\3\4\' quality=\'high\' bgcolor=\'#ffffff\' width=\'\1\' height=\'\2\' type=\'application/x-shockwave-flash\' pluginspage=\'http://www.macromedia.com/go/getflashplayer\'></embed></object>', $text); 608 $text = preg_replace("#\[img\]((http|ftp|https|ftps)://)(.*?)(\.(jpg|jpeg|gif|png|JPG|JPEG|GIF|PNG))\[/img\]#sie","'<img src=\'\\1'.str_replace(array('.php','?','&','='),'','\\3').'\\4\' style=\'border:0px\' alt=\'\' />'",$text); 609 653 // images 654 if (ini_get('allow_url_fopen')) { 655 $text = preg_replace_callback('#\[img\](.*?)\[/img\]#si', '_parseubb_checkimg', $text); 656 } else { 657 $text = preg_replace("#\[img\]((http|ftp|https|ftps)://)(.*?)(\.(jpg|jpeg|gif|png|JPG|JPEG|GIF|PNG))\[/img\]#sie","'<img src=\'\\1'.str_replace(array('.php','?','&','='),'','\\3').'\\4\' style=\'border:0px\' alt=\'\' />'",$text); 658 } 659 // quotes 610 660 $text = preg_replace('#\[quote=([\r\n]*)(.*?)\]#si', '<b>\2 '.$locale['199'].':</b><br />[quote]', $text); 611 612 661 $qcount = substr_count($text, "[quote]"); $ccount = substr_count($text, "[code]"); 613 662 for ($i=0;$i < $qcount;$i++) $text = preg_replace('#\[quote\](.*?)\[/quote\]#si', '<div class=\'quote\'>\1</div>', $text); … … 646 695 $text = preg_replace('#([a-z]*)=([\`\'\"]*)javascript:#iU', '$1=$2nojavascript...', $text); 647 696 $text = preg_replace('#([a-z]*)=([\'\"]*)vbscript:#iU', '$1=$2novbscript...', $text); 648 //<span style="width: expression(alert('Ping!'));"></span> (only affects ie...)649 697 $text = preg_replace('#(<[^>]+)style=([\`\'\"]*).*expression\([^>]*>#iU', "$1>", $text); 650 698 $text = preg_replace('#(<[^>]+)style=([\`\'\"]*).*behaviour\([^>]*>#iU', "$1>", $text); … … 660 708 // Scan image files for malicious code 661 709 function verify_image($file) { 662 $txt = file_get_contents($file);663 710 $image_safe = true; 664 if (preg_match('#&(quot|lt|gt|nbsp);#i', $txt)) { $image_safe = false; } 665 elseif (preg_match("#&\#x([0-9a-f]+);#i", $txt)) { $image_safe = false; } 666 elseif (preg_match('#&\#([0-9]+);#i', $txt)) { $image_safe = false; } 667 elseif (preg_match("#([a-z]*)=([\`\'\"]*)script:#iU", $txt)) { $image_safe = false; } 668 elseif (preg_match("#([a-z]*)=([\`\'\"]*)javascript:#iU", $txt)) { $image_safe = false; } 669 elseif (preg_match("#([a-z]*)=([\'\"]*)vbscript:#iU", $txt)) { $image_safe = false; } 670 elseif (preg_match("#(<[^>]+)style=([\`\'\"]*).*expression\([^>]*>#iU", $txt)) { $image_safe = false; } 671 elseif (preg_match("#(<[^>]+)style=([\`\'\"]*).*behaviour\([^>]*>#iU", $txt)) { $image_safe = false; } 672 elseif (preg_match("#</*(applet|link|style|script|iframe|frame|frameset)[^>]*>#i", $txt)) { $image_safe = false; } 711 if (file_exists($file)) { 712 $er = error_reporting(0); 713 // get info about the image 714 $imginfo = @getimagesize($file); 715 // get the file contents 716 $txt = file_get_contents($file); 717 error_reporting($er); 718 if ($imginfo === false) { $image_safe = false; } 719 if ($txt === false) { $image_safe = false; } 720 elseif (preg_match('#&(quot|lt|gt|nbsp);#i', $txt)) { $image_safe = false; } 721 elseif (preg_match("#&\#x([0-9a-f]+);#i", $txt)) { $image_safe = false; } 722 elseif ($imginfo[2] != 5 && preg_match('#&\#([0-9]+);#i', $txt)) { $image_safe = false; } // skip for psd files 723 elseif (preg_match("#([a-z]*)=([\`\'\"]*)script:#iU", $txt)) { $image_safe = false; } 724 elseif (preg_match("#([a-z]*)=([\`\'\"]*)javascript:#iU", $txt)) { $image_safe = false; } 725 elseif (preg_match("#([a-z]*)=([\'\"]*)vbscript:#iU", $txt)) { $image_safe = false; } 726 elseif (preg_match("#(<[^>]+)style=([\`\'\"]*).*expression\([^>]*>#iU", $txt)) { $image_safe = false; } 727 elseif (preg_match("#(<[^>]+)style=([\`\'\"]*).*behaviour\([^>]*>#iU", $txt)) { $image_safe = false; } 728 elseif (preg_match("#</*(applet|link|style|script|iframe|frame|frameset)[^>]*>#i", $txt)) { $image_safe = false; } 729 } 673 730 return $image_safe; 674 731 } … … 981 1038 } 982 1039 } 1040 1041 1042 // replacement for die() 1043 function terminate($text) { 1044 die("<div style='font-family:Verdana,Sans-serif;font-size:11px;text-align:center;'>$text</div>"); 1045 } 983 1046 ?> -
branches/PLi-Fusion/includes/db_functions.php
r1408 r1509 24 24 // database global variables 25 25 $_db_debug = false; 26 $_db_log = false;26 $_db_log = true; 27 27 $_db_logs = array(); 28 28 $_db_last_function = ""; … … 53 53 54 54 // MySQL database functions 55 function dbquery($query, $display= true) {56 57 global $_db_last_function, $_db_debug, $_db_log, $_db_logs, $_loadstats ;55 function dbquery($query, $display=false) { 56 57 global $_db_last_function, $_db_debug, $_db_log, $_db_logs, $_loadstats, $settings; 58 58 59 59 // update the query for relocated user tables 60 60 ModUserTables($query); 61 62 $_s_loadtime = explode(" ", microtime());63 $_s_loadtime = $_s_loadtime[1] + $_s_loadtime[0];64 $_loadstats['querytime'] -= $_s_loadtime;65 61 66 62 if ($_db_debug) { … … 87 83 } 88 84 89 $result = @mysql_query($query); 85 $_s_loadtime = explode(" ", microtime()); 86 $_s_loadtime = (float)$_s_loadtime[1] + (float)$_s_loadtime[0]; 87 88 $result = mysql_query($query); 89 90 $_e_loadtime = explode(" ", microtime()); 91 $_e_loadtime = (float)$_e_loadtime[1] + (float)$_e_loadtime[0]; 92 93 $_loadstats['querytime'] = $_loadstats['querytime'] + $_e_loadtime - $_s_loadtime; 94 90 95 if (!$result) { 91 if ($display ) {96 if ($display || $settings['debug_querylog']) { 92 97 echo "<pre><br />Query: ".$query."<br />"; 93 98 echo mysql_error(); 94 99 echo "</pre>";
