Thursday, 24 April 2014 18:24
beggarly

Code snippets to allow only 1 vote per IP

Provides the ajax five-star rating feature to your articles

Code snippets to allow only 1 vote per IP

Postby strgg » Sat Jun 27, 2009 2:00 pm

Hi

First of all; the voting plugin is excellent, thank you jesus.

If we want to prevent abuse of the rating system we should prevent multivoting for IP.
If we have this hack ready, extravote is totally complete in functions, so let go :P

What I got here is code from votitaly where this feature can be done by hacking into code. I hope we can, with help from jesus, adapt this codelines to work in the extravote plugin.

first of all, create a new table
CREATE TABLE IF NOT EXISTS `log_rating` (
`content_id` int(11) NOT NULL default '0',
`ip` varchar(150) NOT NULL,
PRIMARY KEY (`content_id`,`ip`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Tabla de votaciones';

secondly go to this file and paste somewhere from line 56 on:
ajax.php
Code: Select all
// By ArdiIIa
$query = 'INSERT INTO log_rating  (IP, content_id )' .
     'VALUES ('  . $db->Quote($userIP) . ',' . (int) $content_id . ')';
$db->setQuery($query);
$db->query();

} else {

//By ArdiIIa
   $query = 'SELECT * FROM log_rating WHERE IP = ' . $db->Quote($userIP) . ' and  content_id = ' . (int)$content_id;
   $db->setQuery($query);
   $row = $db->loadObject();

if ( ! $row )   {
$query = 'INSERT INTO log_rating  (IP, content_id )' .
     'VALUES ('  . $db->Quote($userIP) . ',' . (int) $content_id . ')';
$db->setQuery($query);
if (!$db->query()) {
$error = 2;
$message = $db->stderr();
}
   }

if (!$row  and $rating)
{ // End code ArdiIIa


There are certainly some modifications needed. Could we together try to make this work.
It really is a need!

thanks Jesus

PS: I explain shortly why we need this... its only 1 out of 100 examples.
we are a animal's home for homeless dogs. we only have very limited
money to use for operations and doctors. we write an article about every
animal and let the user decide by voting which animals will have the priority
to get expensive medical care. Unfortunately our rating system is getting
highly abused and we are stranded to make decisions which animals to help.
thx for reading :|
strgg
Fresh Boarder
Fresh Boarder
 
Posts: 3
Joined: Sat Jun 27, 2009 1:47 pm

Re: Code snippets to allow only 1 vote per IP

Postby strgg » Wed Jul 01, 2009 10:04 am

hello guys & developer

I do not think that it is too much to ask for a short answer on this. within 4 days
this subject has been read many times. I can not understand that ... you would do
nothing less than help others and being able to do that this is a true gift.

remember only 10 minutes of your time to state your opinion about this feature
stands against many people coming here daily to see if this feature will evolve.
Letting them in the unknown is surely the most inappropriate way to go.

I just can't understand
strgg
Fresh Boarder
Fresh Boarder
 
Posts: 3
Joined: Sat Jun 27, 2009 1:47 pm

Re: Code snippets to allow only 1 vote per IP

Postby chus » Thu Jul 02, 2009 3:59 am

Hi strgg,

I will assume you mean me for being this plugin publisher...

I prefer not repplying to a topic I don't have a usefull answer to, and I disagree with you because now, 2 replies
stand for more people coming here daily to see if this feature will evolve
But unfortunately I don't intend to work on this recurring feature request.
User avatar
chus
Administrator
Administrator
 
Posts: 455
Joined: Thu Sep 13, 2007 2:21 am
Location: Costa Rica

Re: Code snippets to allow only 1 vote per IP

Postby strgg » Thu Jul 02, 2009 8:19 am

hi

the title from this topic is very clear
Code: Select all
Code snippets to allow only 1 vote per IP 

people who are interested go to read. i do think compared to your other threads
and especially the time period it is published it is a big need.

prefer not repplying to a topic I don't have a usefull answer to

wow, i really hope for you you do not do that in your real life cause if so, soon you will stand alone.

anyway since i think this request is far too complicated for you to do i advise everyone with this featurerequest to join votitaly like i do. it is working with this abuse-protecting feature like a charm.
strgg
Fresh Boarder
Fresh Boarder
 
Posts: 3
Joined: Sat Jun 27, 2009 1:47 pm

Re: Code snippets to allow only 1 vote per IP

Postby salerna » Sat Jul 04, 2009 12:48 pm

hi strgg and chus

the need is there but not for the majority of the users.

@chus
Could you help us how to integrate this feature by changing the code in ajax.php?
for you as the developer it should take only few minutes to guide us-

I do understand that you don't want to include this feature into the backend but
I would appreciate the help for the coding changes.

thanks to all of you

salerna ;)
salerna
Fresh Boarder
Fresh Boarder
 
Posts: 1
Joined: Sat Jul 04, 2009 12:31 pm

Re: Code snippets to allow only 1 vote per IP

Postby polack » Sun Jul 05, 2009 5:51 pm

hello community

i am happy using extravote now since 6 months and i cast a vote for hack instructions too.

thank you very much for letting us know if you want to instruct us how to change the code chus.

regards,
ryan
polack
Fresh Boarder
Fresh Boarder
 
Posts: 1
Joined: Sun Jul 05, 2009 5:44 pm

Re: Code snippets to allow only 1 vote per IP

Postby billkeys » Tue Jul 07, 2009 1:45 pm

hello

I only registered to participate on this thread

I second the opinion of my preposter polack.

Please would you finally let us know if you help us with the code hacking for this feature or if you do not want to help!

A short answer will clear up clouds and let us go ahead. I guess this is not too much to ask for .... or is it?

thank you for this awesome extension,

Bill
billkeys
Fresh Boarder
Fresh Boarder
 
Posts: 1
Joined: Tue Jul 07, 2009 1:34 pm


Return to Extra Vote



Who is online

Users browsing this forum: No registered users and 2 guests

cron