This is the community forum. For a developer response use the Client Area.
Follow us on Facebook, Twitter and YouTube!

Not able to add comments
#1

Hello everyone,

All my work is done locally.
I have two problems with adding "commentics" code to my web pages.
When I use the example.php file that is given by the Commentics in the initial folder created at unzip time EVERYTHING is OK.
1. I move example.php into the folder of my site and change the ../comments/ (as explained in the documentation) for both css and the $path...... In this situation I cannot add anymore comments because I get :

"Comments
You have just been banned.

This can be due to a variety of reasons including swearing, spamming and hacker-related behaviour.

If you feel that this was in error, please contact the administrator, quoting your IP Address."

Even after cleaning the cookies, deleting the records in the banned table (where the reason says: Incorrect referrer.) and even after changing the php code in the processor.php as following:

function cmtx_check_if_banned() { //check if user is banned

global $mysql_table_prefix, $ip_address; //globalise variables

$ban_found = false; //initialise flag as false

if (mysql_num_rows(mysql_query("SELECT * FROM `".$mysql_table_prefix."banned` WHERE ip_address = '$ip_address'"))) { //if user's IP address is found in 'banned' database table
$ban_found = false; //set flag as true
}

if (isset($_COOKIE['Commentics-Ban']) && $_COOKIE['Commentics-Ban'] == "Banned") { //if a banning-cookie is found
$ban_found = false; //set flag as true
}
$ban_found = false;
if ($ban_found) { //if a ban was found
die(CMTX_BAN_MESSAGE_BANNED_PREVIOUSLY); //end scripting and output message to user explaining they were previously banned
}

}
I still get banned!!!!!!!!!

2. If I copy and paste the code of example.php into one of my web pages (of course I add also the line: ob_start(); ) I cannot add anymore comments because the "Add Comment" button stays greyed out!


Any help is very much appreciated!

Thank you,

Carly

Reply
#2

Hi,

Did you update the URL of the page in Manage -> Pages?
You can disable the referrer check in Settings -> Security.
To delete a ban use the Manage -> Bans page.

The 'Add Comment' button will stay greyed out until the agreement checkboxes are clicked.
JavaScript must be enabled for this to work.

Have you completed the interview?
Reply
#3

Hi Steven,

Thank you for your answer.
I disabled the referrer and this did the trick for banning.
The problem with the greyed out button was due to the fact that I added the commentics code inside a <form> . This was not needed and when I moved it out (almost) everything is OK.
So bottom line the above problems are solved.
However I encounter now another problem.
The body of my page has a certain colour.
When I add the commentics code AND there ARE comments related with the page the body turns white (after a flicker!!!!). This happens in IE8. Everything is OK in Firefox or even in IE8 if there are no comments (even thou there is the commentics code added).
There is also an error "frm is not defined" in Firefox and "frm.fax is null or not an object" in IE8.

Any help is very much appreciated.

Carly

(01-Aug-2011, 01:05 PM)Steven Wrote:  Hi,

Did you update the URL of the page in Manage -> Pages?
You can disable the referrer check in Settings -> Security.
To delete a ban use the Manage -> Bans page.

The 'Add Comment' button will stay greyed out until the agreement checkboxes are clicked.
JavaScript must be enabled for this to work.

Reply
#4

Hi,

I only have IE9 on my computer. Does it happen on the demo?

You're right about the error, "frm is undefined". In the FireFox error console it says line 594. I will check it out.

I also saw this, "Error in parsing value for 'filter'. Declaration dropped", although I get that on the homepage too, so it may not be related to the script.

Have you completed the interview?
Reply
#5

Okay I figured out the "frm is undefined" error. The following JavaScript code appears before the fax and phone fields are loaded in the form, so it's trying to refer to these elements prematurely. I'm surprised because the code passes XHTML validation. The solution is to either move the code below the form elements, or to wrap the code in a function and then call the function below the form elements.

/comments/includes/template/form.php, lines 333 to 339.
Code:
<script type="text/javascript">
// <![CDATA[
var frm = document.forms['commentics'];
frm.fax.setAttribute("autocomplete", "off");
frm.phone.setAttribute("autocomplete", "off");
// ]]>
</script>

Have you completed the interview?
Reply
#6

Hello again,

I moved the code and no more error!!!!
However my old problem with the background colour still exists.
The following code changes the background colour of the body to white in IE8 after adding a message:

<?php
error_reporting (E_ALL ^ E_NOTICE);
require_once('Connections/MyDataBase.php');
session_start();
ob_start();

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<link rel="stylesheet" type="text/css" href="../comments/css/stylesheet.css"/>
<link href="CSS/Styles.css" rel="stylesheet" type="text/css" />

</head>

<body>
<div class="OuterDiv">
<div class="MainDiv">
<div class="MainContentDiv"><div class="WholeWidthDiv">
<div class="WholeInterionDiv">this is a test this is a test this is a test </div></div>

<div class="WholeWidthDiv">
<div class="WholeInterionDiv"><?php
$page_id = "1";
$reference = "Page One";
$path_to_comments_folder = "../comments/";
define ('IN_COMMENTICS', 'true'); //no need to edit this line
require $path_to_comments_folder . "includes/commentics.php"; //no need to edit this line
?>
</div></div>


</div>

</div>
</div>
</body>
</html>
Reply
#7

Can you try it on the demo please.

Have you completed the interview?
Reply
#8

I am not sure what you mean.
How can I try on the demo?
Please let me know. I REALLY need this to work!
(02-Aug-2011, 09:53 PM)Steven Wrote:  Can you try it on the demo please.


Even this simple code does not work in IE8.
The background color changes to white.
<?php
error_reporting (E_ALL ^ E_NOTICE);
require_once('Connections/MyConn.php');
session_start();
ob_start();

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<link rel="stylesheet" type="text/css" href="../comments/css/stylesheet.css"/>


</head>

<body style="background-color:#C0F;">
<div ><?php
$page_id = "1";
$reference = "Page One";
$path_to_comments_folder = "../comments/";
define ('IN_COMMENTICS', 'true'); //no need to edit this line
require $path_to_comments_folder . "includes/commentics.php"; //no need to edit this line
?>
</div>
</body>
</html>


(02-Aug-2011, 09:53 PM)Steven Wrote:  Can you try it on the demo please.

Reply
#9

(02-Aug-2011, 09:53 PM)Steven Wrote:  Can you try it on the demo please.

Steven,

Do you have news for me (why the background is changing to white)?
I like commentics and I would rather use them then disqus or facebook comments.
Please help.

Carly

Reply
#10

Hi,

I don't use IE8 so I can't test this.

I have tested it on IE9 with the same code as post#8 and it worked fine.

Have you completed the interview?
Reply


Possibly Related Threads…
Thread / Author Replies Views Last Post
Last Post by Steven
06-Aug-2021, 06:50 PM
Last Post by Steven
27-Jul-2021, 07:12 PM
Last Post by clixcity
29-Jul-2020, 07:56 PM
Last Post by Steven
09-Jul-2018, 08:40 PM
Last Post by vkp
22-May-2017, 04:28 AM
Last Post by tashi
23-Jul-2015, 07:45 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)