Thread Rating, Code Tag URLS & MyCode
RateU Offline
Administrator
*******
Posts: 2,350
Joined: Mar 2010
Post: #12
RE: Thread Rating, Code Tag URLS & MyCode
(11-15-2010 04:14 AM)1master1 Wrote:  when guests visit a thread, they can see the thread rating on top of thread and they are able to rate it even though they dont have permissions. So can we make it display just the already rated or non rated star rating images and remove the rating action for guests as like when a user rates a thread and when he hovers over it again, they will see no current action?
When they hover those star rating images they must not have the option of rating.

Try this (you need conditional for this):

forumdisplay_thread_rating template:

Javascript Code
<script type="text/javascript">
<!--
	Rating.build_forumdisplay({$thread['tid']}, { width: '{$thread['width']}', extra_class: '{$not_rated}', current_average: '{$ratingvotesav}' });
// -->
</script>


Wrap the code above with this conditional:

Code:
<if $fpermissions['canratethreads'] != 0 && $mybb->usergroup['canratethreads'] != 0 then>
The code
</if>


showthread_ratethread template:

HTML Code
<li><a class="one_star" title="{$lang->one_star}" href="./ratethread.php?tid={$thread['tid']}&amp;rating=1&amp;my_post_key={$mybb->post_code}">1</a></li>
<li><a class="two_stars" title="{$lang->two_stars}" href="./ratethread.php?tid={$thread['tid']}&amp;rating=2&amp;my_post_key={$mybb->post_code}">2</a></li>
<li><a class="three_stars" title="{$lang->three_stars}" href="./ratethread.php?tid={$thread['tid']}&amp;rating=3&amp;my_post_key={$mybb->post_code}">3</a></li>
<li><a class="four_stars" title="{$lang->four_stars}" href="./ratethread.php?tid={$thread['tid']}&amp;rating=4&amp;my_post_key={$mybb->post_code}">4</a></li>
<li><a class="five_stars" title="{$lang->five_stars}" href="./ratethread.php?tid={$thread['tid']}&amp;rating=5&amp;my_post_key={$mybb->post_code}">5</a></li>

Please remember that there are 6 <li> in this template. You only need to wrap the last 5 <li>.

Wrap the code above with this conditional:

Code:
<if $forumpermissions['canratethreads'] != 0 && $mybb->usergroup['canratethreads'] != 0 then>
The code
</if>


If you want it only for guest, try to use this kinds of conditional for both of the templates:

Code:
<if $mybb->user['uid'] > 0 then>
Code
</if>


(This post was last modified: 11-16-2010 02:04 AM by RateU.)
11-16-2010 02:03 AM
Find all posts by this user Quote this message in a reply

« Next Oldest | Next Newest »

Messages In This Thread
RE: Thread Rating, Code Tag URLS & MyCode - RateU - 11-16-2010 02:03 AM

 Standard Tools
Forum Jump: