vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.6 Template Modifications (https://vborg.vbsupport.ru/forumdisplay.php?f=192)
-   -   Show Thread Enhancements - vBorg Thread Rating (https://vborg.vbsupport.ru/showthread.php?t=142733)

magnus 03-20-2007 10:00 PM

vBorg Thread Rating
 
Update 08/21/07: Made a template change that should address the issue with the rating box still being visible after a thread has been rated. [link]

There seemed to be multiple requests for this, so here it is. This is a clone of the thread rating system you see in the modifications section of vBorg.

For a demo, scroll up to the big orange rectangle, select "Excellent" then click "Vote Now!". :p

Installation is simple. Just replace your current SHOWTHREAD template with the attached file. That's it.



[hr]-[/hr]

For those with a modified SHOWTHREAD (or just for those who enjoy doing things the hard way), here are the required modifications:

In SHOWTHREAD:


FIND and DELETE:
HTML Code:

<if condition="$show['threadrating']">
        <!-- thread rating menu -->
        <div class="vbmenu_popup" id="threadrating_menu" style="display:none">
        <form action="threadrate.php?t=$threadid" method="post" id="showthread_threadrate_form">
                <table cellpadding="4" cellspacing="1" border="0">
                <tr>
                        <td class="thead">$vbphrase[rate_this_thread]<a name="goto_threadrating"></a></td>
                </tr>
                <if condition="$show['ratethread']">
                <tr>
                        <td class="vbmenu_option" title="nohilite" id="threadrating_options">
                        <div><img class="inlineimg" src="$stylevar[imgdir_rating]/rating_5.gif" alt="$vbphrase[excellent]" /><label for="vote5"><input type="radio" name="vote" id="vote5" value="5" $votechecked[5] />$vbphrase[excellent]</label></div>
                        <div><img class="inlineimg" src="$stylevar[imgdir_rating]/rating_4.gif" alt="$vbphrase[good]" /><label for="vote4"><input type="radio" name="vote" id="vote4" value="4" $votechecked[4] />$vbphrase[good]</label></div>
                        <div><img class="inlineimg" src="$stylevar[imgdir_rating]/rating_3.gif" alt="$vbphrase[average]" /><label for="vote3"><input type="radio" name="vote" id="vote3" value="3" $votechecked[3] />$vbphrase[average]</label></div>
                        <div><img class="inlineimg" src="$stylevar[imgdir_rating]/rating_2.gif" alt="$vbphrase[bad]" /><label for="vote2"><input type="radio" name="vote" id="vote2" value="2" $votechecked[2] />$vbphrase[bad]</label></div>
                        <div><img class="inlineimg" src="$stylevar[imgdir_rating]/rating_1.gif" alt="$vbphrase[terrible]" /><label for="vote1"><input type="radio" name="vote" id="vote1" value="1" $votechecked[1] />$vbphrase[terrible]</label></div>
                        </td>
                </tr>
                <tr id="threadrating_submit">
                        <td class="vbmenu_option" title="nohilite" align="center">
                                <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="submit" class="button" value="$vbphrase[vote_now]" />
                        </td>
                </tr>
                <else />
                <tr>
                        <td class="vbmenu_option" title="nohilite">$vbphrase[already_rated_this_thread]</td>
                </tr>
                </if>
                </table>
        </form>
        </div>
        <!-- / thread rating menu -->

        <script type="text/javascript" src="clientscript/vbulletin_ajax_threadrate.js?v=$vboptions[simpleversion]"></script>
        <script type="text/javascript">
        <!--
        vB_AJAX_ThreadRate_Init('showthread_threadrate_form');
        var threadid = $threadinfo[threadid];
        //-->

        </script>
</if>


[hr]-[/hr]
FIND and DELETE:
HTML Code:

                        <if condition="$show['popups']"><script type="text/javascript"> vbmenu_register("threadrating"); </script></if>

[hr]-[/hr]
FIND:
HTML Code:

<if condition="$show['inlinemod']">
$spacer_close
<form action="inlinemod.php?threadid=$threadinfo[threadid]&amp;p=$postid" method="post" id="inlinemodform">
$spacer_open
</if>

<a name="poststop" id="poststop"></a>

REPLACE with:
HTML Code:

<a name="poststop" id="poststop"></a>

<if condition="!$show['rating'] AND $show['threadrating'] AND $show['ratethread']">
<!-- thread rating menu -->
<form action="threadrate.php?t=$threadid" method="post" id="showthread_threadrate_form">
        <table cellpadding="4" cellspacing="1" width="100%" border="0" class="tborder" align="center">
                <tr>
                        <td style="background:#FFDC84;color:#000;" id="threadrating">
                                <div align="center" id="threadrating_current">
                                        <div align="left"><h3>$vbphrase[rate_this_thread] : <em>$thread[title]</em></h3></div>
                                        <a name="goto_threadrating"></a>
                                        <label for="vote5"><input type="radio" name="vote" id="vote5" value="5" $votechecked[5] />$vbphrase[excellent]</label>
                                        <label for="vote4"><input type="radio" name="vote" id="vote4" value="4" $votechecked[4] />$vbphrase[good]</label>
                                        <label for="vote3"><input type="radio" name="vote" id="vote3" value="3" $votechecked[3] />$vbphrase[average]</label>
                                        <label for="vote2"><input type="radio" name="vote" id="vote2" value="2" $votechecked[2] />$vbphrase[bad]</label>
                                        <label for="vote1"><input type="radio" name="vote" id="vote1" value="1" $votechecked[1] />$vbphrase[terrible]</label>
                                        <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="submit" class="button" value="$vbphrase[vote_now]" />
                                </div>
                        </td>
                </tr>
        </table>
       
        <br />
</form>
<!-- / thread rating menu -->

<script type="text/javascript" src="clientscript/vbulletin_ajax_threadrate.js?v=$vboptions[simpleversion]"></script>
<script type="text/javascript">
        <!--
        vB_AJAX_ThreadRate_Init('showthread_threadrate_form');
        var threadid = $threadinfo[threadid];
        window.alert = null;
        //-->

</script>
</if>

<if condition="$show['inlinemod']">
$spacer_close
<form action="inlinemod.php?threadid=$threadinfo[threadid]&amp;p=$postid" method="post" id="inlinemodform">
$spacer_open
</if>




That should do it. :)

anywares 03-21-2007 06:30 PM

nice thanks. ill definitly use this once my board is back up :)

//Clicks install

Skavenger 03-21-2007 06:35 PM

Quote:

Originally Posted by magnus
Installation is simple. Just replace your current SHOWTHREAD template with the attached file. That's it.

I have made a lot of changes in my SHOWTHREAD template =/
Could you tell us where to add, move, delete, etc the code?

bashy 03-21-2007 06:50 PM

Nice one m8...well done, installed :)

magnus 03-21-2007 06:51 PM

Quote:

Originally Posted by Skavenger (Post 1208983)
I have made a lot of changes in my SHOWTHREAD template =/
Could you tell us where to add, move, delete, etc the code?

Sure. Updated the original post.

SaN-DeeP 03-21-2007 07:44 PM

Thaks a ton magnus :), appreciate your efforts for vb.org community..
Kindly add a small screenshot as well ;)

I will need this for couple of my forum(s).

bashy 03-21-2007 08:18 PM

Its exactly the same as vb.org's thread rate :)

tanyeri24 03-21-2007 09:11 PM

I want rating but getting this error:
You did not select any posts to which the action you picked can be applied.

Ziki 03-21-2007 09:12 PM

Excellent...

magnus 03-21-2007 09:15 PM

Quote:

Originally Posted by tanyeri24 (Post 1209128)
I want rating but getting this error:
You did not select any posts to which the action you picked can be applied.

You'll get that error if you perform the template edits incorrectly. Go back, and perform each edit step-by-step. Optimally, you should just cut and paste the data from the attached .txt file into your SHOWTHREAD template.

tanyeri24 03-21-2007 09:19 PM

Quote:

Originally Posted by magnus (Post 1209137)
You'll get that error if you perform the template edits incorrectly. Go back, and perform each edit step-by-step. Optimally, you should just cut and paste the data from the attached .txt file into your SHOWTHREAD template.

I backup my real showthread template and paste your fully .txt Now it's okay, thank you.

tanyeri24 03-21-2007 09:41 PM

but after rating the sistem says again 'please rate' the rating bar is still showing and no results only in embedded thread is my rating showing..

airborneCAL 03-21-2007 11:00 PM

My rating box is a bit larger than vborg, how can I make it smaller?

magnus 03-21-2007 11:27 PM

Quote:

Originally Posted by airborneCAL (Post 1209217)
My rating box is a bit larger than vborg, how can I make it smaller?

It uses your CSS, so make whatever changes you like there or define new classes.

magnus 03-21-2007 11:27 PM

Quote:

Originally Posted by tanyeri24 (Post 1209161)
but after rating the sistem says again 'please rate' the rating bar is still showing and no results only in embedded thread is my rating showing..

Show me your SHOWTHREAD template HTML, and I'll modify it for you.

airborneCAL 03-21-2007 11:31 PM

Quote:

Originally Posted by tanyeri24 (Post 1209161)
but after rating the sistem says again 'please rate' the rating bar is still showing and no results only in embedded thread is my rating showing..

I am having the exact same problem.

airborneCAL 03-21-2007 11:39 PM

Quote:

Originally Posted by magnus (Post 1209234)
It uses your CSS, so make whatever changes you like there or define new classes.

Where in the CSS? How would I define new classes? Bear with me, I'm learning the coding stuff. Thanks for your patience.

magnus 03-22-2007 01:21 AM

@ airborneCAL and tanyeri24:

In your AdminCP. Go to:

vBulletin Options > Help Thread Display Options (showthread)

Now, enable "Check Thread Rating".

Let me know if that fixes it.

airborneCAL 03-22-2007 01:39 AM

Quote:

Originally Posted by magnus (Post 1209287)
@ airborneCAL and tanyeri24:

In your AdminCP. Go to:

vBulletin Options > Help Thread Display Options (showthread)

Now, enable "Check Thread Rating".

Let me know if that fixes it.

Mine is already enabled.

airborneCAL 03-22-2007 01:43 AM

If it helps any - it appears that when I rate a thread, it works fine and records my rating. However, once I leave the thread and come back to it I still get the box as if I have not rated the thread yet, however it is non functional (I assume because my thread rating has already been recorded).

magnus 03-22-2007 02:46 AM

If you have "Check Thread Rating" enabled, it shouldn't show the rating box anylonger. Are you using my SHOWTHREAD replacement, or did you modify the template yourself?

Kirk Y 03-22-2007 09:25 PM

Nice one Magnus. :up:

KEKforce 03-22-2007 09:28 PM

I also have a problem. When I Vote nothing changes but the vote is stored...
Unlike the the one here on VB where the result is shown..after voting.

use 3.6.5.

tanyeri24 03-22-2007 09:51 PM

Quote:

Originally Posted by magnus (Post 1209235)
Show me your SHOWTHREAD template HTML, and I'll modify it for you.

your .txt
Quote:

Originally Posted by magnus (Post 1209287)
@ airborneCAL and tanyeri24:

In your AdminCP. Go to:

vBulletin Options > Help Thread Display Options (showthread)

Now, enable "Check Thread Rating".

Let me know if that fixes it.

Yes now fixed with this option. Thank you.

KEKforce 03-22-2007 09:53 PM

Quote:

Originally Posted by tanyeri24 (Post 1209932)
your .txt


Yes now fixed with this option. Thank you.

Already tried that.. no go...

Skavenger 03-22-2007 10:20 PM

Quote:

Originally Posted by magnus (Post 1208994)
Sure. Updated the original post.

Thank you :)

tanyeri24 03-22-2007 10:20 PM

Quote:

Originally Posted by KEKforce (Post 1209936)
Already tried that.. no go...

admincp/options.php?do=editsetting&varname=threadvoted

there you have to choose YES, standart is NO.

tanyeri24 03-22-2007 10:22 PM

It would also be glad if vbulletin.org will show us their class data about .new (style of the rating box). In Firefox I can't fix the lines on the borders, it shows like I have <br> in the first line..

airborneCAL 03-23-2007 01:58 AM

Quote:

Originally Posted by tanyeri24 (Post 1209955)
admincp/options.php?do=editsetting&varname=threadvoted

there you have to choose YES, standart is NO.

That didn't work for me.

ngocha85 03-23-2007 09:15 AM

After DELETE, you can:

FIND:

HTML Code:

<if condition="$show['inlinemod']">
$spacer_close
<form action="inlinemod.php?threadid=$threadinfo[threadid]&amp;p=$postid" method="post" id="inlinemodform">
$spacer_open
</if>

<a name="poststop" id="poststop"></a>

REPLACE with:
HTML Code:

<if condition="$show['threadrating']">
<if condition="$show['ratethread']">
<!-- thread rating menu -->


<!---------------------- / UPGRADE------>
<if condition="$show['rating']">
<table cellpadding="4" cellspacing="1" width="100%" border="0" class="tborder" align="center">
                <tr>
                        <td class="thread">
                                <div align="center" id="threadrating_current">
$vbphrase[rating]: <img class="inlineimg" src="$stylevar[imgdir_rating]/rating_$thread[rating].gif" alt="<phrase 1="$thread[votenum]" 2="$thread[voteavg]">$vbphrase[thread_rating_x_votes_y_average]</phrase>" border="0" />
</div>
</td>
</tr>
</table>
<br />
<else />
<!---------------------- / UPGRADE------>


<form action="threadrate.php?t=$threadid" method="post" id="showthread_threadrate_form">
        <table cellpadding="4" cellspacing="1" width="100%" border="0" class="tborder" align="center">
                <tr>
                        <td style="background:#FFDC84;color:#000;" id="threadrating">
                                <div align="center" id="threadrating_current">
                                        <div align="left"><b>$vbphrase[rate_this_thread] : <em>$thread[title]</em></b></div>
                                        <a name="goto_threadrating"></a>
                                        <label for="vote5"><input type="radio" name="vote" id="vote5" value="5" $votechecked[5] />$vbphrase[excellent]</label>
                                        <label for="vote4"><input type="radio" name="vote" id="vote4" value="4" $votechecked[4] />$vbphrase[good]</label>
                                        <label for="vote3"><input type="radio" name="vote" id="vote3" value="3" $votechecked[3] />$vbphrase[average]</label>
                                        <label for="vote2"><input type="radio" name="vote" id="vote2" value="2" $votechecked[2] />$vbphrase[bad]</label>
                                        <label for="vote1"><input type="radio" name="vote" id="vote1" value="1" $votechecked[1] />$vbphrase[terrible]</label>
                                        <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="submit" class="button" value="$vbphrase[vote_now]" />
                                </div>
                        </td>
                </tr>
        </table>
       
        <br />
</form>
</if>
<!-- / thread rating menu -->

<script type="text/javascript" src="clientscript/vbulletin_ajax_threadrate.js?v=$vboptions[simpleversion]"></script>
<script type="text/javascript">
        <!--
        vB_AJAX_ThreadRate_Init('showthread_threadrate_form');
        var threadid = $threadinfo[threadid];
        window.alert = null;
        //-->

</script>
</if>
</if>

<if condition="$show['inlinemod']">
$spacer_close
<form action="inlinemod.php?threadid=$threadinfo[threadid]&amp;p=$postid" method="post" id="inlinemodform">
$spacer_open
</if>


StarBuG 03-23-2007 11:37 AM

Thanks for this

/me clicks install

airborneCAL 03-23-2007 01:53 PM

Quote:

Originally Posted by ngocha85 (Post 1210203)
After DELETE, you can:

FIND:

HTML Code:

<if condition="$show['inlinemod']">
$spacer_close
<form action="inlinemod.php?threadid=$threadinfo[threadid]&amp;p=$postid" method="post" id="inlinemodform">
$spacer_open
</if>

<a name="poststop" id="poststop"></a>

REPLACE with:
HTML Code:

<if condition="$show['threadrating']">
<if condition="$show['ratethread']">
<!-- thread rating menu -->


<!---------------------- / UPGRADE------>
<if condition="$show['rating']">
<table cellpadding="4" cellspacing="1" width="100%" border="0" class="tborder" align="center">
                <tr>
                        <td class="thread">
                                <div align="center" id="threadrating_current">
$vbphrase[rating]: <img class="inlineimg" src="$stylevar[imgdir_rating]/rating_$thread[rating].gif" alt="<phrase 1="$thread[votenum]" 2="$thread[voteavg]">$vbphrase[thread_rating_x_votes_y_average]</phrase>" border="0" />
</div>
</td>
</tr>
</table>
<br />
<else />
<!---------------------- / UPGRADE------>


<form action="threadrate.php?t=$threadid" method="post" id="showthread_threadrate_form">
        <table cellpadding="4" cellspacing="1" width="100%" border="0" class="tborder" align="center">
                <tr>
                        <td style="background:#FFDC84;color:#000;" id="threadrating">
                                <div align="center" id="threadrating_current">
                                        <div align="left"><b>$vbphrase[rate_this_thread] : <em>$thread[title]</em></b></div>
                                        <a name="goto_threadrating"></a>
                                        <label for="vote5"><input type="radio" name="vote" id="vote5" value="5" $votechecked[5] />$vbphrase[excellent]</label>
                                        <label for="vote4"><input type="radio" name="vote" id="vote4" value="4" $votechecked[4] />$vbphrase[good]</label>
                                        <label for="vote3"><input type="radio" name="vote" id="vote3" value="3" $votechecked[3] />$vbphrase[average]</label>
                                        <label for="vote2"><input type="radio" name="vote" id="vote2" value="2" $votechecked[2] />$vbphrase[bad]</label>
                                        <label for="vote1"><input type="radio" name="vote" id="vote1" value="1" $votechecked[1] />$vbphrase[terrible]</label>
                                        <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="submit" class="button" value="$vbphrase[vote_now]" />
                                </div>
                        </td>
                </tr>
        </table>
       
        <br />
</form>
</if>
<!-- / thread rating menu -->

<script type="text/javascript" src="clientscript/vbulletin_ajax_threadrate.js?v=$vboptions[simpleversion]"></script>
<script type="text/javascript">
        <!--
        vB_AJAX_ThreadRate_Init('showthread_threadrate_form');
        var threadid = $threadinfo[threadid];
        window.alert = null;
        //-->

</script>
</if>
</if>

<if condition="$show['inlinemod']">
$spacer_close
<form action="inlinemod.php?threadid=$threadinfo[threadid]&amp;p=$postid" method="post" id="inlinemodform">
$spacer_open
</if>


What does that do?

da420 03-23-2007 03:10 PM

It creates a thread rating system that looks like vbulletin.org's...

airborneCAL 03-23-2007 04:14 PM

Quote:

Originally Posted by da420 (Post 1210423)
It creates a thread rating system that looks like vbulletin.org's...

Thanks, it appears to be working perfectly!

magnus 03-23-2007 05:15 PM

Quote:

Originally Posted by tanyeri24 (Post 1209959)
It would also be glad if vbulletin.org will show us their class data about .new (style of the rating box). In Firefox I can't fix the lines on the borders, it shows like I have <br> in the first line..

Code:

.new{
        background:#FFDC84;
        color:#00000;
}

I included this as style= data, rather than requiring editing the Main CSS.

magnus 03-23-2007 05:20 PM

Quote:

Originally Posted by airborneCAL (Post 1210380)
What does that do?

On threads in which you've already voted on, it will display the rating above the thread.

tanyeri24 03-23-2007 05:31 PM

Quote:

Originally Posted by magnus (Post 1210504)
Code:

.new{
        background:#FFDC84;
        color:#00000;
}

I included this as style= data, rather than requiring editing the Main CSS.

but the are like a <br> in the table of your template edit and here on vbulletin.org not.

magnus 03-23-2007 06:05 PM

Quote:

Originally Posted by tanyeri24 (Post 1210514)
but the are like a <br> in the table of your template edit and here on vbulletin.org not.

It's all CSS. You would need to comb the vBorg CSS and find what margin, padding, et al. is being used.

You can see the entire vBorg CSS here.

hawks_mp 03-23-2007 07:12 PM

How would I fix it if I only wanted to show this thread rating system in 1 forum? I would like to use it in a movie review section, but in the other sections I would like it to be the default rating system.

tanyeri24 03-23-2007 07:34 PM

Quote:

Originally Posted by magnus (Post 1210532)
It's all CSS. You would need to comb the vBorg CSS and find what margin, padding, et al. is being used.

You can see the entire vBorg CSS here.

thx but not easy to find what I have to change..


All times are GMT. The time now is 05:33 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.03309 seconds
  • Memory Usage 1,933KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_code_printable
  • (8)bbcode_html_printable
  • (22)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete