Changeset 1509 in ExiteCMS


Ignore:
Timestamp:
07/02/08 18:27:06 (4 years ago)
Author:
hverton
Message:

Merged trunk revisions 1408:1508 into the PLi-Fusion branch

Location:
branches/PLi-Fusion
Files:
1 deleted
68 edited
1 copied

Legend:

Unmodified
Added
Removed
  • branches/PLi-Fusion/404handler.php

    r1192 r1509  
    109109            break; 
    110110        } 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>"); 
    112112        } 
    113113    } 
  • branches/PLi-Fusion/administration/forums.php

    r1408 r1509  
    194194        if ($cat_name != "") { 
    195195            $cat_order = isNum($_POST['cat_order']) ? $_POST['cat_order'] : ""; 
    196             if(!$cat_order) $cat_order=dbresult(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; 
    197197            $result = dbquery("UPDATE ".$db_prefix."forums SET forum_order=forum_order+1 WHERE forum_cat='0' AND forum_order>='$cat_order'");    
    198198            $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')"); 
     
    222222                SELECT DISTINCT u.user_id, u.user_level, u.user_groups  
    223223                FROM ".$db_prefix."threads_read tr 
    224                 LEFT JOIN ".$db_prefix."users u ON u.user_id = tr.user_id 
     224                INNER JOIN ".$db_prefix."users u ON u.user_id = tr.user_id 
    225225                WHERE tr.thread_id = '".$thread_id."' 
    226226                "); 
     
    241241            $forum_mods = ""; 
    242242            $forum_order = isNum($_POST['forum_order']) ? $_POST['forum_order'] : ""; 
    243             if(!$forum_order) $forum_order=dbresult(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; 
    244244            $result = dbquery("UPDATE ".$db_prefix."forums SET forum_order=forum_order+1 WHERE forum_cat='$forum_cat' AND forum_order>='$forum_order'");     
    245245            $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  
    110110 
    111111            // determine the next order in the menu for this link 
    112             $link_order = dbresult(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; 
    113113 
    114114            // add the new link 
     
    171171    // register the installation of this module 
    172172    $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    } 
    173219 
    174220    // update the access rights of the site administrators to include this new module 
     
    303349    // remove the module from the installed modules list 
    304350    $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 
     359if ($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 
    305381} 
    306382 
     
    393469            if (dbrows($result) == 0) { 
    394470                // determine the next order in the menu for this link 
    395                 $link_order = dbresult(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; 
    396472 
    397473                // add the new link 
     
    419495        foreach($localestrings as $locales_code => $locales_strings) { 
    420496            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            } 
    421548        } 
    422549    } 
     
    452579            $mod_check = (isset($mod_title) && $mod_title != ""); 
    453580            $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!= ""); 
    456581            if (!$mod_check) { 
    457582                $mod_errors .= $locale['mod004']; 
     
    460585                $this_module['description'] = isset($mod_description) ? $mod_description : ""; 
    461586                $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 : ""; 
    464589                $this_module['url'] = isset($mod_weburl) ? $mod_weburl : ""; 
    465590                $this_module['type'] = isset($mod_type) ? $mod_type : "M"; 
  • branches/PLi-Fusion/administration/settings_forum.php

    r1227 r1509  
    3838    $result = dbquery("UPDATE ".$db_prefix."configuration SET cfg_value = '".(isNum($_POST['thread_notify']) ? $_POST['thread_notify'] : "0")."' WHERE cfg_name = 'thread_notify'"); 
    3939    $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'"); 
    4041} 
    4142 
  • branches/PLi-Fusion/administration/settings_misc.php

    r1227 r1509  
    3737    $result = dbquery("UPDATE ".$db_prefix."configuration SET cfg_value = '".stripinput($_POST['bad_word_replace'])."' WHERE cfg_name = 'bad_words_replace'"); 
    3838    $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'"); 
    4039    $result = dbquery("UPDATE ".$db_prefix."configuration SET cfg_value = '".(isNum($_POST['numofshouts']) ? $_POST['numofshouts'] : "10")."' WHERE cfg_name = 'numofshouts'"); 
    4140    $result = dbquery("UPDATE ".$db_prefix."configuration SET cfg_value = '".(isNum($_POST['flood_interval']) ? $_POST['flood_interval'] : "15")."' WHERE cfg_name = 'flood_interval'"); 
     
    4544    $result = dbquery("UPDATE ".$db_prefix."configuration SET cfg_value = '".stripinput($_POST['maintenance_color'])."' WHERE cfg_name = 'maintenance_color'"); 
    4645    $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'"); 
    4747} 
    4848 
  • branches/PLi-Fusion/administration/site_links.php

    r1335 r1509  
    128128+----------------------------------------------------*/ 
    129129 
     130// display a status panel 
     131if (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 
    130144// generate the list of installed menu panels 
    131145$variables['panel_list'] = array(); 
     
    137151} 
    138152sort($variables['panel_list']); 
    139  
    140 // display a status panel 
    141 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 variables 
    148     $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 } 
    153153 
    154154// default panel title 
     
    209209            // if the parent has changed, calculate a new link order 
    210210            if ($data['link_parent'] != $link_parent) { 
    211                 $link_order = dbresult(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; 
    212212            } else { 
    213213                // link changed? 
     
    222222            // get a linkorder if none given 
    223223            if (!$link_order) { 
    224                 $link_order = dbresult(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; 
    225225            } 
    226226            $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  
    491491        $localestrings['236'] = "Language Settings"; 
    492492        $localestrings['237'] = "Webmaster Toolbox for"; 
     493        $localestrings['238'] = "Forum Ranking"; 
    493494        $localestrings['250'] = "Website Statistics"; 
    494495        $localestrings['251'] = "Registered Members:"; 
     
    496497        $localestrings['253'] = "Suspended Members:"; 
    497498        $localestrings['255'] = "Deleted Members:"; 
    498         $localestrings['256'] = "x"; 
     499        $localestrings['256'] = "Reports"; 
    499500        $localestrings['257'] = "Comments:"; 
    500501        $localestrings['258'] = "Shoutbox Posts:"; 
    501502        $localestrings['259'] = "Forum Posts:"; 
    502         $localestrings['260'] = "x"; 
     503        $localestrings['260'] = "Searches"; 
    503504        $localestrings['261'] = "x"; 
    504505        $localestrings['262'] = "Unread Posts:"; 
     
    600601        $localestrings['424'] = "There are no modules and plugins available for installation"; 
    601602        $localestrings['425'] = "There are no modules and plugins available that match your filter"; 
     603        $localestrings['426'] = "Refresh the locale strings"; 
    602604        $localestrings['mod001'] = "This module requires at least version %s of ExiteCMS.<br />"; 
    603605        $localestrings['mod002'] = "This module is written for version %s of ExiteCMS. Please ask the author for an upgrade.<br />"; 
     
    787789 
    788790        $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(); 
    789833        $localestrings['400'] = "Add new redirect URL"; 
    790834        $localestrings['401'] = "Edit redirect URL"; 
     
    817861        $localestrings['492'] = "If checked, the site will redirect to the exact URL given"; 
    818862        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); 
    819911 
    820912        $localestrings = array(); 
     
    889981        $localestrings['532'] = "Error: The session timeout value should be greater than the extended login timeout!"; 
    890982        $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"; 
    891986        $localestrings['550'] = "Security"; 
    892987        $localestrings['551'] = "Enable registration system?"; 
     
    9441039        $localestrings['666'] = "SMTP Username and Password:"; 
    9451040        $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:"; 
    9471042        $localestrings['669'] = "Maintenance mode background color:"; 
    948         $localestrings['670'] = "If yes, an external program has to update the download counters."; 
    9491043        $localestrings['671'] = "Activate SQL query debugging for:"; 
    9501044        $localestrings['672'] = "disabled"; 
     
    12121306        $localestrings['es'] = "Spain"; 
    12131307        $localestrings['et'] = "Ethiopia"; 
     1308        $localestrings['eu'] = "European Union"; 
    12141309        $localestrings['fi'] = "Finland"; 
    12151310        $localestrings['fj'] = "Fiji"; 
     
    12881383        $localestrings['mm'] = "Myanmar"; 
    12891384        $localestrings['mn'] = "Mongolia"; 
     1385        $localestrings['mo'] = "Macau"; 
    12901386        $localestrings['mp'] = "Northern Mariana Islands"; 
    12911387        $localestrings['mq'] = "Martinique"; 
     
    13201416        $localestrings['pl'] = "Poland"; 
    13211417        $localestrings['pm'] = "Saint Pierre And Miquelon"; 
    1322         $localestrings['pr'] = "Puerto Rico"; 
     1418        $localestrings['pr'] = "Palestinian Territories"; 
    13231419        $localestrings['pt'] = "Portugal"; 
    13241420        $localestrings['pw'] = "Palau"; 
     
    13621458        $localestrings['tv'] = "Tuvalu"; 
    13631459        $localestrings['tw'] = "Taiwan, Province Of China"; 
     1460        $localestrings['tz'] = "Tanzania"; 
    13641461        $localestrings['ua'] = "Ukraine"; 
    13651462        $localestrings['ug'] = "Uganda"; 
     
    21622259        $localestrings['517'] = "Toggle smileys"; 
    21632260        $localestrings['518'] = "pixels"; 
     2261        $localestrings['519'] = ""; 
    21642262        $localestrings['520'] = "Moderator Options:"; 
    21652263        $localestrings['521'] = "Delete Thread"; 
     
    23242422        $localestrings['472']['16'] = "white"; 
    23252423        $localestrings['473'] = "Comments (Max.length: 255 characters):"; 
     2424        $localestrings['474'] = "Toggle Message"; 
    23262425        $localestrings['480'] = " Make this Thread Sticky"; 
    23272426        $localestrings['481'] = " Show My Signature in this Post"; 
     
    24712570        $localestrings = array(); 
    24722571        $localestrings['400'] = "Forum:"; 
     2572        $localestrings['401'] = "writes:"; 
    24732573        load_localestrings($localestrings, LP_LOCALE, "main.feeds", $step); 
    24742574 
     
    28982998 
    28992999        $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(); 
    29003009        $localestrings['400'] = "Search"; 
    29013010        $localestrings['401'] = "Search for:"; 
     
    30183127        $localestrings['475'] = "News"; 
    30193128        $localestrings['476'] = "Panels"; 
    3020         $localestrings['477'] = "x"; 
     3129        $localestrings['477'] = "Reports"; 
    30213130        $localestrings['478'] = "PHP Info"; 
    30223131        $localestrings['479'] = "Polls"; 
    3023         $localestrings['480'] = "x"; 
     3132        $localestrings['480'] = "Searches"; 
    30243133        $localestrings['481'] = "Menu System"; 
    30253134        $localestrings['482'] = "x"; 
     
    30473156        $localestrings['507'] = "Search"; 
    30483157        $localestrings['508'] = "Register"; 
     3158        $localestrings['509'] = "Reports"; 
    30493159        $localestrings['520'] = "Main Menu"; 
    30503160        $localestrings['521'] = "Online Users"; 
     
    31543264if (!function_exists('load_localestrings')) { 
    31553265    function load_localestrings($localestrings, $locales_code, $locales_name, $step="") { 
    3156         global $db_prefix; 
     3266        global $db_prefix, $_db_log; 
    31573267     
    31583268        // if this is an upgrade, remove the old locale strings first 
     
    31603270            $result = dbquery("DELETE FROM ".$db_prefix."locales WHERE locales_code = '$locales_code' AND locales_name = '$locales_name'"); 
    31613271        } 
    3162      
     3272 
     3273        // temporary disable query logging 
     3274        $dblog = $_db_log; $_db_log = false; 
    31633275        // proces the imported locale strings 
    31643276        foreach ($localestrings as $key => $value) { 
     
    31683280            $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()."')"); 
    31693281        } 
     3282        $_db_log = $dblog; 
    31703283        return true; 
    31713284    } 
     
    31773290if (!defined('LP_CHARSET')) define('LP_CHARSET', "iso-8859-1"); 
    31783291if (!defined('LP_VERSION')) define('LP_VERSION', "7.10"); 
    3179 if (!defined('LP_DATE')) define('LP_DATE', "1210855263"); 
    3180 $lp_date = "1210855263"; 
     3292if (!defined('LP_DATE')) define('LP_DATE', "1214934137"); 
     3293$lp_date = "1214934137"; 
    31813294 
    31823295/*---------------------------------------------------+ 
  • branches/PLi-Fusion/administration/tools/update_geoip_database.php

    r1227 r1509  
    4242 
    4343// load the theme functions when not in CLI mode 
    44 if (!CMS_CLI) require_once PATH_INCLUDES."theme_functions.php"; 
     44if (!CMS_CLI) { 
     45    require_once PATH_INCLUDES."theme_functions.php"; 
     46} else { 
     47    echo "Running in CLI mode...\n"; 
     48} 
    4549 
    4650// load the GeoIP include module 
     
    5862// verify if the download succeeded 
    5963if (file_exists('/tmp/GeoIPCountryCSV.zip')) { 
     64 
     65    // save the debug log setting, then disable it 
     66    $db_log = $_db_log; 
     67    $_db_log = false; 
    6068     
    6169    // unzip the new file 
     
    139147display("Update finished!"); 
    140148 
     149// restore the debug log status 
     150$_db_log = $db_log; 
     151 
    141152// delete the download and temporary files 
    142153if (file_exists('/tmp/GeoIPCountryWhois.csv')) unlink("/tmp/GeoIPCountryWhois.csv"); 
  • branches/PLi-Fusion/administration/upgrade.php

    r1227 r1509  
    7474            // stage 2: perform the upgrades 
    7575            $variables['stage'] = 2; 
     76            // switch to MySQL4 mode to avoid errors 
     77            $result = dbquery("SET SESSION sql_mode='MYSQL40'"); 
    7678            // start with the current revision number 
    7779            $new_revision = $settings['revision']; 
  • branches/PLi-Fusion/administration/upgrade/rev00730.php

    r955 r1509  
    3131 
    3232// 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"); 
    3636$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"); 
    3939$commands[] = array('type' => 'db', 'value' => "ALTER TABLE ##PREFIX##users CHANGE user_offset user_offset CHAR(6) NOT NULL DEFAULT ''"); 
    4040 
  • branches/PLi-Fusion/administration/upgrade/rev00740.php

    r955 r1509  
    4343  pm_id smallint(5) unsigned NOT NULL auto_increment, 
    4444  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, 
    5050  PRIMARY KEY  (pm_id) 
    5151) ENGINE=MyISAM;"); 
     
    5353  pmindex_id smallint(5) unsigned NOT NULL auto_increment, 
    5454  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, 
    5858  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, 
    6060  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, 
    6666  PRIMARY KEY  (pmindex_id) 
    6767) ENGINE=MyISAM;"); 
     
    6969  pmconfig_id smallint(5) unsigned NOT NULL auto_increment, 
    7070  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, 
    7474  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, 
    7676  PRIMARY KEY  (pmconfig_id) 
    7777) ENGINE=MyISAM;"); 
     
    7979  pmattach_id smallint(5) unsigned NOT NULL auto_increment, 
    8080  pm_id smallint(5) unsigned NOT NULL, 
    81   pmattach_name varchar(100) collate latin1_general_ci NOT NULL default '', 
    82   pmattach_realname varchar(100) collate latin1_general_ci NOT NULL default '', 
    83   pmattach_comment varchar(255) collate latin1_general_ci NOT NULL default '', 
    84   pmattach_ext varchar(5) collate latin1_general_ci NOT 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, 
    8686  PRIMARY KEY  (pmattach_id) 
    8787) ENGINE=MyISAM;"); 
     
    9393$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'"); 
    9494$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"); 
    100100 
    101101$commands[] = array('type' => 'function', 'value' => "migrate_messages"); 
  • branches/PLi-Fusion/administration/upgrade/rev00760.php

    r955 r1509  
    4444 
    4545// 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"); 
    4747 
    4848// support new homepage news assignments 
    4949$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"); 
    5252 
    5353// make more room to support timezones at half-hours or quaters 
  • branches/PLi-Fusion/administration/upgrade/rev00780.php

    r955 r1509  
    3939 
    4040// 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"); 
    4343 
    4444// 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"); 
    4646?> 
  • branches/PLi-Fusion/administration/upgrade/rev00800.php

    r955 r1509  
    3838 
    3939// 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"); 
    4242 
    4343// 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"); 
    4545 
    4646// drop the panel_state table. Not needed anymore, replaced by cookies 
  • branches/PLi-Fusion/administration/upgrade/rev00850.php

    r1236 r1509  
    6262        $result = dbquery("UPDATE ".$db_prefix."user_groups SET group_ident = 'wE01' WHERE group_id = '".$data['group_id']."'"); 
    6363    } 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'"); 
    6565    } 
    6666} 
  • branches/PLi-Fusion/administration/upgrade/rev00858.php

    r955 r1509  
    10311031  locale_code varchar(8) NOT NULL default '', 
    10321032  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, 
    10341034  PRIMARY KEY  (locale_id) 
    10351035) ENGINE=MyISAM;"); 
  • branches/PLi-Fusion/administration/upgrade/rev00909.php

    r955 r1509  
    3636  cfg_id smallint(5) unsigned NOT NULL auto_increment, 
    3737  cfg_name varchar(25) NOT NULL default '', 
    38   cfg_value TEXT NOT NULL default '', 
     38  cfg_value TEXT NOT NULL, 
    3939  PRIMARY KEY  (cfg_id) 
    4040) ENGINE=MyISAM;"); 
  • branches/PLi-Fusion/administration/upgrade/rev00954.php

    r955 r1509  
    3333// create new captcha table 
    3434$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, 
    3636  captcha_ip VARCHAR(20) NOT NULL, 
    3737  captcha_encode VARCHAR(32) NOT NULL default '', 
  • branches/PLi-Fusion/administration/upgrade/rev01060.php

    r1065 r1509  
    3636 
    3737// 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"); 
    3939?> 
  • branches/PLi-Fusion/administration/upgrade/rev01070.php

    r1408 r1509  
    4141  locales_name varchar(50) NOT NULL default '', 
    4242  locales_key varchar(25) NOT NULL default '', 
    43   locales_value TEXT NOT NULL default '', 
     43  locales_value TEXT NOT NULL, 
    4444  locales_datestamp INT(10) UNSIGNED NOT NULL default 0, 
    4545  PRIMARY KEY  (locales_id) 
  • branches/PLi-Fusion/administration/upgrade/rev01091.php

    r1124 r1509  
    3131 
    3232// 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"); 
    3434 
    3535// add a locales key index to the locales table 
  • branches/PLi-Fusion/administration/upgrade/rev01190.php

    r1227 r1509  
    3131// update the tables 
    3232$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"); 
    3636$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"); 
    3939$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"); 
    4242$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"); 
    4747$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"); 
    4949$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"); 
    5151$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"); 
    5353$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"); 
    6060$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"); 
    6565$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"); 
    7171$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"); 
    7474?> 
  • branches/PLi-Fusion/administration/upgrade/rev01193.php

    r1227 r1509  
    3030 
    3131// 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"); 
    3333 
    3434// create the threads_read table 
    3535$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, 
    4141  PRIMARY KEY  (user_id,forum_id,thread_id) 
    4242) ENGINE=MyISAM;"); 
  • branches/PLi-Fusion/administration/upgrade/rev01201.php

    r1227 r1509  
    3636 
    3737// 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')"); 
    4040 
    4141// add the tables for the new module "blogs" 
    4242$commands[] = array('type' => 'db', 'value' => "CREATE TABLE ##PREFIX##blogs ( 
    4343  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, 
    5454  PRIMARY KEY  (blog_id) 
    5555) ENGINE=MyISAM;"); 
  • branches/PLi-Fusion/administration/upgrade/rev01214.php

    r1227 r1509  
    3939  session_id CHAR(50) NOT NULL default '', 
    4040  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, 
    4444  session_ip CHAR(15) NOT NULL default '', 
    45   session_data TEXT NOT NULL default '', 
     45  session_data TEXT, 
    4646  PRIMARY KEY  (session_id) 
    4747) ENGINE=MyISAM;"); 
  • branches/PLi-Fusion/administration/upgrade/rev01280.php

    r1335 r1509  
    3030 
    3131// 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"); 
    3333?> 
  • branches/PLi-Fusion/blogs.php

    r1227 r1509  
    222222            $bloglimit = time() - $settings['blogs_indexage'] * 86400; 
    223223            // 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"); 
    225225        } 
    226226        $variables['list'] = array(); 
     
    234234            $variables['list'][] = $data; 
    235235        } 
    236  
    237236        break;       
    238237} 
  • branches/PLi-Fusion/contact.php

    r1335 r1509  
    1515require_once dirname(__FILE__)."/includes/core_functions.php"; 
    1616require_once PATH_ROOT."/includes/theme_functions.php"; 
    17  
    18 // include the secureimage class 
    19 require_once PATH_INCLUDES."secureimage-1.0.3/securimage.php"; 
    2017 
    2118// temp storage for template variables 
     
    4441    // error initialisation 
    4542    $errors = array(); 
     43    // include the secureimage class 
     44    require_once PATH_INCLUDES."secureimage-1.0.3/securimage.php"; 
    4645    // captcha check 
    4746    $securimage = new Securimage(); 
  • branches/PLi-Fusion/downloads.php

    r1227 r1509  
    6666// if a download ID is given... 
    6767if (isset($download_id)) { 
    68     $res = 0; 
    6968    // and it exists ... 
    7069    if ($data = dbarray(dbquery("SELECT download_url,download_cat FROM ".$db_prefix."downloads WHERE download_id='$download_id'"))) { 
     
    7271        // and the user has access to it... 
    7372        if (checkgroup($cdata['download_cat_access'])) { 
    74             $res = 1; 
    7573            // 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'"); 
    7775            // if a URL is given for the download, redirect to it, else fall back to the download category 
    7876            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                } 
    7983                redirect($data['download_url']); 
    8084                exit; 
     
    107111    $variables['subcats'] = false; 
    108112    $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) { 
    110114        // any downloads in the 'root' are public, and ordered by download_id DESC, by default! 
    111115        $variables['parent'] = array('download_cat_access' => 0, 'download_cat_sorting' => 'download_id DESC');  
    112116        $cat_id = 0; 
    113     } else { 
    114         die('oops'); 
    115117    } 
    116118} 
     
    139141} 
    140142 
     143// check if we have categories at all 
     144$variables['have_cats'] = dbfunction("COUNT(*)", "download_cats"); 
     145 
    141146// define the body panel variables 
    142147$template_panels[] = array('type' => 'body', 'name' => 'downloads', 'template' => 'main.downloads.tpl', 'locale' => "main.downloads"); 
  • branches/PLi-Fusion/edit_profile.php

    r1335 r1509  
    9696                                $error .= sprintf($locale['489'], $email_domain)."<br><br>\n"; 
    9797                            } else { 
    98                                 if (!$mail->Recipient($email)) { 
     98                                if (!$mail->CheckRecipient($email)) { 
    9999                                    // mail server doesn't respond to RCPT TO message 
    100100                                    $error .= sprintf($locale['490'], $email, $mailhost)."<br><br>\n"; 
  • branches/PLi-Fusion/feeds.php

    r1408 r1509  
    7070            $item['title'] = "<![CDATA[ ".$data['post_subject']." ]]>"; 
    7171            $item['link'] = $settings['siteurl']."forum/viewthread.php?forum_id=".$data['forum_id']."&amp;thread_id=".$data['thread_id']."&amp;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"); 
    7375            $item['pubDate'] = strftime("%a, %d %b %G %T %z", $data['post_datestamp']); 
     76            setlocale("LC_TIME", $loc); 
    7477            $item['guid'] = $item['link'];  // make the guid equal to the link, we don't have a need for permalinks 
    7578            $feed[] = $item; 
  • branches/PLi-Fusion/files/locales/en.main.global.php

    r1408 r1509  
    33// locale       : English 
    44// 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 
    67// ---------------------------------------------------------- 
    78$locale['001'] = "Navigation"; 
  • branches/PLi-Fusion/files/locales/en.main.setup.php

    r1408 r1509  
    33// locale       : English 
    44// locale name  : main.setup 
    5 // generated on : Thu May 15 2008, 14:41:03 CEST 
     5// generated on : Tue Jul 1 2008, 19:42:17 CEST 
    66// translators  : ExiteCMS team,WanWizard 
    77// ---------------------------------------------------------- 
  • branches/PLi-Fusion/forum/index.php

    r1335 r1509  
    4545$result = dbquery( 
    4646    "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     LEFT JOIN ".$db_prefix."threads t USING(forum_id) 
    48     LEFT JOIN ".$db_prefix."forums f2 ON f.forum_cat = f2.forum_id 
    49     LEFT JOIN ".$db_prefix."users u ON f.forum_lastuser = u.user_id 
     47    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 
    5050    WHERE ".groupaccess('f.forum_access')." AND f.forum_cat != '0' GROUP BY forum_id ORDER BY f2.forum_order ASC, f.forum_order ASC" 
    5151); 
     
    8484                SELECT count(*) as unread  
    8585                    FROM ".$db_prefix."posts p  
    86                         LEFT JOIN ".$db_prefix."threads_read tr ON p.thread_id = tr.thread_id  
     86                        INNER JOIN ".$db_prefix."threads_read tr ON p.thread_id = tr.thread_id  
    8787                    WHERE tr.user_id = '".$userdata['user_id']."'  
    8888                        AND tr.forum_id = '".$data['forum_id']."'  
     
    9595                SELECT count(*) as unread  
    9696                    FROM ".$db_prefix."posts p  
    97                         LEFT JOIN ".$db_prefix."threads_read tr ON p.thread_id = tr.thread_id  
     97                        INNER JOIN ".$db_prefix."threads_read tr ON p.thread_id = tr.thread_id  
    9898                    WHERE tr.user_id = '".$userdata['user_id']."'  
    9999                        AND tr.forum_id = '".$data['forum_id']."'  
  • branches/PLi-Fusion/forum/post.php

    r1335 r1509  
    122122        // if it's an image, see if we need to make a thumbnail 
    123123        if (in_array($attachext, $imagetypes)) { 
    124             if (@getimagesize($tmp_name) && @verify_image($tmp_name)) { 
     124            if (@verify_image($tmp_name)) { 
    125125                // it's a valid image. See if we need to generate a thumbnail 
    126126                $imagefile = @getimagesize($tmp_name); 
     
    424424                    $preview['cc_flag'] = GeoIP_Code2Flag($settings['country']); 
    425425                } 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']); 
    427427                } 
    428428            } else { 
     
    434434            $preview['post_edituser'] = 0; 
    435435            $preview['post_ip'] = $userdata['user_ip']; 
     436            $preview['post_cc'] = $userdata['user_cc']; 
    436437            $preview['group_names'] = array(); 
    437438            $preview['group_names'][] = array('type' => 'U', 'level' => $userdata['user_level'], 'name' => getuserlevel($userdata['user_level'])); 
     
    599600                        } 
    600601                        // 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])) { 
    602603                            $error = $locale['458']; 
    603604                        } else { 
    604605                            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; 
    606608                                $result = dbquery("UPDATE ".$db_prefix."forums SET forum_lastpost='".time()."', forum_lastuser='".$userdata['user_id']."' WHERE forum_id='$forum_id'"); 
    607609                                switch ($action) { 
     
    616618                                        break; 
    617619                                } 
    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')"); 
    619621                                $post_id = mysql_insert_id(); 
    620622                                $result = dbquery("UPDATE ".$db_prefix."users SET user_posts=user_posts+1 WHERE user_id='".$userdata['user_id']."'"); 
     
    931933                    case "edit": 
    932934                        $variables['message'] = $pdata['post_message']; 
    933                         $variables['org_message'] = $pdata['post_message']; 
    934935                        break; 
    935936                    case "quote": 
    936937                        $variables['message'] = $variables['orgauthor'] == "" ? "[quote]" : "[quote=".$variables['orgauthor']."]"; 
    937938                        $variables['message'] .= $pdata['post_message']."[/quote]"; 
    938                         $variables['org_message'] = ""; 
    939939                        break; 
    940940                    default: 
    941941                        $variables['message'] = ""; 
    942                         $variables['org_message'] = ""; 
    943                 } 
     942                } 
     943                $variables['org_message'] = $pdata['post_message']; 
    944944                $variables['post_author'] = $pdata['post_author']; 
    945945                $variables['is_smiley_disabled'] = ($pdata['post_smileys'] == "0"); 
  • branches/PLi-Fusion/forum/viewforum.php

    r1335 r1509  
    3838if (file_exists(PATH_MODULES."advertising/get_ad.php")) { 
    3939    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)); 
    4142} else { 
    42     $variables['advert'] = ""; 
     43    $variables['ad1'] = ""; 
     44    $variables['ad2'] = ""; 
    4345} 
    4446 
     
    5052    "SELECT f.*, f2.forum_name AS forum_cat_name, f2.forum_id as forum_cat_id 
    5153    FROM ".$db_prefix."forums f 
    52     LEFT JOIN ".$db_prefix."forums f2 ON f.forum_cat=f2.forum_id 
     54    INNER JOIN ".$db_prefix."forums f2 ON f.forum_cat=f2.forum_id 
    5355    WHERE f.forum_id='".$forum_id."'" 
    5456); 
     
    9092        SELECT p.thread_id 
    9193            FROM ".$db_prefix."posts p 
    92             LEFT JOIN ".$db_prefix."threads_read tr ON p.thread_id = tr.thread_id 
     94            INNER JOIN ".$db_prefix."threads_read tr ON p.thread_id = tr.thread_id 
    9395            WHERE tr.user_id = '".$userdata['user_id']."' 
    9496                AND tr.forum_id = '".$forum_id."' 
     
    110112            SELECT count(*) as unread  
    111113                FROM ".$db_prefix."posts p  
    112                     LEFT JOIN ".$db_prefix."threads_read tr ON p.thread_id = tr.thread_id  
     114                    INNER JOIN ".$db_prefix."threads_read tr ON p.thread_id = tr.thread_id  
    113115                WHERE tr.user_id = '".$userdata['user_id']."'  
    114116                    AND tr.forum_id = '".$forum_id."' 
     
    121123            SELECT count(*) as unread  
    122124                FROM ".$db_prefix."posts p  
    123                     LEFT JOIN ".$db_prefix."threads_read tr ON p.thread_id = tr.thread_id  
     125                    INNER JOIN ".$db_prefix."threads_read tr ON p.thread_id = tr.thread_id  
    124126                WHERE tr.user_id = '".$userdata['user_id']."'  
    125127                    AND tr.forum_id = '".$forum_id."' 
     
    148150    "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,  
    149151            tu2.user_name AS user_lastuser, tu1.user_cc_code AS user_cc_code FROM ".$db_prefix."threads t 
    150         LEFT JOIN ".$db_prefix."posts p USING ( thread_id ) 
    151         LEFT JOIN ".$db_prefix."users tu1 ON t.thread_author = tu1.user_id 
    152         LEFT JOIN ".$db_prefix."users tu2 ON t.thread_lastuser = tu2.user_id 
     152        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 
    153155        WHERE t.forum_id = '".$forum_id."' 
    154156        GROUP BY thread_id 
     
    173175            SELECT count(*) as unread, MIN(p.post_id) as post_id 
    174176                FROM ".$db_prefix."posts p  
    175                 LEFT JOIN ".$db_prefix."threads_read tr ON p.thread_id = tr.thread_id  
     177                INNER JOIN ".$db_prefix."threads_read tr ON p.thread_id = tr.thread_id  
    176178                WHERE tr.user_id = '".$userdata['user_id']."'  
    177179                    AND tr.thread_id = '".$data['thread_id']."' 
  • branches/PLi-Fusion/forum/viewthread.php

    r1408 r1509  
    8686    "SELECT f.*, f2.forum_name AS forum_cat_name 
    8787    FROM ".$db_prefix."forums f 
    88     LEFT JOIN ".$db_prefix."forums f2 ON f.forum_cat=f2.forum_id 
     88    INNER JOIN ".$db_prefix."forums f2 ON f.forum_cat=f2.forum_id 
    8989    WHERE f.forum_id='".$forum_id."'" 
    9090); 
     
    158158        } 
    159159        // 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])) { 
    161161            redirect("post.php?action=quickreply&forum_id=$forum_id&thread_id=$thread_id&post_id=0&errorcode=3"); 
    162162        } else { 
    163163            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; 
    165166                $sig = ($userdata['user_sig'] ? '1' :'0'); 
    166167                $smileys = isset($_POST['disable_smileys']) ? "0" : "1"; 
     
    199200            SELECT count(*) as unread, tr.thread_first_read, tr.thread_last_read 
    200201                FROM ".$db_prefix."posts p 
    201                 LEFT JOIN ".$db_prefix."threads_read tr ON p.thread_id = tr.thread_id 
     202                INNER JOIN ".$db_prefix."threads_read tr ON p.thread_id = tr.thread_id 
    202203                WHERE tr.user_id = '".$userdata['user_id']."'  
    203204                    AND tr.thread_id = '".$thread_id."'  
     
    212213            SELECT count(*) as unread, tr.thread_first_read, tr.thread_last_read 
    213214                FROM ".$db_prefix."posts p 
    214                 LEFT JOIN ".$db_prefix."threads_read tr ON p.thread_id = tr.thread_id 
     215                INNER JOIN ".$db_prefix."threads_read tr ON p.thread_id = tr.thread_id 
    215216                WHERE tr.user_id = '".$userdata['user_id']."' 
    216217                    AND p.post_author != '".$userdata['user_id']."' 
     
    261262    $result = dbquery( 
    262263        "SELECT p.*, u.*, u2.user_name AS edit_name, u2.user_status AS edit_status FROM ".$db_prefix."posts p 
    263         LEFT JOIN ".$db_prefix."users u ON p.post_author = u.user_id 
     264        INNER JOIN ".$db_prefix."users u ON p.post_author = u.user_id 
    264265        LEFT JOIN ".$db_prefix."users u2 ON p.post_edituser = u2.user_id AND post_edituser > '0' 
    265266        WHERE p.thread_id='$thread_id' ORDER BY post_sticky DESC, post_datestamp ASC LIMIT $rowstart,".$settings['numofthreads'] 
     
    267268    $variables['posts'] = array(); 
    268269    while ($data = dbarray($result)) { 
     270 
     271        // default, show no ranking information 
     272        $data['show_ranking'] = false; 
    269273 
    270274        // check for a system-post (author = 0 ), use some of the webmasters details for this 
     
    278282            $data['user_sig'] = ""; 
    279283            $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            } 
    280328        } 
    281329 
     
    301349        $last_post_datestamp = max($data['post_datestamp'], $data['post_edittime'], $last_post_datestamp); 
    302350 
    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 
    305375        $data['show_ip'] = (iMOD || iSUPERADMIN && ($data['post_ip'] != "0.0.0.0" && file_exists(PATH_THEME."images/ip.gif"))); 
    306376     
     
    311381                $data['cc_flag'] = GeoIP_Code2Flag($settings['country']); 
    312382            } 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']); 
    314384            } 
    315385        } else { 
     
    324394        // user & group memberships 
    325395        $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 
    326401        $data['group_names'][] = array('type' => 'U', 'level' => $data['user_level'], 'name' => getuserlevel($data['user_level'])); 
    327402 
  • branches/PLi-Fusion/getfile.php

    r931 r1509  
    311311// parameter validation 
    312312if (!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>"); 
    314314} 
    315315if (!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>"); 
    317317} 
    318318 
     
    330330        $attachment = dbarray(dbquery("SELECT * FROM ".$db_prefix."forum_attachments WHERE attach_id='$file_id'")); 
    331331        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>"); 
    333333        } 
    334334        // check if the post this attachment belongs to exists, if so retrieve the information 
    335335        $post = dbarray(dbquery("SELECT * FROM ".$db_prefix."posts WHERE thread_id = '".$attachment['thread_id']."' AND post_id='".$attachment['post_id']."'")); 
    336336        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>"); 
    338338        } 
    339339        $forum = dbarray(dbquery("SELECT * FROM ".$db_prefix."forums WHERE forum_id = '".$post['forum_id']."'")); 
    340340        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>"); 
    342342        } 
    343343        // if logged in, check if the user has access to this file. if not, print an error and give up 
    344344        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>"); 
    346346        } 
    347347        // if not logged in, and authorisation required, check if userid and password is given and valid 
     
    362362        $attachment = dbarray(dbquery("SELECT * FROM ".$db_prefix."pm_attachments WHERE pmattach_id='$file_id'")); 
    363363        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>"); 
    365365        } 
    366366        // if not logged in, check if userid and password is given and valid (authorisation is required!) 
     
    372372        $result = dbquery("SELECT * FROM ".$db_prefix."pm_index WHERE pm_id = '".$attachment['pm_id']."' AND pmindex_user_id = '".$userdata['user_id']."'"); 
    373373        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>"); 
    375375        } 
    376376        // define the required parameters for the download 
     
    381381 
    382382    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>"); 
    384384} 
    385385 
  • branches/PLi-Fusion/includes/core_functions.php

    r1408 r1509  
    1414+----------------------------------------------------*/ 
    1515if (eregi("core_functions.php", $_SERVER['PHP_SELF'])) die(); 
     16 
     17// disable error reporting, we don't want to give anything away 
     18error_reporting(E_USER_ERROR); 
    1619 
    1720// code to calculate the page loading time, this can be used 
     
    8083define("PATH_ADMIN", PATH_ROOT."administration/"); 
    8184define("PATH_THEMES", PATH_ROOT."themes/"); 
    82 define("PATH_PHOTOS", PATH_ROOT."images/photoalbum/"); 
     85define("PATH_PHOTOS", PATH_ROOT."images/gallery/"); 
    8386define("PATH_IMAGES", PATH_ROOT."images/"); 
    8487define("PATH_IMAGES_A", PATH_IMAGES."articles/"); 
     
    97100 
    98101// 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"; 
     103if (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    } 
    101111} 
    102112 
    103113// 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 documentation on how to run the setup'); 
     114if (!isset($db_name)) terminate('FATAL ERROR: config file is missing. Check our Wiki at http://exitecms.exite.eu on how to run the setup'); 
    105115 
    106116// load the database functions, and establish a database connection 
     
    186196require_once PATH_INCLUDES."user_functions.php"; 
    187197 
    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 
     201if ($_db_log) { 
     202    error_reporting(E_ALL); 
    191203} 
    192204 
     
    221233 
    222234// image types we can generate a thumbnail from 
    223 $thumbtypes = array(".gif",".jpg",".jpeg",".png",); 
     235$thumbtypes = array(".gif",".jpg",".jpeg",".png",".bmp", ".psd"); 
    224236 
    225237// debug function, handy to print a standard debug text 
     
    227239 
    228240    if (is_array($text)) { 
     241        echo "<br /><hr /><br /><pre>"; print_r($text); echo "</pre><br /><hr /><br />"; 
     242    } elseif (is_object($text)) { 
    229243        echo "<br /><hr /><br /><pre>"; print_r($text); echo "</pre><br /><hr /><br />"; 
    230244    } else { 
     
    352366} 
    353367 
    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&gt;#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 
     369function 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 
     374function isURL($value, $onlyhttp=false) { 
    545375 
    546376    // 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    } 
    548382    $urlregex = "^(".$scheme.")?";                                              // make the scheme optional 
    549383    $urlregex .= "([a-z0-9+!*(),;?&=\$_.-]+(\:[a-z0-9+!*(),;?&=\$_.-]+)?@)?";   // USERID + PASSWORD (optional) 
     
    553387    $urlregex .= "(\?[a-z+&\$_.-][a-z0-9;:@/&%=+\$_.-]*)?";                     // GET querystring (optional) 
    554388    $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 
     394function 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&gt;" => "<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] 
     580function _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    } 
    555586 
    556587    // validate the URL (in $matches[1]) 
    557     if (eregi($urlregex, $matches[2])) { 
     588    if (isURL($matches[2])) { 
    558589        // 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])) { 
    560591            $matches[2] = "http://".$matches[2]; 
    561592        } 
     
    566597        return stripinput($matches[0]); 
    567598    } 
     599} 
     600 
     601// internal function: preg_replace_callback for parseubb, to validate the IMG found in [img] 
     602function _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]); 
    568613} 
    569614 
     
    580625    $text = preg_replace('#\[center\](.*?)\[/center\]#si', '<center>\1</center>', $text); 
    581626 
    582     // new youtube bbcode 
    583     $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  
    585627    // new wiki bbcode 
    586628    if (isset($settings['wiki_forum_links']) && $settings['wiki_forum_links']) { 
    587629        // 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); 
    589631    } else { 
    590632        // strip the wiki bbcode 
     
    601643    $text = preg_replace('#\[mail\]([\r\n]*)([^\s\'\";:\+]*?)([\r\n]*)\[/mail\]#si', '<a href=\'mailto:\2\'>\2</a>', $text); 
    602644    $text = preg_replace('#\[mail=([\r\n]*)([^\s\'\";:\+]*?)\](.*?)([\r\n]*)\[/mail\]#si', '<a href=\'mailto:\2\'>\3</a>', $text); 
    603      
     645    // small     
    604646    $text = preg_replace('#\[small\](.*?)\[/small\]#si', '<span class=\'small\'>\1</span>', $text); 
     647    // color 
    605648    $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 
    607652    $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 
    610660    $text = preg_replace('#\[quote=([\r\n]*)(.*?)\]#si', '<b>\2 '.$locale['199'].':</b><br />[quote]', $text); 
    611  
    612661    $qcount = substr_count($text, "[quote]"); $ccount = substr_count($text, "[code]"); 
    613662    for ($i=0;$i < $qcount;$i++) $text = preg_replace('#\[quote\](.*?)\[/quote\]#si', '<div class=\'quote\'>\1</div>', $text); 
     
    646695    $text = preg_replace('#([a-z]*)=([\`\'\"]*)javascript:#iU', '$1=$2nojavascript...', $text); 
    647696    $text = preg_replace('#([a-z]*)=([\'\"]*)vbscript:#iU', '$1=$2novbscript...', $text); 
    648         //<span style="width: expression(alert('Ping!'));"></span> (only affects ie...) 
    649697    $text = preg_replace('#(<[^>]+)style=([\`\'\"]*).*expression\([^>]*>#iU', "$1>", $text); 
    650698    $text = preg_replace('#(<[^>]+)style=([\`\'\"]*).*behaviour\([^>]*>#iU', "$1>", $text); 
     
    660708// Scan image files for malicious code 
    661709function verify_image($file) { 
    662     $txt = file_get_contents($file); 
    663710    $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    } 
    673730    return $image_safe; 
    674731} 
     
    9811038    } 
    9821039} 
     1040 
     1041 
     1042// replacement for die() 
     1043function terminate($text) { 
     1044    die("<div style='font-family:Verdana,Sans-serif;font-size:11px;text-align:center;'>$text</div>"); 
     1045} 
    9831046?> 
  • branches/PLi-Fusion/includes/db_functions.php

    r1408 r1509  
    2424// database global variables 
    2525$_db_debug = false; 
    26 $_db_log = false; 
     26$_db_log = true; 
    2727$_db_logs = array(); 
    2828$_db_last_function = ""; 
     
    5353 
    5454// MySQL database functions 
    55 function dbquery($query, $display=true) { 
    56  
    57     global $_db_last_function, $_db_debug, $_db_log, $_db_logs, $_loadstats; 
     55function dbquery($query, $display=false) { 
     56 
     57    global $_db_last_function, $_db_debug, $_db_log, $_db_logs, $_loadstats, $settings; 
    5858 
    5959    // update the query for relocated user tables 
    6060    ModUserTables($query); 
    61  
    62     $_s_loadtime = explode(" ", microtime()); 
    63     $_s_loadtime = $_s_loadtime[1] + $_s_loadtime[0]; 
    64     $_loadstats['querytime'] -= $_s_loadtime; 
    6561 
    6662    if ($_db_debug) { 
     
    8783    } 
    8884 
    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 
    9095    if (!$result) { 
    91         if ($display) { 
     96        if ($display || $settings['debug_querylog']) { 
    9297            echo "<pre><br />Query: ".$query."<br />"; 
    9398            echo mysql_error(); 
    9499            echo "</pre>";