# HG changeset patch
# User Dan
# Date 1269115538 14400
# Node ID 7dca925b0209af7c3bedcab4c81f706f70fec098
# Parent d1ded7b4c7753f7df4c78a89ce36a2ffbb9ed7e8
Fixed "unapproved" status taking precedence over "spam" flag in comment submit and some display related bugs in comments.js
diff -r d1ded7b4c775 -r 7dca925b0209 includes/clientside/static/comments.js
--- a/includes/clientside/static/comments.js Wed Mar 17 14:21:46 2010 -0400
+++ b/includes/clientside/static/comments.js Sat Mar 20 16:05:38 2010 -0400
@@ -399,7 +399,7 @@
}
if ( data.approved && data.approved != '1' )
{
- document.getElementById('subject_' + data.id).innerHTML += ' ' + $lang.get('comment_msg_note_unapp') + '';
+ document.getElementById('subject_' + data.id).innerHTML += ' ' + ( data.approved == '2' ? $lang.get('comment_msg_note_spam') : $lang.get('comment_msg_note_unapp') ) + '';
}
if ( data.approved && ( typeof(data.approve_updated) == 'string' && data.approve_updated == 'yes' ) )
{
@@ -495,7 +495,7 @@
tplvars.NAME = '' + data.name + '';
if ( data.approved != '1' )
- tplvars.SUBJECT += ' ' + $lang.get('comment_msg_note_unapp') + '';
+ tplvars.SUBJECT += ' ' + ( data.approved == '2' ? $lang.get('comment_msg_note_spam') : $lang.get('comment_msg_note_unapp') ) + '';
// Name
tplvars.NAME = data.name;
@@ -520,10 +520,10 @@
tplvars.USER_LEVEL += $lang.get(data.rank_data.rank_title);
// Send PM link
- tplvars.SEND_PM_LINK=(data.user_id>1)?'' + $lang.get('comment_btn_send_privmsg') + '
':'';
+ tplvars.SEND_PM_LINK=(data.user_id>1)?'' + $lang.get('comment_btn_send_privmsg') + '
':'';
// Add buddy link
- tplvars.ADD_BUDDY_LINK=(data.user_id>1)?'' + $lang.get('comment_btn_add_buddy') + '
':'';
+ tplvars.ADD_BUDDY_LINK=(data.user_id>1)?'' + $lang.get('comment_btn_add_buddy') + '
':'';
// Edit link
tplvars.EDIT_LINK='' + $lang.get('comment_btn_edit') + '';
diff -r d1ded7b4c775 -r 7dca925b0209 includes/comment.php
--- a/includes/comment.php Wed Mar 17 14:21:46 2010 -0400
+++ b/includes/comment.php Sat Mar 20 16:05:38 2010 -0400
@@ -340,7 +340,7 @@
$sql_text = $db->escape($text);
$text = RenderMan::render($text);
$appr = ( getConfig('approve_comments', '0') == '1' ) ? COMMENT_UNAPPROVED : COMMENT_APPROVED;
- if ( $appr === COMMENT_APPROVED && $spam_policy === 'moderate' && !$spamcheck )
+ if ( $spam_policy === 'moderate' && !$spamcheck )
$appr = COMMENT_SPAM;
$time = time();
$date = enano_date(ED_DATE | ED_TIME, $time);
diff -r d1ded7b4c775 -r 7dca925b0209 includes/functions.php
--- a/includes/functions.php Wed Mar 17 14:21:46 2010 -0400
+++ b/includes/functions.php Sat Mar 20 16:05:38 2010 -0400
@@ -221,7 +221,15 @@
function get_server_url()
{
- return 'http' . ( $GLOBALS['is_https'] ) . '://' . $_SERVER['HTTP_HOST'];
+ $server_name = false;
+ if ( isset($_SERVER['HTTP_HOST']) )
+ $server_name = $_SERVER['HTTP_HOST'];
+ else if ( isset($_SERVER['SERVER_NAME']) )
+ $server_name = $_SERVER['SERVER_NAME'];
+ else
+ $server_name = 'localhost';
+
+ return 'http' . ( $GLOBALS['is_https'] ) . '://' . $server_name;
}
/**