News:

CPG Release 1.6.29
During HTML5 upload, keep pseudo blank code 200 messages from triggering error condition
added Russian language
correct failure to use theme menu icons in album manager
minor vulnerabilities mitigation

Main Menu

Ban users to vote for theiselves

Started by wiren, October 26, 2003, 12:43:06 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

wiren

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.

Tarique Sani

Even if they can vote - they can vote only once....
SANIsoft PHP applications for E Biz

jdbaranger

Hello,

Excuse-me but they can vote every keep_votes_time days.

This suggestion is a very good idea.

Jean-Denis
Jean-Denis

DJMaze

why let people vote 2 times on same pic ?
There are 2 kinds of users in this world: satisfied and complainers.
Why do we never hear something from the satisfied users?
http://coppermine-gallery.net/forum/index.php?topic=24315.0

jdbaranger

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
Jean-Denis

jdbaranger

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
Jean-Denis