TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
Stats
  • Total Posts: 196,004
  • Total Topics: 21,330
  • Online today: 468
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 119
  • Total: 119

smf 1.1.1 Sticky First Post

Started by tarik004, December 19, 2006, 02:43:54 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

tarik004

First post in sticky topics shows on each page. Also adds separator after sticky topics
Don't forget to back up  !


Open MessageIndex.template.php 
look for  :

// No topics.... just say, "sorry bub".
else
echo '
<td class="catbg3" width="100%" colspan="7"><b>', $txt[151], '</b></td>';

echo '
</tr>';

if (!empty($settings['display_who_viewing']))
{
echo '
<tr class="windowbg2">
<td colspan="' , !empty($options['display_quick_mod']) ? '8' : '7' , '"><small>';
if ($settings['display_who_viewing'] == 1)
echo count($context['view_members']), ' ', count($context['view_members']) == 1 ? $txt['who_member'] : $txt[19];
else
echo empty($context['view_members_list']) ? '0 ' . $txt[19] : implode(', ', $context['view_members_list']) . ((empty($context['view_num_hidden']) or $context['can_moderate_forum']) ? '' : ' (+ ' . $context['view_num_hidden'] . ' ' . $txt['hidden'] . ')');
echo $txt['who_and'], $context['view_num_guests'], ' ', $context['view_num_guests'] == 1 ? $txt['guest'] : $txt['guests'], $txt['who_viewing_board'], '
</small></td>
</tr>';
}

foreach ($context['topics'] as $topic)
{

replace :

}

foreach ($context['topics'] as $topic)
{

with :

}

//For the stick or nonstick listings...
$stickybar = false;
$normalbar = false;
foreach ($context['topics'] as $topic)
{
if($topic['is_sticky'] && !$stickybar)
{
echo'<tr class="titlebg"><td colspan="', empty($options['display_quick_mod']) ? '7' : '8', '"><b>Pinned Topics</b></td></tr>';
$stickybar = true;
}
else if(!$topic['is_sticky'] && $stickybar && !$normalbar)
{
echo'<tr class="titlebg"><td colspan="', empty($options['display_quick_mod']) ? '7' : '8', '"><b>Normal Topics</b></td></tr>';
$normalbar = true;
}

krust

Cool , merci pour ce petit bout de code bien utile

tarik004


This website is proudly hosted on Crocweb Cloud Website Hosting.