Ok, since cheribibi did most of the job, its quiet easy to add IP check.
Note, the following will only work with version
A of this mod!
Step 1Execute this MySQL query (you can use phpmyadmin or something simular)
[qcode]ALTER TABLE
4images_voted ADD vote_ip VARCHAR( 15 ) NOT NULL[/qcode](make sure the table prefix is the same as its in your config.php.
4images_ is the default prefix.)
Step 2Follow the cheribibi's tutorial above
then replace
$sql30 = "SELECT vote
FROM ".VOTED_TABLE."
WHERE image_id =".$id." AND user_id =".$user_info['user_id'];
with:
$sql30 = "SELECT vote
FROM ".VOTED_TABLE."
WHERE image_id =".$id." AND (user_id =".$user_info['user_id']." OR vote_ip = '".$site_sess->user_ip."')";
Step 3.
in includes/functions.php find:
$sql = "INSERT INTO ".VOTED_TABLE."
(user_id, image_id, vote)
VALUES
(".$user_info['user_id'].", ".$image_id.", ".$rating.")";
Replace with:
global $site_sess;
$sql = "INSERT INTO ".VOTED_TABLE."
(user_id, image_id, vote, vote_ip)
VALUES
(".$user_info['user_id'].", ".$image_id.", ".$rating.", '".$site_sess->user_ip."')";
I didnt tested this, but theoreticaly it should work