PDA

View Full Version : Mini Mods - vb.org Rating System for vb4


eTiKeT?
01-18-2013, 11:00 PM
Original: http://vbulletin.web.tr/showthread.php/1172-vb4-i%C3%A7in-vb-org-Benzeri-Konu-Reyting-Sistemi

Just replace your current SHOWTHREAD template with . That's it

Find showthread template, and delete

<vb:if condition="$show['threadrating']">
<li class="popupmenu" id="threadrating">
<h6><a class="popupctrl" href="javascript://">{vb:rawphrase rate_this_thread}</a></h6>
<div class="popupbody popuphover">
<form action="threadrate.php" method="post" id='showthread_threadrate_form'>
<ul>
<li id="threadrating_current"<vb:if condition="!$show['rating']">class="hidden"</vb:if> title="{vb:rawphrase thread_rating_x_votes_y_average, {vb:raw thread.votenum}, {vb:raw thread.voteavg}}"><label>
<span class="rating r{vb:raw thread.rating}<vb:if condition="$thread['rating'] != 5">_{vb:stylevar right}</vb:if>">{vb:rawphrase current_rating}</span>
</label></li>
<vb:if condition="$show['ratethread']">
<li><label for="r5"><span class="rating r5">
{vb:stylevar dirmark}<input type="radio" name="vote" value="5" id="r5" {vb:raw votechecked.5} tabindex="20" /> {vb:rawphrase excellent}
</span></label></li>
<li><label for="r4"><span class="rating r4_{vb:stylevar right}">
{vb:stylevar dirmark}<input type="radio" name="vote" value="4" id="r4" {vb:raw votechecked.4} tabindex="21" /> {vb:rawphrase good}
</span></label></li>
<li><label for="r3"><span class="rating r3_{vb:stylevar right}">
{vb:stylevar dirmark}<input type="radio" name="vote" value="3" id="r3" {vb:raw votechecked.3} tabindex="22" /> {vb:rawphrase average}
</span></label></li>
<li><label for="r2"><span class="rating r2_{vb:stylevar right}">
{vb:stylevar dirmark}<input type="radio" name="vote" value="2" id="r2" {vb:raw votechecked.2} tabindex="23" /> {vb:rawphrase bad}
</span></label></li>
<li><label for="r1"><span class="rating r1_{vb:stylevar right}">
{vb:stylevar dirmark}<input type="radio" name="vote" value="1" id="r1" {vb:raw votechecked.1} tabindex="24" /> {vb:rawphrase terrible}
</span></label></li>
<li class="formsubmit"><input type="submit" class="button" value="{vb:rawphrase vote_now}" tabindex="25" /></li>
<vb:else />
<li><label>{vb:rawphrase already_rated_this_thread}</label></li>
</vb:if>
</ul>
<input type="hidden" name="s" value="{vb:raw session.sessionhash}" />
<input type="hidden" name="securitytoken" value="{vb:raw bbuserinfo.securitytoken}" />
<input type="hidden" name="t" value="{vb:raw threadid}" />
<input type="hidden" name="pp" value="{vb:raw perpage}" />
<input type="hidden" name="page" value="{vb:raw pagenumber}" />
</form>
</div>
<script type="text/javascript">
<!--
vB_AJAX_ThreadRate_Init('showthread_threadrate_for m', {vb:raw threadinfo.threadid});
//-->
</script>
</li>
</vb:if>



Find showthread template again


{vb:raw template_hook.showthread_above_posts}
{vb:raw poll}



Add below





<vb:if condition="$show['threadrating'] AND $show['ratethread']">

<div id="eti_konu_rayting_govde" class="eti_konu_rayting_secenek">
<ul>
<li class="popupmenu" id="threadrating">
<h2> {vb:rawphrase rate_this_thread}:<span>{vb:raw threadinfo.title}</span></h2>
<div id="eti_konu_reyting" class="blockrow">
<form action="threadrate.php" method="post" id='showthread_threadrate_form'>
<ul>
<li id="threadrating_current"<vb:if condition="!$show['rating']">class="hidden"</vb:if> title="{vb:rawphrase thread_rating_x_votes_y_average, {vb:raw thread.votenum}, {vb:raw thread.voteavg}}"><label>
<span class="rating r{vb:raw thread.rating}<vb:if condition="$thread['rating'] != 5">_{vb:stylevar right}</vb:if>">{vb:rawphrase current_rating}</span>
</label></li>

<li><label for="r5"><span class="rating r5">
{vb:stylevar dirmark}<input type="radio" name="vote" value="5" id="r5" {vb:raw votechecked.5} tabindex="20" /> {vb:rawphrase excellent}
</span></label></li>
<li><label for="r4"><span class="rating r4_{vb:stylevar right}">
{vb:stylevar dirmark}<input type="radio" name="vote" value="4" id="r4" {vb:raw votechecked.4} tabindex="21" /> {vb:rawphrase good}
</span></label></li>
<li><label for="r3"><span class="rating r3_{vb:stylevar right}">
{vb:stylevar dirmark}<input type="radio" name="vote" value="3" id="r3" {vb:raw votechecked.3} tabindex="22" /> {vb:rawphrase average}
</span></label></li>
<li><label for="r2"><span class="rating r2_{vb:stylevar right}">
{vb:stylevar dirmark}<input type="radio" name="vote" value="2" id="r2" {vb:raw votechecked.2} tabindex="23" /> {vb:rawphrase bad}
</span></label></li>
<li><label for="r1"><span class="rating r1_{vb:stylevar right}">
{vb:stylevar dirmark}<input type="radio" name="vote" value="1" id="r1" {vb:raw votechecked.1} tabindex="24" /> {vb:rawphrase terrible}
</span></label></li>
<li class="formsubmit" style=" margin-left: 80px;"><input type="submit" class="button" value="{vb:rawphrase vote_now}" tabindex="25" /></li>

</ul>
<input type="hidden" name="s" value="{vb:raw session.sessionhash}" />
<input type="hidden" name="securitytoken" value="{vb:raw bbuserinfo.securitytoken}" />
<input type="hidden" name="t" value="{vb:raw threadid}" />
<input type="hidden" name="pp" value="{vb:raw perpage}" />
<input type="hidden" name="page" value="{vb:raw pagenumber}" />
</form>
</div>
<script type="text/javascript">
<!--
vB_AJAX_ThreadRate_Init('showthread_threadrate_for m', {vb:raw threadinfo.threadid});
//-->
</script>
</li>
</ul>
</div>
</vb:if>





additional.css open the template and add the top row



/* vbulletin.web.tr - konu degerlendir alani
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~*/

#eti_konu_rayting_govde {
border: 1px solid #E1D47E;
border-radius: 5px 5px 5px 5px;
clear: both;
margin: 10px auto 0;
padding-bottom: 0;
padding-right: 10px; }


#eti_konu_rayting_govde h2 {
clear: both;
color: #BB0000;
display: inline-block;
font-size: 19.5px;
font-weight: normal; }

#eti_konu_rayting_govde span { color: #3E3E3E;margin-left: 10px;}

.eti_konu_rayting_secenek {
background: url("images/misc/poll_question_mark.png") no-repeat scroll 30px 10px #FFEBBC;
padding-left: 120px; }

#eti_konu_reyting .rating {
background-image: url("images/rating/rating-15_1.png");
background-repeat: no-repeat;
display: block;
padding: 0 0 0 75px; }

#eti_konu_reyting .r1_right {
background-image: url("images/rating/rating-15_1.png");
background-repeat: no-repeat;
margin-bottom: 2px;
padding-left: 80px; }

#eti_konu_reyting .r2_right {
background-image: url("images/rating/rating-15_2.png");
background-repeat: no-repeat;
margin-bottom: 2px;
padding-left: 80px; }

#eti_konu_reyting .r3_right {
background-image: url("images/rating/rating-15_3.png");
background-repeat: no-repeat;
margin-bottom: 2px;
padding-left: 80px; }

#eti_konu_reyting .r4_right {
background-image: url("images/rating/rating-15_4.png");
background-repeat: no-repeat;
margin-bottom: 2px;
padding-left: 80px; }

#eti_konu_reyting .r5 {
background-image: url("images/rating/rating-15_5.png");
background-repeat: no-repeat;
margin-bottom: 2px;
padding-left: 80px; }

/* vbulletin.web.tr - konu degerlendirme alani
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~*/

emresozen
01-19-2013, 10:11 PM
Thanks eTiKeTTrafikci258:up:

Sforums
01-20-2013, 01:20 PM
no such code in 4.1.0

{vb:raw template_hook.showthread_above_posts}
{vb:raw poll}

faisaly.com
01-20-2013, 04:39 PM
vB Version: 4.2.0 this is for bro!

yilmaz
01-22-2013, 02:10 PM
Excellent MOD!

Winter Sonata
01-25-2013, 12:44 AM
What if I don't want to comepletely remove my current SHOWTHREAD template ? I have dome some customization on it, and removing it will cause them to stop working ,, Any ideas ?

nacaruncr
02-11-2013, 06:56 AM
You only need delete the first code in the SHOWTHREAD :) this one:
<vb:if condition="$show['threadrating']">
<li class="popupmenu" id="threadrating">
<h6><a class="popupctrl" href="javascript://">{vb:rawphrase rate_this_thread}</a></h6>
<div class="popupbody popuphover">
<form action="threadrate.php" method="post" id='showthread_threadrate_form'>
<ul>
<li id="threadrating_current"<vb:if condition="!$show['rating']">class="hidden"</vb:if> title="{vb:rawphrase thread_rating_x_votes_y_average, {vb:raw thread.votenum}, {vb:raw thread.voteavg}}"><label>
<span class="rating r{vb:raw thread.rating}<vb:if condition="$thread['rating'] != 5">_{vb:stylevar right}</vb:if>">{vb:rawphrase current_rating}</span>
</label></li>
<vb:if condition="$show['ratethread']">
<li><label for="r5"><span class="rating r5">
{vb:stylevar dirmark}<input type="radio" name="vote" value="5" id="r5" {vb:raw votechecked.5} tabindex="20" /> {vb:rawphrase excellent}
</span></label></li>
<li><label for="r4"><span class="rating r4_{vb:stylevar right}">
{vb:stylevar dirmark}<input type="radio" name="vote" value="4" id="r4" {vb:raw votechecked.4} tabindex="21" /> {vb:rawphrase good}
</span></label></li>
<li><label for="r3"><span class="rating r3_{vb:stylevar right}">
{vb:stylevar dirmark}<input type="radio" name="vote" value="3" id="r3" {vb:raw votechecked.3} tabindex="22" /> {vb:rawphrase average}
</span></label></li>
<li><label for="r2"><span class="rating r2_{vb:stylevar right}">
{vb:stylevar dirmark}<input type="radio" name="vote" value="2" id="r2" {vb:raw votechecked.2} tabindex="23" /> {vb:rawphrase bad}
</span></label></li>
<li><label for="r1"><span class="rating r1_{vb:stylevar right}">
{vb:stylevar dirmark}<input type="radio" name="vote" value="1" id="r1" {vb:raw votechecked.1} tabindex="24" /> {vb:rawphrase terrible}
</span></label></li>
<li class="formsubmit"><input type="submit" class="button" value="{vb:rawphrase vote_now}" tabindex="25" /></li>
<vb:else />
<li><label>{vb:rawphrase already_rated_this_thread}</label></li>
</vb:if>
</ul>
<input type="hidden" name="s" value="{vb:raw session.sessionhash}" />
<input type="hidden" name="securitytoken" value="{vb:raw bbuserinfo.securitytoken}" />
<input type="hidden" name="t" value="{vb:raw threadid}" />
<input type="hidden" name="pp" value="{vb:raw perpage}" />
<input type="hidden" name="page" value="{vb:raw pagenumber}" />
</form>
</div>
<script type="text/javascript">
<!--
vB_AJAX_ThreadRate_Init('showthread_threadrate_for m', {vb:raw threadinfo.threadid});
//-->
</script>
</li>
</vb:if>


Regards ;)

autoescala
02-27-2013, 03:57 PM
Works on 4.2 but I dont like it because every time you load the page again or the thread ask for vote again, once you has voted!!! its not the same as vbulletin.org.

safakuygur
02-28-2013, 07:28 AM
Excellent thanks

http://data-vocabulary.org/rating Sisteminide eklese idiniz keşke

ArcadeSyndicate
08-18-2013, 05:03 PM
on your site it looks even better now, could you share the code with us? :)

http://d.pr/i/8kpq

ArcadeSyndicate
08-29-2014, 04:08 PM
push ;)

zorcocuq
10-12-2014, 09:48 PM
Excellent mod. Thanks eTiKeT!

MarkFL
10-20-2015, 03:42 PM
I have attached an .xml file that uses the template code provided by the developer of this mod, but requires no template edits. I employed a db query to determine if a user has already rated a thread, and if they have, then they are not asked to rate the thread again, only to be told they have already rated the thread and cannot change their vote. :)

Simply download the attached file, and then:

In AdminCP go to Plugins & Products -> Manage Products -> Add/Import Product.

Click on "Choose File" and browse to the product .xml file that you downloaded.

Click "Import"

You MUST set your settings to enable the mod.