Register Members List Search Today's Posts Mark Forums Read

Reply
 
Mod Options
[AJAX] Your One Click Thread Ratings Details »
[AJAX] Your One Click Thread Ratings
Mod Version: 0.1.1, by fci (Member) fci is offline
Developer Last Online: Aug 2009 I like it Show Printable Version Email this Page

This modification is in the archives.
vB Version: 3.6.4 Rating: (15 votes - 4.40 average) Installs: 49
Released: 11 Jan 2007 Last Update: 12 Jan 2007 Downloads: 362
Not Supported Template Edits Additional Files Is in Beta Stage  

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:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

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. ( http://www.vbulletin.org/forum/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)"

Download Now

Only licensed members can download files, Click Here for more information.

Screenshots

Click image for larger version

Name:	oneclickrating_before.png
Views:	1151
Size:	15.7 KB
ID:	58817   Click image for larger version

Name:	oneclickrating_after.png
Views:	677
Size:	13.2 KB
ID:	58818  

Show Your Support

  • To receive notifications regarding updates -> Click to Mark as Installed.
  • This modification may not be copied, reproduced or published elsewhere without author's permission.
Comments
  #2  
Old 11 Jan 2007, 02:47
Mr_Snob Mr_Snob is offline
 
Join Date: Jan 2004
Real name: HASANN
heyy you are cool man thanks for this wonderfull hack
Reply With Quote
  #3  
Old 11 Jan 2007, 10:10
Jay... Jay... is offline
 
Join Date: Jan 2006
is there anyway this can be made to look like the rating system does on the mods section of this site?
Reply With Quote
  #4  
Old 11 Jan 2007, 11:47
Jarllax Jarllax is offline
 
Join Date: Jun 2006
Great hack, thanks!
Reply With Quote
  #5  
Old 11 Jan 2007, 13:05
fci fci is offline
 
Join Date: Nov 2004
Real name: Clayton Smith
Originally Posted by Jay... View Post
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.
Reply With Quote
  #6  
Old 11 Jan 2007, 13:08
DPSR's Avatar
DPSR DPSR is offline
 
Join Date: Aug 2006
Thumbs up Little modified .....

One i modified for my site (attached preview)

If anyone want to use it, here it is--

Add this your style CSS (you can change the colors matching with your forum):

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

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);" />&nbsp;&nbsp;');
document.write(' Below average <input type="radio" name="rating" id="oneclick_vote_two_submit" value="2" onclick="javascript:void(0);" />&nbsp;&nbsp;');
document.write(' Average <input type="radio" name="rating" id="oneclick_vote_three_submit" value="3" onclick="javascript:void(0);" />&nbsp;&nbsp;');
document.write(' Above average <input type="radio" name="rating" id="oneclick_vote_four_submit" value="4" onclick="javascript:void(0);" />&nbsp;&nbsp;');
document.write(' Stunning <input type="radio" name="rating" id="oneclick_vote_five_submit" value="5" onclick="javascript:void(0);" />&nbsp;&nbsp;');
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_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>
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
Attached Images
File Type: jpg shot.jpg (33.2 KB, 434 views)
Attached Files
File Type: txt modified.txt (4.7 KB, 63 views)

Last edited by DPSR; 15 Jan 2007 at 03:38.
Reply With Quote
  #7  
Old 11 Jan 2007, 13:19
Mr_Snob Mr_Snob is offline
 
Join Date: Jan 2004
Real name: HASANN
@DPSR
very nice i modified too for my site
when i finish, i share it with you
Reply With Quote
  #8  
Old 11 Jan 2007, 14:19
abramelin's Avatar
abramelin abramelin is offline
 
Join Date: Mar 2006
it is not working on me. DPSR i have modified like you said but when i click on the ratio it doesnt do anything?
Reply With Quote
  #9  
Old 11 Jan 2007, 16:25
DPSR's Avatar
DPSR DPSR is offline
 
Join Date: Aug 2006
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)
Reply With Quote
  #10  
Old 11 Jan 2007, 16:26
abramelin's Avatar
abramelin abramelin is offline
 
Join Date: Mar 2006
i am using firefox too. i think this is a firefox issue how can we fix this?
Reply With Quote
  #11  
Old 11 Jan 2007, 16:35
DPSR's Avatar
DPSR DPSR is offline
 
Join Date: Aug 2006
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 .....
Reply With Quote
  #12  
Old 11 Jan 2007, 17:39
fci fci is offline
 
Join Date: Nov 2004
Real name: Clayton Smith
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:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

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.
Reply With Quote
  #13  
Old 11 Jan 2007, 18:35
abramelin's Avatar
abramelin abramelin is offline
 
Join Date: Mar 2006
i added but nothing changed :/
Reply With Quote
  #14  
Old 11 Jan 2007, 19:54
fci fci is offline
 
Join Date: Nov 2004
Real name: Clayton Smith
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:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

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)
Reply With Quote
  #15  
Old 11 Jan 2007, 20:12
COBRAws's Avatar
COBRAws COBRAws is offline
 
Join Date: Oct 2002
Real name: Jack
Thanks man! I requested this half a year ago: http://www.vbulletin.org/forum/showthread.php?t=97778


__________________
cobraws
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Mod Options

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


New To Site? Need Help?

All times are GMT. The time now is 11:14.

Layout Options | Width: Wide Color: