The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
[AJAX] Your One Click Thread Ratings Details »» | |||||||||||||||||||||||||
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: Code:
<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_one'); vB_AJAX_OneClick_ThreadRate_Init('oneclick_vote_two'); vB_AJAX_OneClick_ThreadRate_Init('oneclick_vote_three'); vB_AJAX_OneClick_ThreadRate_Init('oneclick_vote_four'); vB_AJAX_OneClick_ThreadRate_Init('oneclick_vote_five'); --> </script> </span> <span id="oneclick_threadrating_current"></span> <span id="oneclick_threadrating_response"></span> </div> </if> </if> 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)" Show Your Support
|
Comments |
#92
|
||||
|
||||
that would be good for vbgallery
|
#93
|
|||
|
|||
is it possible to make it work inside the first post of a thread?
thanks |
#94
|
||||
|
||||
Quote:
Quote:
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 Code:
<!-- 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_one'); vB_AJAX_OneClick_ThreadRate_Init('oneclick_vote_two'); vB_AJAX_OneClick_ThreadRate_Init('oneclick_vote_three'); vB_AJAX_OneClick_ThreadRate_Init('oneclick_vote_four'); vB_AJAX_OneClick_ThreadRate_Init('oneclick_vote_five'); --> </script> </span> <span id="oneclick_threadrating_current"></span> <span id="oneclick_threadrating_response"></span> </div> </if> </if> <!--Thread Rating--> |
#95
|
|||
|
|||
I wouldn't assume there would be any issue with VB 3.8?
|
Thread Tools | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|