First off, the script is great! I love it. However, the only trouble I'm having is geting the voting fields to work. I added the new fields to the "image field" they were "clarityrating" "uniquerating" "complexrating" "skillrating" and "overallrating" But when I try to use any variables or try to vote it either says it's invaild or that I've already voted... Did I miss something?
Ok Sorry, nevermind about the invalid stuff... This is the problem...
The only vote that goes through is "overall" because I changed name="overallrating" to "votevalue" but the custom fields aren't working. I have added the new fields correctly, i believe, they are "clarityrating" "uniquerating" "complexrating" "skillrating". I used the "Add Fields" page and added using "Add [image field] named [XXXrating]" type [input box]. No other options were used... Did I do it right?
The following shows a 0 rating for all rating fields except for the first "votevalue" rating.
Based on a glance at the code, to send the vote you need to send clarityratingvotevalue. <input type="radio" name="clarityratingvotevalue" value="1" />
I have changed all of the name="XXXrating" to "XXXratingvotevalue" and it says the vote has been recorded, but still displays the other ones as 0... I'm still using the same code as above, except the adding of "votevalue" to all the names, and it's still not working.
It appears the custom fields are counting the number of votes and not the vote itself. Also... the "XXXratingvotevalue" didn't increase the number any. So I changed it back to "XXXrating" and when I voted the number increased by 1.
????? I don't know how to fix it, but I believe that is the problem.
Annoyingly, it looks like I should pay attention to the manual instead of editing it. The tempalate code you had originally was correct, there's just a bug in vote.php. Change
if ($votevalue > $settings->maxvote) die("Illegal vote attempted"); // prevent cheating
if ($votevalue < $settings->minvote) die("Illegal vote attempted");
:-( That didn't fix it. The only one working is still only "votevalue". The other ones do the following: Under the Link table under "clartityrating" "uniquerating" etc. the values still only increase by 1 each time I vote, I'm testing with ratings all at 5, and then I tried all at 4, same result.
Comments on Custom Voting Help Needed
Beginner
Usergroup: Member
Joined: Apr 26, 2005
Total Topics: 1
Total Comments: 8
First off, the script is great! I love it. However, the only trouble I'm having is geting the voting fields to work. I added the new fields to the "image field" they were "clarityrating" "uniquerating" "complexrating" "skillrating" and "overallrating" But when I try to use any variables or try to vote it either says it's invaild or that I've already voted... Did I miss something?
Beginner
Usergroup: Member
Joined: Apr 26, 2005
Total Topics: 1
Total Comments: 8
This is my html to pass the votes to "vote.php?action=vote?id="
Is there anything wrong?
<table border="0" cellspacing="0" cellpadding="1">
<form action="vote.php?action=vote&id={IMAGEID}" method="post">
<tr>
<td> </td>
<td> 1 </td>
<td bgcolor="#DDDDDD"> 2 </td>
<td> 3 </td>
<td bgcolor="#DDDDDD"> 4 </td>
<td> 5 </td>
</tr>
<tr bgcolor="#CCCCCC">
<td align="right"> Clarity:</td>
<td><input type="radio" name="clarityrating" value="1" /></td>
<td><input type="radio" name="clarityrating" value="2" /></td>
<td><input type="radio" name="clarityrating" value="3" /></td>
<td><input type="radio" name="clarityrating" value="4" /></td>
<td><input type="radio" name="clarityrating" value="5" /></td>
</tr>
<tr>
<td align="right"> Uniqueness:</td>
<td><input type="radio" name="uniquerating" value="1" /></td>
<td bgcolor="#DDDDDD"><input type="radio" name="uniquerating" value="2" /></td>
<td><input type="radio" name="uniquerating" value="3" /></td>
<td bgcolor="#DDDDDD"><input type="radio" name="uniquerating" value="4" /></td>
<td><input type="radio" name="uniquerating" value="5" /></td>
</tr>
<tr bgcolor="#CCCCCC">
<td align="right"> Complexity:</td>
<td><input type="radio" name="complexrating" value="1" /></td>
<td><input type="radio" name="complexrating" value="2" /></td>
<td><input type="radio" name="complexrating" value="3" /></td>
<td><input type="radio" name="complexrating" value="4" /></td>
<td><input type="radio" name="complexrating" value="5" /></td>
</tr>
<tr>
<td align="right"> Skill:</td>
<td><input type="radio" name="skillrating" value="1" /></td>
<td bgcolor="#DDDDDD"><input type="radio" name="skillrating" value="2" /></td>
<td><input type="radio" name="skillrating" value="3" /></td>
<td bgcolor="#DDDDDD"><input type="radio" name="skillrating" value="4" /></td>
<td><input type="radio" name="skillrating" value="5" /></td>
</tr>
<tr bgcolor="#CCCCCC">
<td align="right"> Overall:</td>
<td><input type="radio" name="overallrating" value="1" /></td>
<td><input type="radio" name="overallrating" value="2" /></td>
<td><input type="radio" name="overallrating" value="3" /></td>
<td><input type="radio" name="overallrating" value="4" /></td>
<td><input type="radio" name="overallrating" value="5" /></td>
</tr>
<td colspan="6" align="right" height="30">
<input type="submit" name="Submit" class="button" value="Rate Image"></td>
</tr>
</form>
</table>
Beginner
Usergroup: Member
Joined: Apr 26, 2005
Total Topics: 1
Total Comments: 8
Ok Sorry, nevermind about the invalid stuff... This is the problem...
The only vote that goes through is "overall" because I changed name="overallrating" to "votevalue" but the custom fields aren't working. I have added the new fields correctly, i believe, they are "clarityrating" "uniquerating" "complexrating" "skillrating". I used the "Add Fields" page and added using "Add [image field] named [XXXrating]" type [input box]. No other options were used...
Did I do it right?
The following shows a 0 rating for all rating fields except for the first "votevalue" rating.
<IF {SWITCH_RATINGS}><div class="details">
<span class="labels">Overall Rating:</span>
{IMAGESTARS} {IMAGERATING}/{MAXVOTE} <br>
<span class="labels">Uniqueness:</span>
{IMAGEUNIQUERATINGSTARS} {IMAGEUNIQUERATINGRATING}/{MAXVOTE} <br>
<span class="labels">Skill:</span>
{IMAGESKILLRATINGSTARS} {IMAGESKILLRATINGRATING}/{MAXVOTE} <br>
<span class="labels">Complexity:</span>
{IMAGECOMPLEXRATINGSTARS} {IMAGECOMPLEXRATINGRATING}/{MAXVOTE} <br>
<span class="labels">Clarity:</span>
{IMAGECLARITYRATINGSTARS} {IMAGECLARITYRATINGRATING}/{MAXVOTE} <br>
based on {IMAGEVOTES} votes</div></IF>
It can be found at...
http://www.ratemyphotography.net/test/link.php?id=3
Please help ...
developer
Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California
Total Topics: 61
Total Comments: 7868
<input type="radio" name="clarityrating" value="1" />
Based on a glance at the code, to send the vote you need to send clarityratingvotevalue. <input type="radio" name="clarityratingvotevalue" value="1" />
Fixed the manual entry.
Beginner
Usergroup: Member
Joined: Apr 26, 2005
Total Topics: 1
Total Comments: 8
I have changed all of the name="XXXrating" to "XXXratingvotevalue" and it says the vote has been recorded, but still displays the other ones as 0... I'm still using the same code as above, except the adding of "votevalue" to all the names, and it's still not working.
Is there something I missed?
Beginner
Usergroup: Member
Joined: Apr 26, 2005
Total Topics: 1
Total Comments: 8
It's still not working... are the fields correct??
[image field] named [XXXrating]" type [input box]. No other options were used...
Please help...
Beginner
Usergroup: Member
Joined: Apr 26, 2005
Total Topics: 1
Total Comments: 8
I went to phpadmin and into the link table...
It appears the custom fields are counting the number of votes and not the vote itself. Also... the "XXXratingvotevalue" didn't increase the number any. So I changed it back to "XXXrating" and when I voted the number increased by 1.
????? I don't know how to fix it, but I believe that is the problem.
developer
Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California
Total Topics: 61
Total Comments: 7868
Annoyingly, it looks like I should pay attention to the manual instead of editing it. The tempalate code you had originally was correct, there's just a bug in vote.php. Change
to
Beginner
Usergroup: Member
Joined: Apr 26, 2005
Total Topics: 1
Total Comments: 8
:-( That didn't fix it.
The only one working is still only "votevalue".
The other ones do the following:
Under the Link table under "clartityrating" "uniquerating" etc. the values still only increase by 1 each time I vote, I'm testing with ratings all at 5, and then I tried all at 4, same result.
developer
Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California
Total Topics: 61
Total Comments: 7868
I gave a clarityrating of 4 and it showed the clarityrating being 4. I have this in my template:
<p>Current clarityrating is {IMAGECLARITYRATINGRATING}. Vote!</p>
<form action="vote.php?action=vote&id={IMAGEID}" method="post">
<table {STANDARDTABLE}>
<tr>
<td class="labelscolumn"><span class="labels">Rate this image clarity:</span></td>
<td class="optionscolumn">
<select name="clarityrating">
<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>
</td>
</tr>
<tr>
<td colspan="2"><input type="submit" value="Submit Rating" class="button"></td>
</tr>
</table>
</form>
Beginner
Usergroup: Member
Joined: Apr 26, 2005
Total Topics: 1
Total Comments: 8
I have changed nothing else and the {IMAGECLARITYRATINGRATING} still comes out as 0.
developer
Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California
Total Topics: 61
Total Comments: 7868
Well, get the vote.php from the revision of 2.15 just uploaded. That's what I'm using, and it works fine.