aboutsummaryrefslogtreecommitdiffstats
path: root/admin
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--admin.php1
-rw-r--r--admin/cat_options.php41
-rw-r--r--admin/configuration.php39
3 files changed, 42 insertions, 39 deletions
diff --git a/admin.php b/admin.php
index 9282f3430..90a6d63b2 100644
--- a/admin.php
+++ b/admin.php
@@ -94,6 +94,7 @@ $template->assign_vars(
'U_CATEGORIES'=> $link_start.'cat_list',
'U_MOVE'=> $link_start.'cat_move',
'U_CAT_UPLOAD'=> $opt_link.'upload',
+ 'U_CAT_COMMENTS'=> $opt_link.'comments',
'U_CAT_VISIBLE'=> $opt_link.'visible',
'U_CAT_STATUS'=> $opt_link.'status',
'U_CAT_OPTIONS'=> $link_start.'cat_options',
diff --git a/admin/cat_options.php b/admin/cat_options.php
index 305c764c1..8aaf4ad14 100644
--- a/admin/cat_options.php
+++ b/admin/cat_options.php
@@ -60,6 +60,16 @@ UPDATE '.CATEGORIES_TABLE.'
pwg_query($query);
break;
}
+ case 'comments' :
+ {
+ $query = '
+UPDATE '.CATEGORIES_TABLE.'
+ SET commentable = \'false\'
+ WHERE id IN ('.implode(',', $_POST['cat_true']).')
+;';
+ pwg_query($query);
+ break;
+ }
case 'visible' :
{
set_cat_visible($_POST['cat_true'], 'false');
@@ -98,6 +108,16 @@ UPDATE '.CATEGORIES_TABLE.'
pwg_query($query);
break;
}
+ case 'comments' :
+ {
+ $query = '
+UPDATE '.CATEGORIES_TABLE.'
+ SET commentable = \'true\'
+ WHERE id IN ('.implode(',', $_POST['cat_false']).')
+;';
+ pwg_query($query);
+ break;
+ }
case 'visible' :
{
set_cat_visible($_POST['cat_false'], 'true');
@@ -185,6 +205,27 @@ SELECT id,name,uppercats,global_rank
);
break;
}
+ case 'comments' :
+ {
+ $query_true = '
+SELECT id,name,uppercats,global_rank
+ FROM '.CATEGORIES_TABLE.'
+ WHERE commentable = \'true\'
+;';
+ $query_false = '
+SELECT id,name,uppercats,global_rank
+ FROM '.CATEGORIES_TABLE.'
+ WHERE commentable = \'false\'
+;';
+ $template->assign_vars(
+ array(
+ 'L_SECTION' => $lang['cat_comments_title'],
+ 'L_CAT_OPTIONS_TRUE' => $lang['authorized'],
+ 'L_CAT_OPTIONS_FALSE' => $lang['forbidden'],
+ )
+ );
+ break;
+ }
case 'visible' :
{
$query_true = '
diff --git a/admin/configuration.php b/admin/configuration.php
index c45fddc85..12235cce6 100644
--- a/admin/configuration.php
+++ b/admin/configuration.php
@@ -158,32 +158,6 @@ UPDATE '.CONFIG_TABLE.'
load_conf_from_db();
}
-if ( $page['section']=='comments' and !is_adviser() )
-{
- if (isset($_POST['falsify'])
- and isset($_POST['cat_true'])
- and count($_POST['cat_true']) > 0)
- {
- $query = '
-UPDATE '.CATEGORIES_TABLE.'
- SET commentable = \'false\'
- WHERE id IN ('.implode(',', $_POST['cat_true']).')
-;';
- pwg_query($query);
- }
- if (isset($_POST['trueify'])
- and isset($_POST['cat_false'])
- and count($_POST['cat_false']) > 0)
- {
- $query = '
-UPDATE '.CATEGORIES_TABLE.'
- SET commentable = \'true\'
- WHERE id IN ('.implode(',', $_POST['cat_false']).')
-;';
- pwg_query($query);
- }
-}
-
//----------------------------------------------------- template initialization
$template->set_filenames( array('config'=>'admin/configuration.tpl') );
@@ -252,19 +226,6 @@ switch ($page['section'])
)
);
}
-
- $query_true = '
-SELECT id,name,uppercats,global_rank
- FROM '.CATEGORIES_TABLE.'
- WHERE commentable = \'true\'
-;';
- $query_false = '
-SELECT id,name,uppercats,global_rank
- FROM '.CATEGORIES_TABLE.'
- WHERE commentable = \'false\'
-;';
- display_select_cat_wrapper($query_true,array(),'comments.category_option_true');
- display_select_cat_wrapper($query_false,array(),'comments.category_option_false');
break;
}
case 'default' :