Author Topic: How I can disable the function to the users don't vote in own photo?  (Read 3701 times)

0 Members and 1 Guest are viewing this topic.

Offline fermachado

  • Jr. Member
  • **
  • Posts: 92
    • View Profile
Hi,

How I can disable the function to the users don't vote in own photo?

Thanks for your help
www.globalfoto.net

Sintra - Portugal

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: How I can disable the function to the users don't vote in own photo?
« Reply #1 on: August 25, 2009, 03:02:01 AM »
In includes/functions.php find two times:
  if (check_permission("auth_vote"$image_row['cat_id'])) {

Replace both with:
  if (check_permission("auth_vote"$image_row['cat_id']) && ($user_info['user_level'] == GUEST || ($user_info['user_level'] != GUEST && $user_info['user_id'] != $image_row['user_id']))) {



Then find:
function update_image_rating($image_id$rating) {

Insert below:
  global $user_info;



not tested

P.S. since there is no way of knowing who is the owner of an image when uploaded by guests, guests owners will be able vote for their own images :(
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline fermachado

  • Jr. Member
  • **
  • Posts: 92
    • View Profile
Re: How I can disable the function to the users don't vote in own photo?
« Reply #2 on: August 25, 2009, 02:50:08 PM »
Hi Vano,

Thanks a lot for your great help.

Don't problem with the uploads from guest's, only the resgistered users can upload to my site. 8)

Obrigado
www.globalfoto.net

Sintra - Portugal