How to check and act according to that if there is/are sticky topic(s) in a board?
For example I want to make a picture display above and below the stickies..
So when there is/are sticky topic(s) it will display, when there isnt/arent, it wont.
Please note: I am NOT asking how to seperate stickies/normal posts.
One another question: When adding a button to post template, is there an extra work to highlight it like others? My buttons didnt auto highlight (mouseover)
File: MessageIndex.template.php
Find:
foreach ($context['topics'] as $topic)
{
// Do we want to seperate the sticky and lock status out?
if (!empty($settings['seperate_sticky_lock']) && strpos($topic['class'], 'sticky') !== false)
$topic['class'] = substr($topic['class'], 0, strrpos($topic['class'], '_sticky'));
if (!empty($settings['seperate_sticky_lock']) && strpos($topic['class'], 'locked') !== false)
$topic['class'] = substr($topic['class'], 0, strrpos($topic['class'], '_locked'));
Replace with
$isSticky = false;
foreach ($context['topics'] as $topic)
{
// Do we want to seperate the sticky and lock status out?
if (!empty($settings['seperate_sticky_lock']) && strpos($topic['class'], 'sticky') !== false)
$topic['class'] = substr($topic['class'], 0, strrpos($topic['class'], '_sticky'));
if (!empty($settings['seperate_sticky_lock']) && strpos($topic['class'], 'locked') !== false)
$topic['class'] = substr($topic['class'], 0, strrpos($topic['class'], '_locked'));
if ( !$isSticky && $topic['is_sticky'] )
{
$isSticky = !$isSticky;
echo '
Above Code Here';
}
if ( $isSticky && !$topic['is_sticky'] )
{
$isSticky = !$isSticky;
echo '
Below Code Here';
}
MikeMill, you always do that and give the codes of un-released versions :P
Thanks though, you are still great ;D
Its because of my future seeing abilities :)
Though I think the basic structure is the same