Some users of mine use to vote their own pictures, of course they like them and even if the pic is bad they give it a generous five/five :D!
This is awful, for we have few votes too and it is enough to auto-vote for your pic to jump on the top-rated... a real shame :D
So, it there a way to ban users to vote their own photos? I know cmine identify the one who votes, for if you try to vote a second time a pic you are not able to, coppermine tells you you already voted the pic...
How can we hack this to ban the same user to vote?
Thank you and have anice sunday.
Even if they can vote - they can vote only once....
Hello,
Excuse-me but they can vote every keep_votes_time days.
This suggestion is a very good idea.
Jean-Denis
why let people vote 2 times on same pic ?
So here the way of prohibiting the vote for its own pictures :
In Language File ( ex : French.php )
Search for
'rate_ok' => 'Your vote was accepted',
Add After
'forbidden' => 'You cannot rate your own pictures.',
In ratepic.php
Search for
$sql = "SELECT a.votes as votes_allowed, p.votes as votes, pic_rating " . "FROM {$CONFIG['TABLE_PICTURES']} AS p, {$CONFIG['TABLE_ALBUMS']} AS a " . "WHERE p.aid = a.aid AND pid = '$pic' LIMIT 1";
Replace with
$sql = "SELECT a.votes as votes_allowed, p.votes as votes, pic_rating, owner_id " . "FROM {$CONFIG['TABLE_PICTURES']} AS p, {$CONFIG['TABLE_ALBUMS']} AS a " . "WHERE p.aid = a.aid AND pid = '$pic' LIMIT 1";
Search for
// Update picture rating
$new_rating = round(($row['votes'] * $row['pic_rating'] + $rate * 2000) / ($row['votes'] + 1));
Add Before
//Test for Self-Rating
$user=USER_ID;
$owner=$row['owner_id'];
if ($user==$owner) cpg_die(ERROR, $lang_rate_pic_php['forbidden'], __FILE__, __LINE__);
Jean-Denis
Quote from: "DJMaze"why let people vote 2 times on same pic ?
By default, you can vote every 30 days for the same picture.
I made a MOD to allow this value be editable.
Search in forums for "Allow multiple vote - Define Votes Time-To-Live"
Jean-Denis