'#description'=>t('The default sorting for new users and anonymous users while viewing comments. These users may change their view using the comment control panel. For registered users, this change is remembered as a persistent user preference.')
'#description'=>t('The default sorting for new users and anonymous users while viewing comments. These users may change their view using the comment control panel. For registered users, this change is remembered as a persistent user preference.'),
@@ -343,10 +349,16 @@ function comment_configure() {
t('Display below the comments'),
t('Display above and below the comments'),
t('Do not display')),
'#description'=>t('Position of the comment controls box. The comment controls let the user change the default display mode and display order of comments.')
'#description'=>t('Position of the comment controls box. The comment controls let the user change the default display mode and display order of comments.'),
@@ -356,7 +368,7 @@ function comment_configure() {
COMMENT_ANONYMOUS_MAYNOT_CONTACT=>t('Anonymous posters may not enter their contact information'),
COMMENT_ANONYMOUS_MAY_CONTACT=>t('Anonymous posters may leave their contact information'),
COMMENT_ANONYMOUS_MUST_CONTACT=>t('Anonymous posters must leave their contact information')),
'#description'=>t('This feature is only useful if you allow anonymous users to post comments. See the <a href="%url">permissions page</a>.',array('%url'=>url('admin/access/permissions')))
'#description'=>t('This feature is only useful if you allow anonymous users to post comments. See the <a href="%url">permissions page</a>.',array('%url'=>url('admin/access/permissions'))),
// comment could not be posted. show edit form with errors
returncomment_preview($edit);
}
else{
drupal_goto("node/$nid",NULL,"comment-$cid");
}
}
elseif($_POST['op']==t('Preview comment')){
$edit=$_POST['edit'];
$edit=comment_validate($edit);
drupal_set_title(t('Preview comment'));
returncomment_preview($edit);
}
$output='';
// or are we merely showing the form?
if(user_access('access comments')){
// if this is a reply to another comment, show that comment first
// else, we'll just show the user the node they're commenting on.
if($pid){
$comment=db_fetch_object(db_query('SELECT c.*, u.uid, u.name AS registered_name, u.picture, u.data FROM {comments} c INNER JOIN {users} u ON c.uid = u.uid WHERE c.cid = %d AND c.status = %d',$pid,COMMENT_PUBLISHED));
drupal_set_message(t('You are not authorized to post comments.'),'error');
}
}
else{
drupal_set_message(t('You are not authorized to post comments.'),'error');
// if this is a reply to another comment, show that comment first
// else, we'll just show the user the node they're commenting on.
if($pid){
$comment=db_fetch_object(db_query('SELECT c.*, u.uid, u.name AS registered_name, u.picture, u.data FROM {comments} c INNER JOIN {users} u ON c.uid = u.uid WHERE c.cid = %d AND c.status = %d',$pid,COMMENT_PUBLISHED));
$comment=db_fetch_object(db_query('SELECT c.*, u.uid, u.name AS registered_name, u.picture, u.data FROM {comments} c INNER JOIN {users} u ON c.uid = u.uid WHERE c.cid = %d AND c.status = %d',$edit['pid'],COMMENT_PUBLISHED));
$comment=db_fetch_object(db_query('SELECT c.*, u.uid, u.name AS registered_name, u.picture, u.data FROM {comments} c INNER JOIN {users} u ON c.uid = u.uid WHERE c.cid = %d AND c.status = %d',$edit['pid'],COMMENT_PUBLISHED));
'#description'=>t('The default sorting for new users and anonymous users while viewing comments. These users may change their view using the comment control panel. For registered users, this change is remembered as a persistent user preference.')
'#description'=>t('The default sorting for new users and anonymous users while viewing comments. These users may change their view using the comment control panel. For registered users, this change is remembered as a persistent user preference.'),
@@ -343,10 +349,16 @@ function comment_configure() {
t('Display below the comments'),
t('Display above and below the comments'),
t('Do not display')),
'#description'=>t('Position of the comment controls box. The comment controls let the user change the default display mode and display order of comments.')
'#description'=>t('Position of the comment controls box. The comment controls let the user change the default display mode and display order of comments.'),
@@ -356,7 +368,7 @@ function comment_configure() {
COMMENT_ANONYMOUS_MAYNOT_CONTACT=>t('Anonymous posters may not enter their contact information'),
COMMENT_ANONYMOUS_MAY_CONTACT=>t('Anonymous posters may leave their contact information'),
COMMENT_ANONYMOUS_MUST_CONTACT=>t('Anonymous posters must leave their contact information')),
'#description'=>t('This feature is only useful if you allow anonymous users to post comments. See the <a href="%url">permissions page</a>.',array('%url'=>url('admin/access/permissions')))
'#description'=>t('This feature is only useful if you allow anonymous users to post comments. See the <a href="%url">permissions page</a>.',array('%url'=>url('admin/access/permissions'))),
// comment could not be posted. show edit form with errors
returncomment_preview($edit);
}
else{
drupal_goto("node/$nid",NULL,"comment-$cid");
}
}
elseif($_POST['op']==t('Preview comment')){
$edit=$_POST['edit'];
$edit=comment_validate($edit);
drupal_set_title(t('Preview comment'));
returncomment_preview($edit);
}
$output='';
// or are we merely showing the form?
if(user_access('access comments')){
// if this is a reply to another comment, show that comment first
// else, we'll just show the user the node they're commenting on.
if($pid){
$comment=db_fetch_object(db_query('SELECT c.*, u.uid, u.name AS registered_name, u.picture, u.data FROM {comments} c INNER JOIN {users} u ON c.uid = u.uid WHERE c.cid = %d AND c.status = %d',$pid,COMMENT_PUBLISHED));
drupal_set_message(t('You are not authorized to post comments.'),'error');
}
}
else{
drupal_set_message(t('You are not authorized to post comments.'),'error');
// if this is a reply to another comment, show that comment first
// else, we'll just show the user the node they're commenting on.
if($pid){
$comment=db_fetch_object(db_query('SELECT c.*, u.uid, u.name AS registered_name, u.picture, u.data FROM {comments} c INNER JOIN {users} u ON c.uid = u.uid WHERE c.cid = %d AND c.status = %d',$pid,COMMENT_PUBLISHED));
$comment=db_fetch_object(db_query('SELECT c.*, u.uid, u.name AS registered_name, u.picture, u.data FROM {comments} c INNER JOIN {users} u ON c.uid = u.uid WHERE c.cid = %d AND c.status = %d',$edit['pid'],COMMENT_PUBLISHED));