Webmastersite.net
Register Log In

Voting Dropdown

Comments on Voting Dropdown

Synozeer
Forum Regular

Usergroup: Customer
Joined: Jun 02, 2004

Total Topics: 32
Total Comments: 142
Posted Jan 19, 2006 - 1:10 AM:

Currently, by default, when going to Link Details, the voting dropdown is set to one of the vote values (in my case, 5). However, I think people are clicking the vote button before selecting a vote value, or spiders/scripts/etc are automatically causing the submit button to be pressed, and thus giving that link a 5 vote.

I went into my details.tpl and changed my voting so it looks like this:


<select name="votevalue">
<option selected value="">Choose Rating</option>
<option value="5">5 - Perfect</option>
<option value="4">4 - Good</option>
<option value="3">3 - Average</option>
<option value="2">2 - Mediocre</option>
<option value="1">1 - Bad</option>
</select>


Now it has "Choose Rating" as a default, and when someone clicks to vote, it won't add a vote. However, it still acts as if the person who clicked voted.

My question is, is there a better way to do this? Maybe javascript so that we could get rid of the Submit button altogether, or some code/template change so that someone clicking submit on the default Choose Rating option doesn't act as if they already voted for that link?

Adam
Paul
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7867
Paul
Posted Jan 21, 2006 - 2:02 AM:

To get it to not count it as a vote, open vote.php and move
    // set cookie to prevent re-voting on same link again
if (!strstr(' '. $_COOKIE['votes'] .' ', ' '. $id .' '))
{
$idstring = ' '. $_COOKIE['votes'] .' '. $id .' ';
makecookie("votes", $idstring, time() + ($settings->expirecookie * 86400));
}
from its current location up to just below
	if ($votevalue)
{ // if custom ones only, skip this
(applied for future versions)
Synozeer
Forum Regular

Usergroup: Customer
Joined: Jun 02, 2004

Total Topics: 32
Total Comments: 142
Posted Jan 21, 2006 - 1:17 PM:

Nope, that didn't work.

Now when I vote, it always counts it (changes both the rating and # of votes), even when I don't choose a value to vote on, and it still lets me vote as much as I want.

Before, it let me vote once and didn't count the vote.

I want it just how it is originally, except that if they don't choose a vote (they click submit on the "Choose a Vote" selection), it won't do anything and will allow them to vote again until they pick a correct value. Right now if they accidently click vote when it's not on a vote value, they can't vote again.
Paul
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7867
Paul
Posted Jan 25, 2006 - 3:50 AM:

Works for me (still says vote was counted, but it doesn't actually count it or prevent voting again). Maybe 3.16 is different.
Search thread for
Download thread as
  • 0/5
  • 1
  • 2
  • 3
  • 4
  • 5



This thread is closed, so you cannot post a reply.