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

same IP address
#1

I keep getting the error messages: "You cannot vote for your own comment!", "You have already voted for this comment", "You cannot report your own comment!" when testing on the application with multiple users on the same network.

All users have the same public IP address... Is there a setting I am missing that stop the IP address checking?


BTW, great app! the install was flawless, and the first tests were great, except for this issue.

Please help.
Reply
#2

Hi,

You can open /comments/vote.php and comment out the following code, like this:

PHP Code:
<?php 
/*
//check if user is voting own comment
$query = mysql_query("SELECT ip_address FROM `".$mysql_table_prefix."comments` WHERE id = '$id' and ip_address = '$ip_address'");
$count = mysql_num_rows($query);
if ($count > 0) {
echo "<script language='javascript' type='text/javascript'>alert('" . CMTX_VOTE_OWN_COMMENT . "');</script>";
$issue = true;
}

//check if user has already voted
$query = mysql_query("SELECT ip_address FROM `".$mysql_table_prefix."voters` WHERE comment_id = '$id' and ip_address = '$ip_address'");
$count = mysql_num_rows($query);
if ($count > 0) {
echo "<script language='javascript' type='text/javascript'>alert('" . CMTX_VOTE_ALREADY_VOTED . "');</script>";
$issue = true;
}
*/

Similarly, in /comments/flag.php, comment out this part:

PHP Code:
<?php 
/*
//check if user is reporting own comment
$query = mysql_query("SELECT ip_address FROM `".$mysql_table_prefix."comments` WHERE id = '$id' and ip_address = '$ip_address'");
$count = mysql_num_rows($query);
if ($count > 0) {
echo "<script language='javascript' type='text/javascript'>alert('" . CMTX_FLAG_OWN_COMMENT . "');</script>";
die();
}
*/

Have you completed the interview?
Reply
#3

Thank you Steven, but I don't think that would work for my situation because it would let users vote and flag as many time as they wish on the same comment.

I'll need a way to identify by combination of name and email, not IP address. Maybe I change the code to insert name/email into the IP address fields of table voters and reports.

Do you think that would cause issues down the road?


BTW, I have similar issues with bans blocking an entire set of users under the same IP address...
Reply
#4

I think a workaround is difficult here, as the idea is that anyone can vote or report a comment, without supplying their name and email address. Sorry I can't help further.

Have you completed the interview?
Reply
#5

(29-Mar-2012, 05:46 PM)Steven Wrote:  I think a workaround is difficult here, as the idea is that anyone can vote or report a comment, without supplying their name and email address. Sorry I can't help further.
I have to admit having the same problem, but once again the solution would have been simple if one could assign the unique customer id from my own customer login pages. Just a simple field added to the comments table called customerid where I could assign the unique id of my member to the field, and then basically just a option of choice of ip_address or customerid.
I suppose with the greatest respect that the features at present are more written for an open comments page, than that of a comments page within a logged in website. The inclusion of the customerid would basically solve a great deal of script changing and research. I could pretty much assign my whole database with just this one field included.
What scripting would need to be changed to add the field customerid into the table comments?
Reply


Possibly Related Threads…
Thread / Author Replies Views Last Post
Last Post by otuzel
22-Apr-2013, 01:11 PM
Last Post by goppss
26-Oct-2012, 12:37 AM
Last Post by cajung
25-May-2012, 07:51 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)