Thread: Show Thread Enhancements - [AJAX] Threads rating
View Single Post
  #210  
Old 06-19-2009, 06:41 PM
Dennis Kaczor Dennis Kaczor is offline
 
Join Date: Oct 2005
Location: Toronto
Posts: 76
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by paul41598 View Post
F4VN,

I've changed the template to meet your needs. I wanted it as well.

Replace the trate_main template with this:

Code:
		<if condition="$show['threadrating']">
    <if condition="$show['ratethread']">
        <div class="quickajaxrating" style="text-align:center; padding-bottom: 5px; background: #FFDC84; color:#000;"">
            <span id="oneclick_container">
                <if condition="!$rated">
                    <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 cellpadding="$stylevar[cellpadding]" cellspacing="0" border="5" width="100%"><tr><td align="right" width="45%" nowrap="nowrap"><div><strong>$vbphrase[trate_rateit]</strong></div></td><td align="left" width="$widthcolumn%" nowrap="nowrap"><div class="current-rating" style="width:$current_rating;"><label for="vote5"><input type="radio" name="vote" id="oneclick_vote_five_submit" value="5" $votechecked[5] />$vbphrase[excellent]</label><label for="vote4"><input type="radio" name="vote" id="oneclick_vote_four_submit" value="4" $votechecked[4] />$vbphrase[good]</label><label for="vote3"><input type="radio" name="vote" id="oneclick_vote_three_submit" value="3" $votechecked[3] />$vbphrase[average]</label><label for="vote2"><input type="radio" name="vote" id="oneclick_vote_two_submit" value="2" $votechecked[2] />$vbphrase[bad]</label><label for="vote1"><input type="radio" name="vote" id="oneclick_vote_one_submit" value="1" $votechecked[1] />$vbphrase[terrible]</label></div></div></td>$evr</tr></table>');
                        -->
                    </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>
                    <else />
                    <div align="center" style="font-size: 15px; font-family: verdana; font-weight: bold;">You have already rated this thread!</div> </if>
                    <table cellpadding="$stylevar[cellpadding]" cellspacing="0" border="0" width="100%">
                        <tr>
                            <td align="right" width="45%" nowrap="nowrap">
                                <div>
                                    <strong>$vbphrase[trate_currate]</strong>
                                </div>
                            </td>
                            <td align="left" width="$widthcolumn%" nowrap="nowrap">
 														
                                <ul class="star-rating" title="<phrase 1="$thread[votenum]" 2="$thread[voteavg]">$vbphrase[thread_rating_x_votes_y_average]</phrase>">
                                    <li class="current-rating" style="width:$current_rating;">
                                    </li>
                                </ul>
                            </td>$evr
                        </tr>
                    </table>
                </if>
            </span>
            <span id="oneclick_threadrating_current"></span>
            <span id="oneclick_threadrating_response"></span>
        </div>   
</if>
<br/>
Very nice work here Paul, and I have added this to my system. I have one question if this is possible as I'm not a coder. Rather than the user trying to move the mouse over the little radio button, have it so that it highlights the button when you move over the text area for that selection? Just a thought...

Dennis
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01241 seconds
  • Memory Usage 1,816KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD_SHOWPOST
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code
  • (1)bbcode_quote
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • reputationlevel
  • showthread
Included Files:
  • ./showpost.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_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showpost_start
  • bbcode_fetch_tags
  • bbcode_create
  • postbit_factory
  • showpost_post
  • 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
  • showpost_complete