MyBB Hacks

Full Version: Thread Rating, Code Tag URLS & MyCode
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3
I think 1master1 asking a mycode smilar to "/me"

@1master1 : Try to look at post#8 of Yumi. The answer located in that post.
(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>

Sorry zinga. I didnt mean your post and i pointed out leefish's post. But i don't know that you had already replied to that post while i'm replying. Its a misunderstanding.
Well, i will try out your's and rateu's suggestions.

At mybb, aries-belgium, is creating a mod "while typing". Lol. i thought what its need would be. But it had proved here that it is worth to have it installed on site. I just tested it yesterday as he offered to some users for beta testing and it worked very well, displaying the number of already posted replies while you are making reply to that post.
Thats what happened here. Sorry once again zinga. I dont know that you already replied to that post, and my replying took some time it got posted under yours and pointed yours.
Thank you zinga, the code worked well.
Thank you RateU, it worked fine.

Last one "Code tag URL's" left.
When you submit a reply, at least via AJAX quick reply, it will show the new replies, although I've said the way MyBB does it is a little retarded.
That's true zinga. That is what happened with me is the same you mentioned in that bug.
I replied and it redirected me to the last post at top of the browser hiding the above replies. So i thought no one will reply at that time and i left off. This is the cause for the problem.
i think, we need to make core edits to change the links in code tag directly to live links?
That's the easiest method, yes.
Code Tag URLS
its weird that second code tag worked fine showing image when i posted just the tag, but the first and after tags are not replacing with images
when we have multiple codes without end tags, the middle tag is appearing fine , the top and bottom tags are not displayed correctly.
and also only with this regex code
\[info\]

If we have this code
\[info\](.*)$
the output is not at all displayed
something is not good. when we use images for the mycode, they arent being displayed and only first instance of code tag is being displayed, if we use multiple code tags

[info]
[infs]

the [info] tag is displaying the text and not images, while the [infs] tag is being ignored and nothing is displayed.
Pages: 1 2 3
Reference URL's