Separating the sticky topics from the normal ones

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

Previous topic - Next topic

Elmacik

Home of Elmacik

shark

Hi guys. Im using SMF 1.1 RC1, not using the default theme.
And i cant find MessageIndex.template.php in my current theme.
What should i do to separate the sticky topics from the normal ones?

TLM

Copy the MessageIndex from the default them, edit, and place in your themes directory...

dcmouser

proud member of donationcoder.com (forum)

houston

Has anybody implememted this into smf 1.1 rc1? I am having trouble understanding what to put in and where.

Thanks


gerrymore

Quote from: houston on October 19, 2005, 09:24:59 PM
Has anybody implememted this into smf 1.1 rc1? I am having trouble understanding what to put in and where.

Thanks

I'm the same. There doesnt seem to be any proper details on how to do this. ie; what to find, what to add/replace. So many people posting different solutions, way too confusing for us php beginers.

This should be in as a standard feature. Turn it on or off in the admin area.
SMF RC1, Tiny Portal 0.75, Coppermine 1.3.3, Flashchat.

Sverre

Quote from: gerrymore on November 09, 2005, 12:16:31 PM
Quote from: houston on October 19, 2005, 09:24:59 PM
Has anybody implememted this into smf 1.1 rc1? I am having trouble understanding what to put in and where.

Thanks

I'm the same. There doesnt seem to be any proper details on how to do this. ie; what to find, what to add/replace. So many people posting different solutions, way too confusing for us php beginers.

This should be in as a standard feature. Turn it on or off in the admin area.

The code posted by [Unknown] on page two of this thread works very well in 1.1 RC1 (if you want a slightly thinner bar, scroll down to post three).

Just add it in MessageIndex.template.php after:

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

gerrymore

OK, Thanks. I managed to get the code you mentioned working. But the titles Impotant and Normal topics weren't there. I tried one of the others which does give the titles. However, we now have thick dark grey lines between all topics (it looks like exrta rows in the table filled with dark grey). How do I get rid of the thick grey parts and make it look as it did before any changes? Have a screenshot but cant post it here.
SMF RC1, Tiny Portal 0.75, Coppermine 1.3.3, Flashchat.

Sverre

If you haven't done any other modifications to MessageIndex.template.php, upload a fresh copy of it and find:


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

echo '
</tr>';

foreach ($context['topics'] as $topic)
{
echo '
<tr class="windowbg2">
<td valign="middle" align="center" width="5%">



Replace with TLM's code:

// No topics.... just say, "sorry bub".
else
echo '
<td width="100%" colspan="7"><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']) ? '7' : '8', '"><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']) ? '7' : '8', '"><b>Normal Topics</b></td></tr>';
                $normalbar = true;
            }

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

gerrymore

Thanks Sverre, you're a star. I dont know what went wrong as my code and yours looked the same. Must have missed something.
SMF RC1, Tiny Portal 0.75, Coppermine 1.3.3, Flashchat.

dairin

Quote from: Xarcell on August 21, 2005, 03:37:26 PM
The script works well, but what if I want a another line above the sticky posts just like the one below.

How can I do that?

Thanx,

-Xarcell, php noob.

any1 know how to solve this part ??
my version is SMF 1.0.5

kuklovod

related to this thread, released a new mod for 1.0.5/1.1RC1, reversible, adds separator after sticky topics and also sticks first post in sticky topics (makes it appear on every page if the stickied topic is multipage, with a separator from the rest of the posts):

http://mods.simplemachines.org/index.php?mod=235

CuTe_MaN

thx for the nice modification

I have applied it and every thing is working very well, I was wondering if it possible to make sticky topics on all pages in the same board and they still be seperated from regullar topics.

thx

Simplemachines Cowboy

#74
Has anyone worked out a way to separate the stickies in RC2?

Other than kuklovod's sticky mod.
I like the new look of RC2 with the identified stickies but I wish the separation and Important topics/normal topics differentiation that the code provided.
My SMF forum: The Open Range

Sol

SM Cowboy, just edit the files like before. Some of the search criteria may have changed slightly but it's still a very usable method.

I have used on the RC2 Default theme a while ago.

trenchteam

Quote from: Sverre on November 09, 2005, 02:34:05 PM
If you haven't done any other modifications to MessageIndex.template.php, upload a fresh copy of it and find:


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

echo '
</tr>';

foreach ($context['topics'] as $topic)
{
echo '
<tr class="windowbg2">
<td valign="middle" align="center" width="5%">



Replace with TLM's code:

// No topics.... just say, "sorry bub".
else
echo '
<td width="100%" colspan="7"><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']) ? '7' : '8', '"><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']) ? '7' : '8', '"><b>Normal Topics</b></td></tr>';
                $normalbar = true;
            }

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


Exactly what I was looking for! Thanks! ;D

cldnails

What trenchteam said, works exactly the way I wanted.  Just required a little tweak for important thread to my personal favorite, sticky's. :) Thanks.
hxxp:blogmadness.net [nonactive]

nasty_b

Is there a way to simply add the text "Sticky:" in front of the subject instead of having each sticky seperated? Thanks.

tedgraves

MessageIndex.template.php

I dont have that file! ant help please!!

Advertisement: