Separating the sticky topics from the normal ones

Started by Alexandre P., September 05, 2004, 06:23:54 PM

Previous topic - Next topic

Kindred

everyone has that file...   it might not be used specifically for your theme, in which case the fil;e in the default theme directory is used.
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

eriktm


geezmo

Help guys, I want to integrate this in my forum but my MessageIndex.template.php looks like this and I don't know how to insert the code. The ones in red are the ones I need to replace, but there are codes in betweena dn I don't know how to insert the new code.

Quote
      // 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)
      {

         // 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'));

         echo '
               <tr>
                  <td class="windowbg2" valign="middle" align="center" width="5%">

Vinspire^

Yeap. I am also having the same situation as geezmo. Anyone here got the answer ?

Vinspire^


Vinspire^

Happy labour day ... had been waiting for an answer for about a week  :'(

TechnoDragon

Don't tell me to get into shape...I have a shape...It is round!


Vinspire^

#87
Quote from: TechnoDragon on May 02, 2006, 12:28:11 AM
do what this post says and it works...it is exactly what i did...

http://www.simplemachines.org/community/index.php?topic=17230.msg135326#msg135326

Yay ... thanks a lot TechnoDragon. I found it and its working well :)

TechnoDragon

Don't tell me to get into shape...I have a shape...It is round!


Vinspire^

I've change the "important topics" to "pinned topic" :P


TechnoDragon

Don't tell me to get into shape...I have a shape...It is round!


L.G.S

Hi,

as you can see here I have used TML's code from page 4 or 5, and I have this:

http://www.tactical-illusion.com/board/index.php?board=7.0

How do I get the box at the end the same colour as the rest?
FREE and LIVE World Cup + Premier League football streams:

www.gamesandgoals.com


Sverre

Quote from: L.G.S on May 12, 2006, 12:55:06 PM
How do I get the box at the end the same colour as the rest?

This happens because you have an extra column in your Message Index. I haven't tested it myself, but if you change TML's code to


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

echo '
</tr>';

        //For the stick/nonstick listings...
        $stickybar = false;
    $normalbar = false;

foreach ($context['topics'] as $topic)
{
            if($topic['is_sticky'] && !$stickybar)
            {
                echo'
                <tr class="windowbg2">
                    <td colspan="', empty($options['display_quick_mod']) ? '8' : '9', '"><b>Important Topics</b></td></tr>';
    $stickybar = true;
            }
            else if(!$topic['is_sticky'] && $stickybar && !$normalbar)
            {
                echo'
                <tr class="windowbg2">
                    <td colspan="', empty($options['display_quick_mod']) ? '8' : '9', '"><b>Normal Topics</b></td></tr>';
                $normalbar = true;
            }

echo '
<tr class="windowbg2">
<td valign="middle" align="center" width="5%">


it should work.

L.G.S

FREE and LIVE World Cup + Premier League football streams:

www.gamesandgoals.com


Sverre

Can you compare the code I posted above with the one you had running before (and now) to make sure that the only changes are colspan 7 to 8 and 8 to 9?

I don't know much about coding, but don't see why that shouldn't work :-\

L.G.S

All I did was find the code from TML and replace it with your one :(
FREE and LIVE World Cup + Premier League football streams:

www.gamesandgoals.com


Burtie

Hi,

Could anyone tell me how to change just the background colour of a sticky topic?

:)

karras.us

Thanks TarantinoArchives & [Unknown], works like a charm.

I had to remove one of the <td colspan="2">, but everythings looks perfect.

Thanks again.  :D

Jmecca2


amirali.b

#99
Quote from: Ben_S on September 05, 2004, 06:37:36 PM
Tips and tricks I beleive.

Well it did, but now the topic is in the bin ???

MessageIndex.template.php

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


Replace With

$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>Important 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;
}


I take no credit for that, just a copy and paste.
thanks ...it works well :)
but how can I bold the Sticky topics and change the background color of them? sorry alot of topics about that but I cant find the correct answer!!

regards.

Advertisement: