Yep I agree that will be the best way to do it. IP addresses don't change in the time frames you are talking about. First create a database table
id - auto_increment primary key (not strictly necessary)
image_id - int - should relate to the id of the actual image reference in the database
user_ip - varchar (15)
user_access_time - datetime
Then when a user vists the page, check the table for various data
... assumes you are connected to a database ...
$imageid = something.gif // This needs to be the current image being rated
$sql = "SELECT user_access_time FROM access_table WHERE '".$_SERVER['REMOTE_ADDR']."' AND image_id = '$image_id'";
$result = mysql_query($sql);
if($data = mysql_fetch_array($result)){
// Ok we found a record, now check if time limit has passed
if($data['user_access_time']+3600 < time()){ // User voted over an hour ago
$sql = "DELETE FROM access_table WHERE user_ip = '".$_SERVER['REMOTE_ADDR']."' AND image_id = '$image_id";
mysql_query($sql);
addVote();
}else{
throw_error("Sorry, you already voted recently. Try again later");
}else{
// No records were found, user is allowed to add a vote for this image
addVote(); // Code which adds a vote to the database here
}
That's about all you need to do. You'd need to amend whatever function you use for adding votes in, so that it also adds a record into the new table.
Sorry for parse errors 🙂