phpBB2Refugees.com Logo
Not affiliated with or endorsed by the phpBB Group

Register •  Login 

Continue the legacy...

Welcome to all phpBB2 Refugees!Wave Smilie

This site is intended to continue support for the legacy 2.x line of the phpBB2 bulletin board package. If you are a fan of phpBB2, please, by all means register, post, and help us out by offering your suggestions. We are primarily a community and support network. Our secondary goal is to provide a phpBB2 MOD Author and Styles area.

[solved] stop ego-voting smartor album


 
Search this topic... | Search MOD Requests... | Search Box
Register or Login to Post    Index » MOD Requests  Previous TopicPrint TopicNext Topic
Author Message
hoimyr
Board Member



Joined: 16 Apr 2009

Posts: 115
Location: Oslo


flag
PostPosted: Wed Sep 02, 2009 7:15 pm 
Post subject: [solved] stop ego-voting smartor album

Hi, I was wondering if anybody have the fix for stopping users to vote their own pictures in the Smartor album. The support site was taken down so cant find it.
Back to top
drathbun
Board Member



Joined: 24 Jul 2008

Posts: 663
Location: Texas


flag
PostPosted: Thu Sep 03, 2009 12:28 pm 
Post subject: Re: stop ego-voting smartor album

I am not familiar with the code, but as a simple check it seems like it would be possible. On the voting page see if the voting user is the same as the image owner (I would assume that the $userdata['user_id'] value can be used for this) and if so, disable the voting right.
_________________
phpBBDoctor Blog
Back to top
hoimyr
Board Member



Joined: 16 Apr 2009

Posts: 115
Location: Oslo


flag
PostPosted: Thu Sep 03, 2009 8:29 pm 
Post subject: Re: stop ego-voting smartor album

I found $userdata['user_id'] and figgured out that pic_user_id was the other i needed.

This is what i did:
Code:

Open:
album_rate.php

Find:
$rate_user_ip = $userdata['session_ip'];

After add:


   // -------------------
   // Check no ego votes
   // -------------------

   if ($userdata['user_id'] == $thispic['pic_user_id'])
   {
      message_die(GENERAL_ERROR, 'Sorry no ego voting');


It works! icon_biggrin.gif Thank you for the tip drathbun!


edit: hehe my next project is to clean out the votes that users have voted on thier selves from the database. The 2 tables in the databse is rate_pic_id and rate_user_id. Does somebody know how to write an SQL query that checks if the rate_user_id owns the rate_pic_id ? I dont want to go in to the database and delete votes manually. Guess thats a privacy thing too and it will take ages. Deleting things in the database is a little risky to experiment on icon_smile.gif
Back to top
Display posts from previous:   
Register or Login to Post    Index » MOD Requests  Previous TopicPrint TopicNext Topic
Page 1 of 1 All times are GMT
 
Jump to:  

Index • About • FAQ • Rules • Privacy • Search •  Register •  Login 
Not affiliated with or endorsed by the phpBB Group
Powered by phpBB2 © phpBB Group
Generated in 0.0259 seconds using 15 queries. (SQL 0.0022 Parse 0.0008 Other 0.0229)
phpBB Customizations by the phpBBDoctor.com
Template Design by DeLFlo and MomentsOfLight.com Moments of Light Logo