View Full Version : Show Thread Enhancements - [AJAX] Your One Click Thread Ratings
Description:
Make it easy for people to rate threads with one click.
Refer to the before and after images attached to this post for a visual.
Install instructions:
1. Download the attached zip file
2. Upload vbulletin_ajax_oneclick_threadrate.js to /yourforum/clientscript/
3. Modify the SHOWTHREAD template by placing the following code(or identical code contained in the attached zip file) after the $poll variable which is around the 14th line:
<if condition="$show['threadrating']">
<if condition="$show['ratethread']">
<div style="text-align:left; padding-bottom: 5px;">
<span id="oneclick_container">
<noscript>$vbphrase[rating]:</noscript>
<form action="threadrate.php?t=$threadid" method="post" id="oneclick_vote_one">
<input type="hidden" name="s" value="$session[dbsessionhash]" />
<input type="hidden" name="t" value="$threadid" />
<input type="hidden" name="pp" value="$perpage" />
<input type="hidden" name="page" value="$pagenumber" />
<input type="hidden" name="vote" value="1" />
<input type="submit" value="1" style="display:none;" />
<noscript><input type="submit" value="1" /></noscript>
</form>
<form action="threadrate.php?t=$threadid" method="post" id="oneclick_vote_two">
<input type="hidden" name="s" value="$session[dbsessionhash]" />
<input type="hidden" name="t" value="$threadid" />
<input type="hidden" name="pp" value="$perpage" />
<input type="hidden" name="page" value="$pagenumber" />
<input type="hidden" name="vote" value="2" />
<input type="submit" value="1" style="display:none;" />
<noscript><input type="submit" value="2" /></noscript>
</form>
<form action="threadrate.php?t=$threadid" method="post" id="oneclick_vote_three">
<input type="hidden" name="s" value="$session[dbsessionhash]" />
<input type="hidden" name="t" value="$threadid" />
<input type="hidden" name="pp" value="$perpage" />
<input type="hidden" name="page" value="$pagenumber" />
<input type="hidden" name="vote" value="3" />
<input type="submit" value="1" style="display:none;" />
<noscript><input type="submit" value="3" /></noscript>
</form>
<form action="threadrate.php?t=$threadid" method="post" id="oneclick_vote_four">
<input type="hidden" name="s" value="$session[dbsessionhash]" />
<input type="hidden" name="t" value="$threadid" />
<input type="hidden" name="pp" value="$perpage" />
<input type="hidden" name="page" value="$pagenumber" />
<input type="hidden" name="vote" value="4" />
<input type="submit" value="1" style="display:none;" />
<noscript><input type="submit" value="4" /></noscript>
</form>
<form action="threadrate.php?t=$threadid" method="post" id="oneclick_vote_five">
<input type="hidden" name="s" value="$session[dbsessionhash]" />
<input type="hidden" name="t" value="$threadid" />
<input type="hidden" name="pp" value="$perpage" />
<input type="hidden" name="page" value="$pagenumber" />
<input type="hidden" name="vote" value="5" />
<input type="submit" value="1" style="display:none;" />
<noscript><input type="submit" value="5" /></noscript>
</form>
<script type="text/javascript"><!--
var threadid = $threadinfo[threadid];
document.write('<table class="tborder"><tr>');
document.write(' <td class="alt2">$vbphrase[rating]:</td>');
document.write(' <td class="alt1"><a href="javascript:void(0);" id="oneclick_vote_one_submit" style="font-size:14pt">1</a></td>');
document.write(' <td class="alt2"><a href="javascript:void(0);" id="oneclick_vote_two_submit" style="font-size:14pt">2</a></td>');
document.write(' <td class="alt1"><a href="javascript:void(0);" id="oneclick_vote_three_submit" style="font-size:14pt">3</a></td>');
document.write(' <td class="alt2"><a href="javascript:void(0);" id="oneclick_vote_four_submit" style="font-size:14pt">4</a></td>');
document.write(' <td class="alt1"><a href="javascript:void(0);" id="oneclick_vote_five_submit" style="font-size:14pt">5</a></td>');
document.write('</tr></table>');
-->
</script>
<script type="text/javascript" src="clientscript/vbulletin_ajax_oneclick_threadrate.js?v=$vboptions[simpleversion]"></script>
<script type="text/javascript">
<!--
vB_AJAX_OneClick_ThreadRate_Init('oneclick_vote_on e');
vB_AJAX_OneClick_ThreadRate_Init('oneclick_vote_tw o');
vB_AJAX_OneClick_ThreadRate_Init('oneclick_vote_th ree');
vB_AJAX_OneClick_ThreadRate_Init('oneclick_vote_fo ur');
vB_AJAX_OneClick_ThreadRate_Init('oneclick_vote_fi ve');
-->
</script>
</span>
<span id="oneclick_threadrating_current"></span>
<span id="oneclick_threadrating_response"></span>
</div>
</if>
</if>
Technical comments:
Uses AJAX but will fall back to submitting the form first, or if that fails it will use <noscript> tags to display submit buttons. The fallback methods are not thoroughly tested so, if you are able, please test them and report any problems you have.
Template comments:
Be careful about moving the HTML block around because it will fail if it becomes nested inside of another form.
Recommendations after installing:
- in vBulletin Options > Poll and Thread Rating Options, set "Allow Thread Rating Vote Changes" to No
- in vBulletin Options > Poll and Thread Rating Options, set "Required Thread Rating Votes to Show Rating" to 1 (this will hopefully encourage the use of thread ratings)
- install the Thread-Ratings on Search mod which was written for 3.5.x but is compatible with 3.6.x. ( https://vborg.vbsupport.ru/showthread.php?t=106853 )
- modify the threadrate_add phrase, In Languages & Phrases under "Search in Phrases," do a search for 'Your vote on this thread has been added' and modify it to say something more friendly/humorous
Are you a designer?
maybe you can make the HTML chunk more asthetically pleasing with images or CSS
changelog:
0.1 - initial release
0.1.1 - define JS threadid which may or may not be defined later in the page
Read this before posting
If you want to tell me what error(s) you receive, please do the following:
1. Make sure you DO NOT put the HTML chunk inside of another form it will not work at all if you do this. Please make sure it is after the $poll variable.
2. If you think the error is JS related and you are using Firefox, click Tools > Console then the Errors tab, clear it out first, then try doing the thread rating, Right-click and copy the errors related that show for your forum.
3. You did not upload the JavaScript file to the proper location
READ THIS: Set "Check Thread Rating" to Yes in vBulletin Options under "Thread Display Options (showthread)"
Mr_Snob
01-11-2007, 01:47 AM
heyy you are cool man thanks for this wonderfull hack :D
Jay...
01-11-2007, 09:10 AM
is there anyway this can be made to look like the rating system does on the mods section of this site?
Jarllax
01-11-2007, 10:47 AM
Great hack, thanks!
is there anyway this can be made to look like the rating system does on the mods section of this site?
you are specifically referring to the radio buttons used at the top? yes, that would be easily possible. that could all be handled on the template side so I will post an example when I have some free time.
complaints on my forum have indicated it may not be such a good idea to put right above the Reply button so until I try finding a better way to integrate it into template, I'd suggested adding some line breaks or placing it near the bottom of threads.
One i modified for my site (attached preview):p
If anyone want to use it, here it is--
Add this your style CSS (you can change the colors matching with your forum):
.news{
padding: 5px;
background: #EDF4FA;
border: 1px solid #D7DEE4;
color: #4E4E4C;
}
Add the code below $poll (not tested anywhere else)
<if condition="$show['threadrating']">
<if condition="$show['ratethread']">
<div style="text-align:left; padding-bottom: 5px;">
<span id="oneclick_container">
<noscript>$vbphrase[rating]:</noscript>
<form action="threadrate.php?t=$threadid" method="post" id="oneclick_vote_one">
<input type="hidden" name="s" value="$session[dbsessionhash]" />
<input type="hidden" name="t" value="$threadid" />
<input type="hidden" name="pp" value="$perpage" />
<input type="hidden" name="page" value="$pagenumber" />
<input type="hidden" name="vote" value="1" />
<input type="submit" value="1" style="display:none;" />
<noscript><input type="submit" value="1" /></noscript>
</form>
<form action="threadrate.php?t=$threadid" method="post" id="oneclick_vote_two">
<input type="hidden" name="s" value="$session[dbsessionhash]" />
<input type="hidden" name="t" value="$threadid" />
<input type="hidden" name="pp" value="$perpage" />
<input type="hidden" name="page" value="$pagenumber" />
<input type="hidden" name="vote" value="2" />
<input type="submit" value="1" style="display:none;" />
<noscript><input type="submit" value="2" /></noscript>
</form>
<form action="threadrate.php?t=$threadid" method="post" id="oneclick_vote_three">
<input type="hidden" name="s" value="$session[dbsessionhash]" />
<input type="hidden" name="t" value="$threadid" />
<input type="hidden" name="pp" value="$perpage" />
<input type="hidden" name="page" value="$pagenumber" />
<input type="hidden" name="vote" value="3" />
<input type="submit" value="1" style="display:none;" />
<noscript><input type="submit" value="3" /></noscript>
</form>
<form action="threadrate.php?t=$threadid" method="post" id="oneclick_vote_four">
<input type="hidden" name="s" value="$session[dbsessionhash]" />
<input type="hidden" name="t" value="$threadid" />
<input type="hidden" name="pp" value="$perpage" />
<input type="hidden" name="page" value="$pagenumber" />
<input type="hidden" name="vote" value="4" />
<input type="submit" value="1" style="display:none;" />
<noscript><input type="submit" value="4" /></noscript>
</form>
<form action="threadrate.php?t=$threadid" method="post" id="oneclick_vote_five">
<input type="hidden" name="s" value="$session[dbsessionhash]" />
<input type="hidden" name="t" value="$threadid" />
<input type="hidden" name="pp" value="$perpage" />
<input type="hidden" name="page" value="$pagenumber" />
<input type="hidden" name="vote" value="5" />
<input type="submit" value="1" style="display:none;" />
<noscript><input type="submit" value="5" /></noscript>
</form>
<script type="text/javascript"><!--
document.write('<div class="news" style="line-height:12px;vertical-align:middle;"><div align="center" class="smallfont">');
document.write(' <strong>Quick Rate:</strong>');
document.write(' Lousy <input type="radio" name="rating" id="oneclick_vote_one_submit" value="1" onclick="javascript:void(0);" /> ');
document.write(' Below average <input type="radio" name="rating" id="oneclick_vote_two_submit" value="2" onclick="javascript:void(0);" /> ');
document.write(' Average <input type="radio" name="rating" id="oneclick_vote_three_submit" value="3" onclick="javascript:void(0);" /> ');
document.write(' Above average <input type="radio" name="rating" id="oneclick_vote_four_submit" value="4" onclick="javascript:void(0);" /> ');
document.write(' Stunning <input type="radio" name="rating" id="oneclick_vote_five_submit" value="5" onclick="javascript:void(0);" /> ');
document.write('</div></div>');
-->
</script>
<script type="text/javascript" src="clientscript/vbulletin_ajax_oneclick_threadrate.js?v=$vboptions[simpleversion]"></script>
<script type="text/javascript">
<!--
vB_AJAX_OneClick_ThreadRate_Init('oneclick_vote_on e');
vB_AJAX_OneClick_ThreadRate_Init('oneclick_vote_tw o');
vB_AJAX_OneClick_ThreadRate_Init('oneclick_vote_th ree');
vB_AJAX_OneClick_ThreadRate_Init('oneclick_vote_fo ur');
vB_AJAX_OneClick_ThreadRate_Init('oneclick_vote_fi ve');
-->
</script>
</span>
<span id="oneclick_threadrating_current"></span>
<span id="oneclick_threadrating_response"></span>
</div>
</if>
</if>
Change the options (marked with RED color) in above code the way you want.
Click save and rest followed all instructions provided by fci
BIG thanks to fci for the hack ;)
Mr_Snob
01-11-2007, 12:19 PM
@DPSR
very nice i modified too for my site
when i finish, i share it with you :D
abramelin
01-11-2007, 01:19 PM
it is not working on me. DPSR i have modified like you said but when i click on the ratio it doesnt do anything?
For me its not working in Firefox, but in opera and IE 7 its working fine
Please check if you have uploaded the .js file and edited correcty (copy the code from attached txt file (https://vborg.vbsupport.ru/attachment.php?attachmentid=58845))
abramelin
01-11-2007, 03:26 PM
i am using firefox too. i think this is a firefox issue :( how can we fix this?
Don't know :( i have tested the hack without any modification but still in ff its don't work. Maybe author *(fci) will update it .....
DPSR, I registered on your forum and was unable to reproduce the issues when using Firefox 2(Windows).
abramelin, when I registered on your forum I was able to reproduce the issue.
Please add the part in red to your current template:
<script type="text/javascript">
<!--
var threadid = $threadinfo[threadid];
vB_AJAX_OneClick_ThreadRate_Init('oneclick_vote_on e');
vB_AJAX_OneClick_ThreadRate_Init('oneclick_vote_tw o');
vB_AJAX_OneClick_ThreadRate_Init('oneclick_vote_th ree');
vB_AJAX_OneClick_ThreadRate_Init('oneclick_vote_fo ur');
vB_AJAX_OneClick_ThreadRate_Init('oneclick_vote_fi ve');
-->
</script>
I will include this change in future versions in case other people have wiped out the old thread rating template stuff. Please confirm that this corrects the issue, thanks.
abramelin
01-11-2007, 05:35 PM
i added but nothing changed :/
mmmm, I didn't have any errors when I tried testing your site just now
try changing this part and let me know how it goes:
var threadid = $threadinfo[threadid];
document.write('<div class="news" style="line-height:12px;vertical-align:middle;"><div align="center" class="smallfont">');
document.write(' <strong>Aninda Oyla:</strong>');
document.write(' Vasat <input type="radio" name="rating" id="oneclick_vote_one_submit" value="1" onclick="javascript:void(0);" /> ');
document.write(' K?t? <input type="radio" name="rating" id="oneclick_vote_two_submit" value="2" onclick="javascript:void(0);" /> ');
document.write(' Fena degil <input type="radio" name="rating" id="oneclick_vote_three_submit" value="3" onclick="javascript:void(0);" /> ');
document.write(' G?zel <input type="radio" name="rating" id="oneclick_vote_four_submit" value="4" onclick="javascript:void(0);" /> ');
document.write(' Nefis <input type="radio" name="rating" id="oneclick_vote_five_submit" value="5" onclick="javascript:void(0);" /> ');
document.write('</div></div>');
be sure to load a page fresh by either clearing the cache or pressing CTRL+F5
Do you have any Firefox extensions installed? if so, which ones? (ones that would create issues would be NoScript or other JS specific ones)
COBRAws
01-11-2007, 07:12 PM
Thanks man! I requested this half a year ago: https://vborg.vbsupport.ru/showthread.php?t=97778
:D
Doesn't seem to work on firefox 2 but works fine in IE !?
abramelin
01-11-2007, 10:44 PM
mmmm, I didn't have any errors when I tried testing your site just now
try changing this part and let me know how it goes:
var threadid = $threadinfo[threadid];
document.write('<div class="news" style="line-height:12px;vertical-align:middle;"><div align="center" class="smallfont">');
document.write(' <strong>Aninda Oyla:</strong>');
document.write(' Vasat <input type="radio" name="rating" id="oneclick_vote_one_submit" value="1" onclick="javascript:void(0);" /> ');
document.write(' K?t? <input type="radio" name="rating" id="oneclick_vote_two_submit" value="2" onclick="javascript:void(0);" /> ');
document.write(' Fena degil <input type="radio" name="rating" id="oneclick_vote_three_submit" value="3" onclick="javascript:void(0);" /> ');
document.write(' G?zel <input type="radio" name="rating" id="oneclick_vote_four_submit" value="4" onclick="javascript:void(0);" /> ');
document.write(' Nefis <input type="radio" name="rating" id="oneclick_vote_five_submit" value="5" onclick="javascript:void(0);" /> ');
document.write('</div></div>');
be sure to load a page fresh by either clearing the cache or pressing CTRL+F5
Do you have any Firefox extensions installed? if so, which ones? (ones that would create issues would be NoScript or other JS specific ones)
still not working :(
GFX Brands
01-12-2007, 12:27 AM
yup i just uninstalled to many bugs and dosent work on mozilla =(
mmmm, I didn't have any errors when I tried testing your site just now
try changing this part and let me know how it goes:
be sure to load a page fresh by either clearing the cache or pressing CTRL+F5
Do you have any Firefox extensions installed? if so, which ones? (ones that would create issues would be NoScript or other JS specific ones)
Now it works fine for me, thanks for your help :D
Mr Chad
01-12-2007, 07:07 AM
hmm is there a way to hide it, if you already voted.
abramelin
01-12-2007, 12:06 PM
dpsr what did you make to fix it?
Doesn't seem to work on firefox 2 but works fine in IE !?
I have only been testing in Firefox and I have had no issue (with Firefox 1.5 on OSX and Firefox 2 on Windows).
If you want to tell me what error(s) you receive, please do the following:
1. Make sure you DO NOT put the HTML chunk inside of another form it will not work at all if you do this.
2. If you think the error is JS related and you are using Firefox, click Tools > Console then the Errors tab, clear it out first, then try doing the thread rating, Right-click and copy the errors related that show for your forum.
3. You did not upload the JavaScript file to the proper location
I have not yet been able to reproduce any of reported the issues (except for one) so please give me the following details when you tell me it is not working:
- verify the that you uploaded the JS file to the correct directory first
- your browser and version
- the source code of the generated HTML on your site
hmm is there a way to hide it, if you already voted.
Yes.
in vBulletin Options > Poll and Thread Rating Options, set "Allow Thread Rating Vote Changes" to No
dpsr what did you make to fix it?
Could you send me a link to a thread where it isn't working for you? What browser and version are you using?
abramelin
01-12-2007, 01:47 PM
<a href="http://www.9nokta2.com/396-los-angeles-galaxy-cildirmis-olmali.html" target="_blank">http://www.9nokta2.com/396-los-angel...is-olmali.html</a>
i am using firefox 2.0.0.1
I have attached a screenshot which shows that it works for me. I really don't know what else I can do. Do you have any Firefox extensions installed? Are you a localized version of Firefox or an English version (I don't believe it would matter but I am asking anyway)? the zip file contains a non-resized version of it.
abramelin
01-12-2007, 02:54 PM
this is very very strange. i am using firebug as an extension. i have disabled it and it still doesnt work for me :/
dpsr what did you make to fix it?
Edited as suggested here (https://vborg.vbsupport.ru/showpost.php?p=1156452&postcount=14) and here (https://vborg.vbsupport.ru/showpost.php?p=1156352&postcount=12)
In firefox 2, When tried after clearing all browser cache, it works but sometime i feels its not working... lol
You can check it by yourself here (http://www.fotorack.com/celebrities-models/3252-kirsten-dunst-55-new-wallpapers-added-new-post.html) or on any other thread!
Ntfu2
01-12-2007, 03:08 PM
Turning allow vote changes to No, didnt make this disappear for myself?
abramelin:
Maybe I should ask..
are you getting any JavaScript errors?
Or, are you just selecting the radio button and it doesn't do nothing?
Or, could you elaborate on the problem you are experiencing?
I have two ideas I could try but it's not something I believe would actually make a difference
Do you have any other Firefox extensions installed? e.g., GreaseMonkey?
Turning allow vote changes to No, didnt make this disappear for myself?
so, after you rate a thread and refresh the page it is still there? I want to verify this for myself but I am on a machine which I shouldn't be using to browse your adult forum - please leave it on there and I will be able to test it within the next day or so
abramelin
01-12-2007, 03:19 PM
no it doesnt give any error the problem is there is nothing happening :) i dont use greasemonkey
no it doesnt give any error the problem is there is nothing happening :) i dont use greasemonkey
If you enable the Firebug extension, does it display the XML response as it does in the screenshot I posted? (view the one in the zip file to see exactly what i mean)
abramelin
01-12-2007, 03:55 PM
no it doesnt it only displays one error
"formobj has no properties"
and when i click on the java file in console it display this part higlighted "linkobj.onclick = formobj.submit;"
no it doesnt it only displays one error
"formobj has no properties"
and when i click on the java file in console it display this part higlighted "linkobj.onclick = formobj.submit;"
Oh... that is very interesting. That would indicate that you have AJAX either disabled by vBulletin or your browser. This clarification gives me a very clear picture of what I will need to do to test and correct it. I should be able to have time to focus on this on the weekend, I will PM when the issue is resolved.
abramelin
01-12-2007, 04:14 PM
ok thanks, i'll be waiting :)
ok thanks, i'll be waiting :)
one other thing.. I strongly suspect that there may be an issue with your browser or something not loading properly from vBulletin.
When you view the source via your user(admin user..)..
can you do a search for "var vb_disable_ajax" ?
If you do not see this exactly then post what you have:
var vb_disable_ajax = parseInt("0", 10);
Additionally, via Firebug, in the console, could you copy and paste the following command into it and tell me if it returns true/false:
vB_AJAX_Handler.prototype.is_compatible();
And, could you do a "Save As" on the generate HTML from the page and post as an attatchment here? I just want to look at the text to try to identify anything that may be amiss.
And, the default style I see when I go to the site is the one you are using?
As a last result, I would try re-installing your browser and deleting your Firefox profile although that seems pretty extreme but there is a slim possibility that would fix it.
Mr Chad
01-12-2007, 08:11 PM
Yes.
in vBulletin Options > Poll and Thread Rating Options, set "Allow Thread Rating Vote Changes" to No
im still getting prompted to rate topics that have already been rated by me.
abramelin
01-12-2007, 08:24 PM
one other thing.. I strongly suspect that there may be an issue with your browser or something not loading properly from vBulletin.
When you view the source via your user(admin user..)..
can you do a search for "var vb_disable_ajax" ?
If you do not see this exactly then post what you have:
var vb_disable_ajax = parseInt("0", 10);
Additionally, via Firebug, in the console, could you copy and paste the following command into it and tell me if it returns true/false:
vB_AJAX_Handler.prototype.is_compatible();
And, could you do a "Save As" on the generate HTML from the page and post as an attatchment here? I just want to look at the text to try to identify anything that may be amiss.
And, the default style I see when I go to the site is the one you are using?
As a last result, I would try re-installing your browser and deleting your Firefox profile although that seems pretty extreme but there is a slim possibility that would fix it.
i didnt understand very much but i search for it and "var vb_disable_ajax = parseInt("0", 10);" this is avaible in the source.
Hornstar
01-12-2007, 11:29 PM
gotta love ajax. nice work.
Oh... that is very interesting. That would indicate that you have AJAX either disabled by vBulletin or your browser. This clarification gives me a very clear picture of what I will need to do to test and correct it. I should be able to have time to focus on this on the weekend, I will PM when the issue is resolved.
Please inform me also about some sol of this prob ;)
ubblite
01-13-2007, 08:15 AM
Yes.
in vBulletin Options > Poll and Thread Rating Options, set "Allow Thread Rating Vote Changes" to No
im still getting prompted to rate topics that have already been rated by me.
Same problem here. The prompt still comes up and when you try to vote again it says:
"According to our records you have already voted on this thread. Changing votes is not allowed."
The ideal way to have it is not show the vote prompt at all once you've voted.
edit: or have it show something like "You've already voted" instead of the vote bar.
ubblite
01-13-2007, 08:41 AM
Add the code below any where you want in SHOWTHREAD tempate
(PS i have added this code above <!-- / controls above postbits --> to show this form under Newtopic or new reply button)
I could only get your modification to work properly when it's listed under $poll instead of the above. Maybe that's the problem you're having with this hack?
I could only get your modification to work properly when it's listed under $poll instead of the above. Maybe that's the problem you're having with this hack?
Cool :eek: , now its working... thanks for the tip bro ;)
abramelin
01-13-2007, 05:37 PM
yes now its working! thanks :)
abramelin
01-13-2007, 06:56 PM
but when you rate a thread it shows the rating options again when you revisited the thread . can you make an if condition for this?
Mr Chad
01-13-2007, 07:44 PM
thats what i asked b4...
Mr Chad
01-13-2007, 07:45 PM
Same problem here. The prompt still comes up and when you try to vote again it says:
"According to our records you have already voted on this thread. Changing votes is not allowed."
The ideal way to have it is not show the vote prompt at all once you've voted.
edit: or have it show something like "You've already voted" instead of the vote bar.
we just need it to not display anymore. like vb.org
Only one question, how can i make it display rate result message in a box? anybody know?
as long as you have this surrounding the rating thing it should hide it you have already voted and you need to do "in vBulletin Options > Poll and Thread Rating Options, set "Allow Thread Rating Vote Changes" to No"
<if condition="$show['threadrating']">
<if condition="$show['ratethread']">
</if>
</if>
since someone said this didn't work, you could try modifying it to this (untested but should work):
<if condition="$show['threadrating']">
<if condition="$show['ratethread'] && $threadinfo['vote']==NULL">
</if>
</if>
if it still shows it, I'm not sure what else to suggest
DPSR, you mean in a JavaScript alert message box? this would then make it a two-click thread rating system as the user would have to click 'OK' + clicking the rating they wanted.. I can tell you how if you really want it though
Mr Chad
01-14-2007, 06:53 PM
it still is acting the same, i wonder what vbulletin.org is using.
it still is acting the same, i wonder what vbulletin.org is using.
could you post the contents of your template? maybe there is something in there that would help me
Mr Chad
01-14-2007, 07:52 PM
could you post the contents of your template? maybe there is something in there that would help me
http://pastebin.ca/316691
mmm.. nothing really stood out to me. I don't know what else I can do if I can't reproduce the problem myself
ubblite
01-15-2007, 05:41 AM
as long as you have this surrounding the rating thing it should hide it you have already voted and you need to do "in vBulletin Options > Poll and Thread Rating Options, set "Allow Thread Rating Vote Changes" to No"
<if condition="$show['threadrating']">
<if condition="$show['ratethread']">
</if>
</if>
since someone said this didn't work, you could try modifying it to this (untested but should work):
<if condition="$show['threadrating']">
<if condition="$show['ratethread'] && $threadinfo['vote']==NULL">
</if>
</if>
if it still shows it, I'm not sure what else to suggest
Same for me - wrapped both suggestions around code but didn't work - vote thread still shows up. And i have "Allow Thread Rating Vote Changes" selected as No.
Perhaps one more suggestion? Thanks.
Mr Chad
01-16-2007, 03:21 AM
So its not just me.
are the users having issues using vbulletin 3.6.4 ? I just checked your site Mr Chad and you're using 3.6.3. I'm skeptical there would be any significant differences between 3.6.4 and 3.6.3. I will try doing a more thorough analyzation of why this happens but it shouldn't be this baffling.
I am on 3.6.4 and facing same prob :(
ubblite
01-16-2007, 01:00 PM
Yup, 3.6.4 here too with the same problem.
Any way to adopt design to the one we can see here at vb.org?
Ok.. I think I finally figured out what issue is with it still showing after voting:
Set "Check Thread Rating" to Yes in vBulletin Options under "Thread Display Options (showthread)"
If someone can please confirm this I will probably work on a new release
kafi, in the next release, that will be the goal.
ubblite
01-16-2007, 11:38 PM
Ok.. I think I finally figured out what issue is with it still showing after voting:
Set "Check Thread Rating" to Yes in vBulletin Options under "Thread Display Options (showthread)"
If someone can please confirm this I will probably work on a new release
kafi, in the next release, that will be the goal.
Yup, it's working now. Nice job - thanks.
Yea, working just fine now :D:D:D
Thanks ;)
trustful88
01-18-2007, 12:38 AM
wow sweet, i might get this on my page
nader
01-20-2007, 09:58 AM
i think there is bug in this script i tested on vb3.5.X it does not give number?
<script type="text/javascript" src="clientscript/vbulletin_ajax_oneclick_threadrate.js?v=$vboptions[simpleversion]">
StarBuG
01-20-2007, 02:03 PM
Hi
Thank you for this modification.
I have two questions:
1) How can I get a permanent "vote" button like here on vB.org and not use ajax?
2) Currently the message you get after voting is not formated (I use the modified version from post #6). It does not show in the colored box/div with background color.
How can I get it to display it within this box/div?
If I add divs around or inside of
<span id="oneclick_threadrating_response"></span>
<span id="oneclick_threadrating_current"></span
The answer does not show at all but this is the part that generates the "thank you for rating" message.
Any help is appreciated
StarBuG
arena
01-20-2007, 04:01 PM
One i modified for my site (attached preview):p
If anyone want to use it, here it is--
Add this your style CSS (you can change the colors matching with your forum):
.news{
padding: 5px;
background: #EDF4FA;
border: 1px solid #D7DEE4;
color: #4E4E4C;
}
Add the code below $poll (not tested anywhere else)
Change the options (marked with RED color) in above code the way you want.
Click save and rest followed all instructions provided by fci
BIG thanks to fci for the hack ;)
Thank you :)
StarBuG
01-21-2007, 02:29 PM
Does no one has an Idea how to solve the 2 issues >> here << (https://vborg.vbsupport.ru/showpost.php?p=1163467&postcount=66) ??
Pvtiste
01-22-2007, 04:40 PM
One i modified for my site (attached preview):p
If anyone want to use it, here it is--
Add this your style CSS (you can change the colors matching with your forum):
.news{
padding: 5px;
background: #EDF4FA;
border: 1px solid #D7DEE4;
color: #4E4E4C;
}
Add the code below $poll (not tested anywhere else)
Change the options (marked with RED color) in above code the way you want.
Click save and rest followed all instructions provided by fci
BIG thanks to fci for the hack ;)
Thanks for the job & sharing but this mod doesn't work on my board :(
When I tick, there is nothing... Help me please :D
Thank you
tutorials.de
01-27-2007, 01:42 AM
Hi Dudes,
first of all thanks to fci for this great hack! Instead of the template code provided you may use the one we have installed in our showroom (http://www.tutorials.de/forum/showroom) (see screenshot).
Here is the code (for vBulletin 3.6.4.) It is "plug & play" but I can't give any guarantee that it works for you. Just paste it in template SHOWTHREAD directly under $poll
<!-- Threadrating -->
<if condition="$show['threadrating']">
<if condition="$show['ratethread']">
<div style="text-align:left; padding-bottom: 5px;">
<span id="oneclick_container">
<noscript>$vbphrase[rating]:</noscript>
<form action="threadrate.php?t=$threadid" method="post" id="oneclick_vote_one">
<input type="hidden" name="s" value="$session[dbsessionhash]" />
<input type="hidden" name="t" value="$threadid" />
<input type="hidden" name="pp" value="$perpage" />
<input type="hidden" name="page" value="$pagenumber" />
<input type="hidden" name="vote" value="1" />
<input type="submit" value="1" style="display:none;" />
<noscript><input type="submit" value="1" /></noscript>
</form>
<form action="threadrate.php?t=$threadid" method="post" id="oneclick_vote_two">
<input type="hidden" name="s" value="$session[dbsessionhash]" />
<input type="hidden" name="t" value="$threadid" />
<input type="hidden" name="pp" value="$perpage" />
<input type="hidden" name="page" value="$pagenumber" />
<input type="hidden" name="vote" value="2" />
<input type="submit" value="1" style="display:none;" />
<noscript><input type="submit" value="2" /></noscript>
</form>
<form action="threadrate.php?t=$threadid" method="post" id="oneclick_vote_three">
<input type="hidden" name="s" value="$session[dbsessionhash]" />
<input type="hidden" name="t" value="$threadid" />
<input type="hidden" name="pp" value="$perpage" />
<input type="hidden" name="page" value="$pagenumber" />
<input type="hidden" name="vote" value="3" />
<input type="submit" value="1" style="display:none;" />
<noscript><input type="submit" value="3" /></noscript>
</form>
<form action="threadrate.php?t=$threadid" method="post" id="oneclick_vote_four">
<input type="hidden" name="s" value="$session[dbsessionhash]" />
<input type="hidden" name="t" value="$threadid" />
<input type="hidden" name="pp" value="$perpage" />
<input type="hidden" name="page" value="$pagenumber" />
<input type="hidden" name="vote" value="4" />
<input type="submit" value="1" style="display:none;" />
<noscript><input type="submit" value="4" /></noscript>
</form>
<form action="threadrate.php?t=$threadid" method="post" id="oneclick_vote_five">
<input type="hidden" name="s" value="$session[dbsessionhash]" />
<input type="hidden" name="t" value="$threadid" />
<input type="hidden" name="pp" value="$perpage" />
<input type="hidden" name="page" value="$pagenumber" />
<input type="hidden" name="vote" value="5" />
<input type="submit" value="1" style="display:none;" />
<noscript><input type="submit" value="5" /></noscript>
</form>
<script type="text/javascript"><!--
var threadid = $threadinfo[threadid];
document.write('<table class="tborder" cellpadding="3" cellspacing="1" width="100%"><tr>');
document.write(' <td class="alt2">$vbphrase[rating]:</td>');
document.write(' <td class="alt1"><a href="javascript:void(0);" id="oneclick_vote_one_submit" style="font-size:14pt; text-decoration:none"><img class="inlineimg" src="$stylevar[imgdir_rating]/rating_1.gif" alt="$vbphrase[terrible]" border="0" /> $vbphrase[terrible]</a></td>');
document.write(' <td class="alt2"><a href="javascript:void(0);" id="oneclick_vote_two_submit" style="font-size:14pt; text-decoration:none"><img class="inlineimg" src="$stylevar[imgdir_rating]/rating_2.gif" alt="$vbphrase[bad]" border="0" /> $vbphrase[bad]</a></td>');
document.write(' <td class="alt1"><a href="javascript:void(0);" id="oneclick_vote_three_submit" style="font-size:14pt; text-decoration:none"><img class="inlineimg" src="$stylevar[imgdir_rating]/rating_3.gif" alt="$vbphrase[average]" border="0" /> $vbphrase[average]</a></td>');
document.write(' <td class="alt2"><a href="javascript:void(0);" id="oneclick_vote_four_submit" style="font-size:14pt; text-decoration:none"><img class="inlineimg" src="$stylevar[imgdir_rating]/rating_4.gif" alt="$vbphrase[good]" border="0" /> $vbphrase[good]</a></td>');
document.write(' <td class="alt1"><a href="javascript:void(0);" id="oneclick_vote_five_submit" style="font-size:14pt; text-decoration:none"><img class="inlineimg" src="$stylevar[imgdir_rating]/rating_5.gif" alt="$vbphrase[excellent]" border="0" /> $vbphrase[excellent]</a></td>');
document.write('</tr></table>');
-->
</script>
<script type="text/javascript" src="clientscript/vbulletin_ajax_oneclick_threadrate.js?v=$vboptions[simpleversion]"></script>
<script type="text/javascript">
<!--
vB_AJAX_OneClick_ThreadRate_Init('oneclick_vote_on e');
vB_AJAX_OneClick_ThreadRate_Init('oneclick_vote_tw o');
vB_AJAX_OneClick_ThreadRate_Init('oneclick_vote_th ree');
vB_AJAX_OneClick_ThreadRate_Init('oneclick_vote_fo ur');
vB_AJAX_OneClick_ThreadRate_Init('oneclick_vote_fi ve');
-->
</script>
</span>
<span id="oneclick_threadrating_current"></span>
<span id="oneclick_threadrating_response"></span>
</div>
</if>
</if>
<!-- / Threadrating -->
Have fun :)
- Lagaf
www.tutorials.de
abramelin
01-28-2007, 01:12 AM
this is not working. this module crashes the internet explorer 6!
GameWizard
01-30-2007, 10:55 AM
this is not working. this module crashes the internet explorer 6!Tested on IE6, worked for me.
StarBuG
01-30-2007, 11:27 AM
@tutorials.de: Did you solve the problem that the answer after voting is not formated properly?
After voting the whole format disappears and only the text is shown on the forum background
"Thank you for voting blabla".
From the looks of your code you did not solve that problem either, or am I wrong?
See attachments for my problem.
Does anyone has a solution for this?
Digitalus
01-31-2007, 07:46 PM
Edite....
encryption
02-02-2007, 10:17 AM
does anyone notice that the mod kinda slows the page load (esp when opening a thread)?
StarBuG
02-09-2007, 09:00 AM
@Digitalus
Your suggestion can't work because you say:
"if rating is on" do nothing
But the table you create at the bottom is only for the rating itself, the problem with
<span id="oneclick_threadrating_response"></span>
<span id="oneclick_threadrating_current"></span>
displaying the text on the forum background without the div/table is not solved ;)
But thanks for trying ;)
Jay...
02-11-2007, 02:49 PM
any update on a re-design of this? Just like i have requested on the first page of the thread. Thanks
Jay...
02-21-2007, 04:39 PM
anyone?
Jay...
03-15-2007, 02:25 PM
bump it
valdet
03-15-2007, 05:07 PM
Can anyone incorporate thread rating with this Ajax Star rating located here
http://www.masugadesign.com/the-lab/scripts/unobtrusive-ajax-star-rating-bar/
this looks awesome.
magnus
03-21-2007, 12:32 PM
For those looking for a clone of the vB.org thread ratings, replace your SHOWTHREAD template with the contents of the attached file.
The modification in the original post is not necessary for the vB.org thead rating style, so you may uninstall it and delete clientscript/vbulletin_ajax_oneclick_threadrate.js if using the attached template.
Jay...
03-21-2007, 03:57 PM
For those looking for a clone of the vB.org thread ratings, replace your SHOWTHREAD template with the contents of the attached file.
The modification in the original post is not necessary for the vB.org thead rating style, so you may uninstall it and delete clientscript/vbulletin_ajax_oneclick_threadrate.js if using the attached template.
cheers mate! you are a legend! :D :up:
If you are using this mod like me, try this one:
(rating result aligned to center and in the style)
<if condition="$show['threadrating']">
<if condition="$show['ratethread'] && $threadinfo['vote']==NULL">
<div class="quickajaxrating" style="text-align:center; padding-bottom: 5px;">
<span id="oneclick_container">
<noscript>$vbphrase[rating]:</noscript>
<form action="threadrate.php?t=$threadid" method="post" id="oneclick_vote_one">
<input type="hidden" name="s" value="$session[dbsessionhash]" />
<input type="hidden" name="t" value="$threadid" />
<input type="hidden" name="pp" value="$perpage" />
<input type="hidden" name="page" value="$pagenumber" />
<input type="hidden" name="vote" value="1" />
<input type="submit" value="1" style="display:none;" />
<noscript><input type="submit" value="1" /></noscript>
</form>
<form action="threadrate.php?t=$threadid" method="post" id="oneclick_vote_two">
<input type="hidden" name="s" value="$session[dbsessionhash]" />
<input type="hidden" name="t" value="$threadid" />
<input type="hidden" name="pp" value="$perpage" />
<input type="hidden" name="page" value="$pagenumber" />
<input type="hidden" name="vote" value="2" />
<input type="submit" value="1" style="display:none;" />
<noscript><input type="submit" value="2" /></noscript>
</form>
<form action="threadrate.php?t=$threadid" method="post" id="oneclick_vote_three">
<input type="hidden" name="s" value="$session[dbsessionhash]" />
<input type="hidden" name="t" value="$threadid" />
<input type="hidden" name="pp" value="$perpage" />
<input type="hidden" name="page" value="$pagenumber" />
<input type="hidden" name="vote" value="3" />
<input type="submit" value="1" style="display:none;" />
<noscript><input type="submit" value="3" /></noscript>
</form>
<form action="threadrate.php?t=$threadid" method="post" id="oneclick_vote_four">
<input type="hidden" name="s" value="$session[dbsessionhash]" />
<input type="hidden" name="t" value="$threadid" />
<input type="hidden" name="pp" value="$perpage" />
<input type="hidden" name="page" value="$pagenumber" />
<input type="hidden" name="vote" value="4" />
<input type="submit" value="1" style="display:none;" />
<noscript><input type="submit" value="4" /></noscript>
</form>
<form action="threadrate.php?t=$threadid" method="post" id="oneclick_vote_five">
<input type="hidden" name="s" value="$session[dbsessionhash]" />
<input type="hidden" name="t" value="$threadid" />
<input type="hidden" name="pp" value="$perpage" />
<input type="hidden" name="page" value="$pagenumber" />
<input type="hidden" name="vote" value="5" />
<input type="submit" value="1" style="display:none;" />
<noscript><input type="submit" value="5" /></noscript>
</form>
<script type="text/javascript"><!--
var threadid = $threadinfo[threadid];
document.write('<div class="quickajaxrating2" style="line-height:12px;vertical-align:middle;"><div align="center" class="smallfont">');
document.write('<strong>Rate this thread: </strong>');
document.write(' It sucks! <input type="radio" name="rating" id="oneclick_vote_one_submit" value="1" onclick="javascript:void(0);" /> ');
document.write(' Below average <input type="radio" name="rating" id="oneclick_vote_two_submit" value="2" onclick="javascript:void(0);" /> ');
document.write(' Average <input type="radio" name="rating" id="oneclick_vote_three_submit" value="3" onclick="javascript:void(0);" /> ');
document.write(' Above average <input type="radio" name="rating" id="oneclick_vote_four_submit" value="4" onclick="javascript:void(0);" /> ');
document.write(' It rocks! <input type="radio" name="rating" id="oneclick_vote_five_submit" value="5" onclick="javascript:void(0);" /> ');
document.write('</div></div>');
-->
</script>
<script type="text/javascript" src="clientscript/vbulletin_ajax_oneclick_threadrate.js?v=$vboptions[simpleversion]"></script>
<script type="text/javascript">
<!--
var threadid = $threadinfo[threadid];
vB_AJAX_OneClick_ThreadRate_Init('oneclick_vote_on e');
vB_AJAX_OneClick_ThreadRate_Init('oneclick_vote_tw o');
vB_AJAX_OneClick_ThreadRate_Init('oneclick_vote_th ree');
vB_AJAX_OneClick_ThreadRate_Init('oneclick_vote_fo ur');
vB_AJAX_OneClick_ThreadRate_Init('oneclick_vote_fi ve');
-->
</script>
</span>
<span id="oneclick_threadrating_current"></span>
<span id="oneclick_threadrating_response"></span>
</div>
</if>
</if>
Add this to CSS style:
Change it the way you want
.quickajaxrating{
padding: 5px;
background: #EAEAEA;
border: 1px dashed #B53A25;
color: #000000;
}
.quickajaxrating2{
padding: 5px;
background: #EAEAEA;
color: #000000;
}
KEKforce
03-26-2007, 12:45 PM
Works very good DPSR! THANKS!!
Works very good DPSR! THANKS!!
No problem, glad you like it :up:
rokked
05-27-2007, 11:24 PM
installed, you can see it at http://forums.rokked.com, i moved the hidden form elements above the inlinemod.php form and removed the noscript tags. so im screwing people that dont have js enabled. oh well.
seems to be working fine on 3.6.7
mgurain
09-26-2007, 06:13 PM
Hi,,
Can you make it as the one in this mod forum above each mod:
Help others by rating [AJAX] Your One Click Thread Ratings.
Excellent Good Average Bad Terrible
We need it as a one xml product not template changes, since we have more than one style installed.
Thanks for your great job.
ragtek
09-26-2007, 06:42 PM
it would be nice if you make images(stars) instead of the numbers
with an nice onmouse event
satforce
09-27-2007, 12:44 PM
Very good job ..
I install it and it works fine ..
Just one question please !! How can I change stars to number of votes like vb.org ...
Please answer me !!
satforce
09-28-2007, 11:14 PM
Please answer !!!
MissKalunji
10-03-2007, 04:24 PM
that would be good for vbgallery
is it possible to make it work inside the first post of a thread?
thanks
MissKalunji
05-10-2008, 01:18 PM
hmm is there a way to hide it, if you already voted.
Same problem here. The prompt still comes up and when you try to vote again it says:
"According to our records you have already voted on this thread. Changing votes is not allowed."
The ideal way to have it is not show the vote prompt at all once you've voted.
edit: or have it show something like "You've already voted" instead of the vote bar.
it would be nice if you make images(stars) instead of the numbers
with an nice onmouse event
To answer all of ya'll question
Here's the code i used when someone voted it doesn't show the bar anymore
and i've also added the image (instead) of the words. I've put in bold what i changed and what you can change to put your own image. Pretty basic :)
anyone figure out how to put it somewhere else the under poll? i haven't figured it out yet
I rather this one then magnus simple when you click it rates instead of having to click on submit
<!-- Thread Rating -->
<if condition="!$show['rating'] AND $show['threadrating'] AND $show['ratethread']">
<if condition="$show['ratethread'] && $threadinfo['vote']==NULL">
<div class="quickajaxrating" style="text-align:center; padding-bottom: 5px;">
<span id="oneclick_container">
<noscript>$vbphrase[rating]:</noscript>
<form action="threadrate.php?t=$threadid" method="post" id="oneclick_vote_one">
<input type="hidden" name="s" value="$session[dbsessionhash]" />
<input type="hidden" name="t" value="$threadid" />
<input type="hidden" name="pp" value="$perpage" />
<input type="hidden" name="page" value="$pagenumber" />
<input type="hidden" name="vote" value="1" />
<input type="submit" value="1" style="display:none;" />
<noscript><input type="submit" value="1" /></noscript>
</form>
<form action="threadrate.php?t=$threadid" method="post" id="oneclick_vote_two">
<input type="hidden" name="s" value="$session[dbsessionhash]" />
<input type="hidden" name="t" value="$threadid" />
<input type="hidden" name="pp" value="$perpage" />
<input type="hidden" name="page" value="$pagenumber" />
<input type="hidden" name="vote" value="2" />
<input type="submit" value="1" style="display:none;" />
<noscript><input type="submit" value="2" /></noscript>
</form>
<form action="threadrate.php?t=$threadid" method="post" id="oneclick_vote_three">
<input type="hidden" name="s" value="$session[dbsessionhash]" />
<input type="hidden" name="t" value="$threadid" />
<input type="hidden" name="pp" value="$perpage" />
<input type="hidden" name="page" value="$pagenumber" />
<input type="hidden" name="vote" value="3" />
<input type="submit" value="1" style="display:none;" />
<noscript><input type="submit" value="3" /></noscript>
</form>
<form action="threadrate.php?t=$threadid" method="post" id="oneclick_vote_four">
<input type="hidden" name="s" value="$session[dbsessionhash]" />
<input type="hidden" name="t" value="$threadid" />
<input type="hidden" name="pp" value="$perpage" />
<input type="hidden" name="page" value="$pagenumber" />
<input type="hidden" name="vote" value="4" />
<input type="submit" value="1" style="display:none;" />
<noscript><input type="submit" value="4" /></noscript>
</form>
<form action="threadrate.php?t=$threadid" method="post" id="oneclick_vote_five">
<input type="hidden" name="s" value="$session[dbsessionhash]" />
<input type="hidden" name="t" value="$threadid" />
<input type="hidden" name="pp" value="$perpage" />
<input type="hidden" name="page" value="$pagenumber" />
<input type="hidden" name="vote" value="5" />
<input type="submit" value="1" style="display:none;" />
<noscript><input type="submit" value="5" /></noscript>
</form>
<script type="text/javascript"><!--
var threadid = $threadinfo[threadid];
document.write('<div class="quickajaxrating2" style="line-height:12px;vertical-align:middle;"><div align="center" class="smallfont">');
document.write('<strong>Rate Video: </strong>');
document.write(' You can add your own words here if you want <input type=image src="url to image" name="rating" id="oneclick_vote_one_submit" value="1" onclick="javascript:void(0);" /> ');
document.write('you can add your own words here if you want <input type=image src="url to image" name="rating" id="oneclick_vote_two_submit" value="2" onclick="javascript:void(0);" /> ');
document.write(' you can add your own words here if you want <input type=image src="url to image" name="rating" id="oneclick_vote_three_submit" value="3" onclick="javascript:void(0);" /> ');
document.write(' you can add your own words here if you want<input type=image src="url to image" name="rating" id="oneclick_vote_four_submit" value="4" onclick="javascript:void(0);" /> ');
document.write('you can add your own words here if you want<input type=image src="url to image" name="rating" id="oneclick_vote_five_submit" value="5" onclick="javascript:void(0);" /> ');
document.write('</div></div>');
-->
</script>
<script type="text/javascript" src="clientscript/vbulletin_ajax_oneclick_threadrate.js?v=$vboptions[simpleversion]"></script>
<script type="text/javascript">
<!--
var threadid = $threadinfo[threadid];
vB_AJAX_OneClick_ThreadRate_Init('oneclick_vote_on e');
vB_AJAX_OneClick_ThreadRate_Init('oneclick_vote_tw o');
vB_AJAX_OneClick_ThreadRate_Init('oneclick_vote_th ree');
vB_AJAX_OneClick_ThreadRate_Init('oneclick_vote_fo ur');
vB_AJAX_OneClick_ThreadRate_Init('oneclick_vote_fi ve');
-->
</script>
</span>
<span id="oneclick_threadrating_current"></span>
<span id="oneclick_threadrating_response"></span>
</div>
</if>
</if>
<!--Thread Rating-->
ZomgStuff
01-13-2009, 04:57 PM
I wouldn't assume there would be any issue with VB 3.8?
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.