Changeset 2360 in ExiteCMS
- Timestamp:
- 07/26/10 12:06:04 (19 months ago)
- Location:
- trunk
- Files:
-
- 1 added
- 6 edited
-
administration/forums.php (modified) (6 diffs)
-
administration/tools/language_pack_English.php (modified) (8 diffs)
-
administration/tools/language_pack_Nederlands.php (modified) (8 diffs)
-
administration/upgrade/rev02360.php (added)
-
forum/post.php (modified) (2 diffs)
-
includes/templates/admin.forums.tpl (modified) (4 diffs)
-
includes/templates/forum.post.tpl (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/administration/forums.php
r2341 r2360 215 215 $forum_attach = isset($_POST['forum_attach'])?"1":"0"; 216 216 $forum_attachtypes = stripinput($_POST['forum_attachtypes']); 217 $forum_prefix = isset($_POST['forum_prefix'])?"1":"0"; 217 218 $forum_prefixes = stripinput($_POST['forum_prefixes']); 218 219 if ($action == "edit" && $t == "forum") { … … 240 241 } 241 242 // update the forum record 242 $result = dbquery("UPDATE ".$db_prefix."forums SET forum_name='".mysql_real_escape_string($forum_name)."', forum_cat='$forum_cat', forum_description='".mysql_real_escape_string($forum_description)."', forum_access='$forum_access', forum_posting='$forum_posting', forum_modgroup='$forum_modgroup', forum_attach='$forum_attach', forum_attachtypes='$forum_attachtypes', forum_prefix es='".mysql_real_escape_string($forum_prefixes)."', forum_rulespage='$forum_rulespage', forum_banners='$forum_banners' WHERE forum_id='$forum_id'");243 $result = dbquery("UPDATE ".$db_prefix."forums SET forum_name='".mysql_real_escape_string($forum_name)."', forum_cat='$forum_cat', forum_description='".mysql_real_escape_string($forum_description)."', forum_access='$forum_access', forum_posting='$forum_posting', forum_modgroup='$forum_modgroup', forum_attach='$forum_attach', forum_attachtypes='$forum_attachtypes', forum_prefix='$forum_prefix', forum_prefixes='".mysql_real_escape_string($forum_prefixes)."', forum_rulespage='$forum_rulespage', forum_banners='$forum_banners' WHERE forum_id='$forum_id'"); 243 244 redirect(FUSION_SELF.$aidlink."&status=savefe"); 244 245 } else { … … 248 249 if(!$forum_order) $forum_order=dbfunction("MAX(forum_order)", "forums", "forum_cat='$forum_cat'")+1; 249 250 $result = dbquery("UPDATE ".$db_prefix."forums SET forum_order=forum_order+1 WHERE forum_cat='$forum_cat' AND forum_order>='$forum_order'"); 250 $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_prefix es, 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', '".mysql_real_escape_string($forum_prefixes)."', '$forum_rulespage', '$forum_banners', '0', '0')");251 $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_prefix, forum_prefixes, 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_prefix', '".mysql_real_escape_string($forum_prefixes)."', '$forum_rulespage', '$forum_banners', '0', '0')"); 251 252 redirect(FUSION_SELF.$aidlink."&status=savefu"); 252 253 } … … 321 322 $forum_attach = $data['forum_attach']?true:false; 322 323 $forum_attachtypes = $data['forum_attachtypes']; 324 $forum_prefix = $data['forum_prefix']; 323 325 $forum_prefixes = $data['forum_prefixes']; 324 326 $forum_title = $locale['422']; … … 346 348 $forum_attach = ($settings['attachments'] == 1); 347 349 $forum_attachtypes = $settings['attachtypes']; 350 $forum_prefix = 0; 348 351 $forum_prefixes = ""; 349 352 $forum_title = $locale['421']; … … 420 423 $variables['forum_attach'] = $forum_attach; 421 424 $variables['forum_attachtypes'] = $forum_attachtypes; 425 $variables['forum_prefix'] = $forum_prefix; 422 426 $variables['forum_prefixes'] = $forum_prefixes; 423 427 $variables['forum_rulespage'] = $forum_rulespage; -
trunk/administration/tools/language_pack_English.php
r2354 r2360 1 <?php 1 <?php 2 2 /*---------------------------------------------------------------------+ 3 3 | ExiteCMS Content Management System | … … 368 368 $localestrings['493'] = "Refresh Forum Ordering"; 369 369 $localestrings['494'] = "Subject prefix list:"; 370 $localestrings['495'] = "Use subject prefixes in this forum"; 370 371 load_localestrings($localestrings, LP_LOCALE, "admin.forums", $step); 371 372 … … 3820 3821 function load_localestrings($localestrings, $locales_code, $locales_name, $step="") { 3821 3822 global $db_prefix, $_db_log; 3822 3823 3823 3824 // if this is an upgrade, remove the old locale strings first 3824 3825 if ($step == "upgrade") { … … 3863 3864 locale_load("admin.main"); 3864 3865 } 3865 3866 3866 3867 if (defined('CMS_SETUP') && !defined('CMS_SETUP_LOAD')) { 3867 3868 // skip if in setup and no load request was given … … 3874 3875 require_once PATH_INCLUDES."theme_functions.php"; 3875 3876 } 3876 3877 3877 3878 // used to store template variables 3878 3879 $variables = array(); 3879 3880 3880 3881 // message variable 3881 3882 $variables['message'] = ""; 3882 3883 3883 3884 // make sure step has a value 3884 3885 if (!isset($step)) $step = ""; 3885 3886 3886 3887 // de-install the language pack 3887 3888 if ($step == "remove") { … … 3903 3904 } 3904 3905 } 3905 3906 3906 3907 // install the language pack 3907 3908 if ($step == "install" || $step == "upgrade") { … … 3927 3928 } 3928 3929 } 3929 3930 3930 3931 if (defined('CMS_SETUP')) { 3931 3932 3932 3933 // no output at all in setup mode 3933 3934 3934 3935 } elseif (CMS_CLI) { 3935 3936 3936 3937 // output in CLI mode 3937 3938 echo "Language pack installed.\n"; 3938 3939 3939 3940 } else { 3940 3941 3941 3942 // interactive mode 3942 3943 require_once PATH_INCLUDES."theme_functions.php"; 3943 3944 3944 3945 // countries for which this language pack applies 3945 3946 $variables['flags'] = explode("|", LP_COUNTRIES); … … 3947 3948 // check the last update of the locale 3948 3949 $variables['last_update'] = isset($settings['LanguagePack.'.LP_LANGUAGE]) ? $settings['LanguagePack.'.LP_LANGUAGE] : min(LP_DATE - 1, dbfunction("MAX(locales_datestamp)", "locales", "locales_code = '".LP_LOCALE."' AND locales_name NOT LIKE 'modules%'")); 3949 3950 3950 3951 // check if this language pack has been installed 3951 3952 $variables['can_install'] = dbcount("(*)", "locale", "locale_code = '".LP_LOCALE."'") == 0; 3952 3953 $variables['can_remove'] = LP_LOCALE != $settings['default_locale'] && $variables['can_install'] == false; 3953 3954 $variables['can_upgrade'] = $variables['can_install'] == false && $variables['last_update'] < LP_DATE; 3954 3955 3955 3956 // define the body panel variables 3956 3957 $template_panels[] = array('type' => 'body', 'name' => 'admin.tools.languagepack', 'title' => "ExiteCMS Language Packs", 'template' => 'admin.tools.languagepack.tpl', 'locale' => "admin.main"); 3957 3958 $template_variables['admin.tools.languagepack'] = $variables; 3958 3959 3959 3960 // Call the theme code to generate the output for this webpage 3960 3961 require_once PATH_THEME."/theme.php"; -
trunk/administration/tools/language_pack_Nederlands.php
r2354 r2360 1 <?php 1 <?php 2 2 /*---------------------------------------------------------------------+ 3 3 | ExiteCMS Content Management System | … … 368 368 $localestrings['493'] = "Volgorde herrekenen"; 369 369 $localestrings['494'] = "Topic prefix lijst:"; 370 $localestrings['495'] = "Gebruik topic prefixen voor dit forum"; 370 371 load_localestrings($localestrings, LP_LOCALE, "admin.forums", $step); 371 372 … … 3820 3821 function load_localestrings($localestrings, $locales_code, $locales_name, $step="") { 3821 3822 global $db_prefix, $_db_log; 3822 3823 3823 3824 // if this is an upgrade, remove the old locale strings first 3824 3825 if ($step == "upgrade") { … … 3863 3864 locale_load("admin.main"); 3864 3865 } 3865 3866 3866 3867 if (defined('CMS_SETUP') && !defined('CMS_SETUP_LOAD')) { 3867 3868 // skip if in setup and no load request was given … … 3874 3875 require_once PATH_INCLUDES."theme_functions.php"; 3875 3876 } 3876 3877 3877 3878 // used to store template variables 3878 3879 $variables = array(); 3879 3880 3880 3881 // message variable 3881 3882 $variables['message'] = ""; 3882 3883 3883 3884 // make sure step has a value 3884 3885 if (!isset($step)) $step = ""; 3885 3886 3886 3887 // de-install the language pack 3887 3888 if ($step == "remove") { … … 3903 3904 } 3904 3905 } 3905 3906 3906 3907 // install the language pack 3907 3908 if ($step == "install" || $step == "upgrade") { … … 3927 3928 } 3928 3929 } 3929 3930 3930 3931 if (defined('CMS_SETUP')) { 3931 3932 3932 3933 // no output at all in setup mode 3933 3934 3934 3935 } elseif (CMS_CLI) { 3935 3936 3936 3937 // output in CLI mode 3937 3938 echo "Language pack installed.\n"; 3938 3939 3939 3940 } else { 3940 3941 3941 3942 // interactive mode 3942 3943 require_once PATH_INCLUDES."theme_functions.php"; 3943 3944 3944 3945 // countries for which this language pack applies 3945 3946 $variables['flags'] = explode("|", LP_COUNTRIES); … … 3947 3948 // check the last update of the locale 3948 3949 $variables['last_update'] = isset($settings['LanguagePack.'.LP_LANGUAGE]) ? $settings['LanguagePack.'.LP_LANGUAGE] : min(LP_DATE - 1, dbfunction("MAX(locales_datestamp)", "locales", "locales_code = '".LP_LOCALE."' AND locales_name NOT LIKE 'modules%'")); 3949 3950 3950 3951 // check if this language pack has been installed 3951 3952 $variables['can_install'] = dbcount("(*)", "locale", "locale_code = '".LP_LOCALE."'") == 0; 3952 3953 $variables['can_remove'] = LP_LOCALE != $settings['default_locale'] && $variables['can_install'] == false; 3953 3954 $variables['can_upgrade'] = $variables['can_install'] == false && $variables['last_update'] < LP_DATE; 3954 3955 3955 3956 // define the body panel variables 3956 3957 $template_panels[] = array('type' => 'body', 'name' => 'admin.tools.languagepack', 'title' => "ExiteCMS Language Packs", 'template' => 'admin.tools.languagepack.tpl', 'locale' => "admin.main"); 3957 3958 $template_variables['admin.tools.languagepack'] = $variables; 3958 3959 3959 3960 // Call the theme code to generate the output for this webpage 3960 3961 require_once PATH_THEME."/theme.php"; -
trunk/forum/post.php
r2358 r2360 72 72 73 73 // is a prefix required? 74 if ( !empty($fdata['forum_prefixes']) && empty($_POST['new_prefix'])) {74 if ($fdata['forum_prefix'] && !empty($fdata['forum_prefixes']) && empty($_POST['new_prefix'])) { 75 75 return $locale['475']; 76 76 } … … 691 691 } 692 692 } 693 $subject = add_prefix($subject, stripinput($_POST['new_prefix'])); 693 if ($fdata['forum_prefix']) { 694 $subject = add_prefix($subject, stripinput($_POST['new_prefix'])); 695 } 694 696 $message = trim(stripmessageinput(censorwords($_POST['message']))); 695 697 if ($action == 'edit') { -
trunk/includes/templates/admin.forums.tpl
r2341 r2360 65 65 <tr> 66 66 <td colspan='2' class='tbl'> 67 <input type='checkbox' name='forum_prefix' value='1' onchange='togglefields("prefixes");'{if $forum_prefix} checked="checked"{/if} /> {$locale.495} 68 </td> 69 </tr> 70 <tr id='prefixes'{if !$forum_prefix} style='display:none'{/if}> 71 <td colspan='2' class='tbl'> 67 72 {$locale.494} 68 73 <br /> … … 145 150 <tr> 146 151 <td colspan='2' class='tbl'> 147 <input type='checkbox' name='forum_attach' value='1' onchange='togglefields( );'{if $forum_attach} checked="checked"{/if} /> {$locale.469}152 <input type='checkbox' name='forum_attach' value='1' onchange='togglefields("attachtypes");'{if $forum_attach} checked="checked"{/if} /> {$locale.469} 148 153 </td> 149 154 </tr> … … 167 172 </form> 168 173 {literal}<script type='text/javascript'> 169 function togglefields( ) {174 function togglefields(name) { 170 175 if(navigator.appName.indexOf('Microsoft') > -1) { 171 176 state = 'block'; … … 173 178 state = 'table-row'; 174 179 } 175 if (document.getElementById( 'attachtypes').style.display == 'none') {176 document.getElementById( 'attachtypes').style.display = state;180 if (document.getElementById(name).style.display == 'none') { 181 document.getElementById(name).style.display = state; 177 182 } else { 178 document.getElementById( 'attachtypes').style.display = 'none';183 document.getElementById(name).style.display = 'none'; 179 184 } 180 185 } -
trunk/includes/templates/forum.post.tpl
r2353 r2360 124 124 <td> 125 125 <table width='100%' border='0' cellspacing='1' cellpadding='0'> 126 <tr >126 <tr {if $forum.forum_prefix == 0}style="display:none;"{/if}> 127 127 <td align='right' width='145' valign='top' class='tbl2'> 128 128 {$locale.533}:
Note: See TracChangeset
for help on using the changeset viewer.
