coppermine-gallery.com/forum

Support => Older/other versions => cpg1.1d PHPnuke Support (deprecated) => Topic started by: wiren on October 26, 2003, 12:43:06 PM

Title: Ban users to vote for theiselves
Post by: wiren on October 26, 2003, 12:43:06 PM
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.
Title: Ban users to vote for theiselves
Post by: Tarique Sani on October 26, 2003, 12:56:53 PM
Even if they can vote - they can vote only once....
Title: Ban users to vote for theiselves
Post by: jdbaranger on November 29, 2003, 06:00:05 PM
Hello,

Excuse-me but they can vote every keep_votes_time days.

This suggestion is a very good idea.

Jean-Denis
Title: Ban users to vote for theiselves
Post by: DJMaze on November 29, 2003, 07:00:49 PM
why let people vote 2 times on same pic ?
Title: Ban users to vote for theiselves
Post by: jdbaranger on November 29, 2003, 07:12:49 PM
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
Title: Ban users to vote for theiselves
Post by: jdbaranger on November 29, 2003, 07:29:40 PM
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