MyBB Community Forums

Full Version: Sticky Announcements Divider
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Well I preferer the sticky and announcements with a divider and so I added my own code into mybb's forumdislpay.php file. Not sure if this has been done before or not but figured I would share and maybe someone could complete the modification.

It works like it is supposed to when sticky and/or announcements are used, but also shows the divider when no sticky is present. So if someone could take what I started and finish this modification that would be great.

Find in forumdisplay.php
if($thread['sticky'] == "1") {
			$prefix = $lang->sticky_prefix." ".$typepre;
		
		} else {
			$prefix = $typepre;
		}

and add below
if(!$newrow and $thread['sticky'] == 0 and $newrow = true){ 
        eval("\$sticky_separation = \"".$templates->get("sticky_separation")."\";");
		
      } else { 
		
        $sticky_separation = ''; 
	  
      }

Then create a new skin bit called sticky_separation and add the following. (which mine is messy and could be anyway you want it).

<tr valign="top">
 <td colspan="9" bgcolor="#E7E7E7" style="height: 15px; padding-left: 5px;"><b>Forum Topics</b></td>
</tr>

Then edit .. Forum Display Templates --> forumdisplay_thread in your templates.

add at the top of all the html
$sticky_separation

- - - - - - - - - - - - - - -

If this has already been created can someone point me to it? If not can someone take over what I have done and make it into a real modification and complete it so it doesn't show the divider when no stickies are present.

- - - - - - - - - - - - - - - -

Demo: http://forums.emufanatics.com/forumdisplay.php?fid=10
hmmm if u came close to that PHP code up there...couldn't u just try to see if there is a sticky and if there isn't, load up the settings from before when there wasn't a sticky? like may be this one

if($thread['sticky'] == "0") (LOAD ORIGINAL TEMPLATE/SETTINGS HERE)

sorry for the very rough coding up top...not a wiz at PHP, but i think you will catch my drift.
I like this idea, let us know if you get it to work
Hey thats pretty good, Keith!. Nice work. I may use this on my board!