Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.6 > vBulletin 3.6 Add-ons

Reply
 
Thread Tools
[AJAX] Your One Click Thread Ratings Details »»
[AJAX] Your One Click Thread Ratings
Version: 0.1.1, by fci fci is offline
Developer Last Online: Aug 2009 Show Printable Version Email this Page

Category: Show Thread Enhancements - Version: 3.6.4 Rating:
Released: 01-10-2007 Last Update: 01-11-2007 Installs: 51
Template Edits
Additional Files Is in Beta Stage  
No support by the author.

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>
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)"

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #72  
Old 01-28-2007, 01:12 AM
abramelin abramelin is offline
 
Join Date: Mar 2006
Posts: 263
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

this is not working. this module crashes the internet explorer 6!
Reply With Quote
  #73  
Old 01-30-2007, 10:55 AM
GameWizard's Avatar
GameWizard GameWizard is offline
 
Join Date: Apr 2004
Location: Vancouver, BC
Posts: 319
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by abramelin View Post
this is not working. this module crashes the internet explorer 6!
Tested on IE6, worked for me.
Reply With Quote
  #74  
Old 01-30-2007, 11:27 AM
StarBuG's Avatar
StarBuG StarBuG is offline
 
Join Date: Dec 2001
Location: Germany
Posts: 1,033
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

@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?
Reply With Quote
  #75  
Old 01-31-2007, 07:46 PM
Digitalus Digitalus is offline
 
Join Date: Aug 2006
Posts: 53
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Edite....
Reply With Quote
  #76  
Old 02-02-2007, 10:17 AM
encryption's Avatar
encryption encryption is offline
 
Join Date: Sep 2005
Posts: 155
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

does anyone notice that the mod kinda slows the page load (esp when opening a thread)?
Reply With Quote
  #77  
Old 02-09-2007, 09:00 AM
StarBuG's Avatar
StarBuG StarBuG is offline
 
Join Date: Dec 2001
Location: Germany
Posts: 1,033
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

@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
Reply With Quote
  #78  
Old 02-11-2007, 02:49 PM
Jay... Jay... is offline
 
Join Date: Jan 2006
Location: Sunderland, UK
Posts: 351
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

any update on a re-design of this? Just like i have requested on the first page of the thread. Thanks
Reply With Quote
  #79  
Old 02-21-2007, 04:39 PM
Jay... Jay... is offline
 
Join Date: Jan 2006
Location: Sunderland, UK
Posts: 351
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

anyone?
Reply With Quote
  #80  
Old 03-15-2007, 02:25 PM
Jay... Jay... is offline
 
Join Date: Jan 2006
Location: Sunderland, UK
Posts: 351
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

bump it
Reply With Quote
  #81  
Old 03-15-2007, 05:07 PM
valdet's Avatar
valdet valdet is offline
 
Join Date: Feb 2007
Posts: 505
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Can anyone incorporate thread rating with this Ajax Star rating located here

http://www.masugadesign.com/the-lab/...ar-rating-bar/

this looks awesome.
Reply With Quote
Reply

Thread Tools

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

Forum Jump


All times are GMT. The time now is 02:31 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.06341 seconds
  • Memory Usage 2,312KB
  • Queries Executed 25 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)bbcode_code
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete