comment_save_settings
- Versions
- 4.6
comment_save_settings()
Code
modules/comment.module, line 1294
<?php
function comment_save_settings() {
$mode = db_escape_string($_POST['mode']);
$order = db_escape_string($_POST['order']);
$threshold = db_escape_string($_POST['threshold']);
$comments_per_page = db_escape_string($_POST['comments_per_page']);
global $user;
$edit = $_POST['edit'];
// this functions perform doubletime: it either saves the
// user's comment viewing options, or it handles comment
// moderation. let's figure out which one we're using, eh?
if ($edit['moderation']) {
comment_moderate();
}
else if ($user->uid) {
$user = user_save($user, array('mode' => $mode, 'sort' => $order, 'threshold' => $threshold, 'comments_per_page' => $comments_per_page));
}
else {
$_SESSION['comment_mode'] = $mode;
$_SESSION['comment_sort'] = $order;
$_SESSION['comment_threshold'] = $threshold;
$_SESSION['comment_comments_per_page'] = $comments_per_page;
}
drupal_goto('node/'. $edit['nid'], NULL, 'comment');
}
?>Login or register to post comments 