Simple Machines Community Forum

Customizing SMF => Modifications and Packages => Topic started by: Costa on January 09, 2012, 01:25:14 PM

Title: Separate the sticky topics
Post by: Costa on January 09, 2012, 01:25:14 PM
Link to the mod (https://custom.simplemachines.org/index.php?mod=3300)

Link to Mod (http://custom.simplemachines.org/mods/index.php?mod=3300)

Author: Costa (http://www.simplemachines.org/community/index.php?action=profile;u=169940)
Type: New Feature
Latest version: 1.0.1
Compatible with: SMF 2.1.x

Screenshot
On the Modification's Page.

Languages available
English (UTF-8 and non UTF-8)
Portuguese PT (UTF-8 and non UTF-8)
Portuguese BR (UTF-8 and non UTF-8)
Dutch (UTF-8 and non UTF-8) - by Doctor Deejay (http://www.simplemachines.org/community/index.php?action=profile;u=241313)

If you want, post your translation and I will add asap.

Support & comments
If you have a problem with this mod, want to comment, or have any question, please post to the modification support topic (http://www.simplemachines.org/community/index.php?topic=) and I will reply as soon as possible.

License
This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License (http://creativecommons.org/licenses/by-nc-nd/3.0/).
Title: Re: Separate the sticky topics
Post by: Robert. on January 09, 2012, 01:37:30 PM
Nice mod :)
Title: Re: Separate the sticky topics
Post by: Costa on January 09, 2012, 01:43:51 PM
Quote from: フリーレンジ on January 09, 2012, 01:37:30 PM
Nice mod :)
Thanks.
Title: Re: Separate the sticky topics
Post by: InfoStrides on January 09, 2012, 04:25:30 PM
Nice mod! Thanks!
Title: Re: Separate the sticky topics
Post by: Eclipse16V on January 12, 2012, 07:02:28 AM
Thanks for this Mod.
Title: Re: Separate the sticky topics
Post by: Storman™ on January 13, 2012, 02:49:24 PM
Interesting mod - might give it a try, many thanks  ;)
Title: Re: Separate the sticky topics
Post by: Costa on January 13, 2012, 07:15:14 PM
@all

Thanks for the kind words.  :)
Title: Re: Separate the sticky topics
Post by: live627 on January 16, 2012, 01:51:40 AM
Works with both "Started By Column" and "Separate Replies and Views Column" :D
Title: Re: Separate the sticky topics
Post by: Costa on January 16, 2012, 01:15:53 PM
Quote from: live627 on January 16, 2012, 01:51:40 AM
Works with both "Started By Column" and "Separate Replies and Views Column" :D
Good to know that :D
Title: Re: Separate the sticky topics
Post by: Robert. on January 16, 2012, 03:22:35 PM
Here is the Dutch translation:

$txt['costa_topico_fixo'] = 'Belangrijke topics';
$txt['costa_topico_normal'] = 'Normale topics';

:)
Title: Re: Separate the sticky topics
Post by: Costa on January 16, 2012, 03:41:03 PM
Thank you, フリーレンジ :)
Title: Re: Separate the sticky topics
Post by: Michael Pfaff on January 17, 2012, 07:51:32 PM
Love this mod, Costa.

What code would I need to add / change to make "Sticky Topics" and "Normal Topics" to be white text?
Title: Re: Separate the sticky topics
Post by: Costa on January 17, 2012, 09:19:22 PM
Quote from: Michael Pfaff on January 17, 2012, 07:51:32 PM
What code would I need to add / change to make "Sticky Topics" and "Normal Topics" to be white text?

After install the mod, search this in ./Themes/Theme Name/MessageIndex.template.php
$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', '">
<strong>', $txt['costa_topico_fixo'], '</strong>
</td>
</tr>
';
$stickybar = true;
}
elseif (!$topic['is_sticky'] && $stickybar && !$normalbar)
{
echo '
<tr class="titlebg">
<td colspan="', empty($options['display_quick_mod']) ? '7' : '8', '">
<strong>', $txt['costa_topico_normal'], '</strong>
</td>
</tr>
';
$normalbar = true;
}


And replace with this.
$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', '">
<strong><span style="color: white;">', $txt['costa_topico_fixo'], '</span></strong>
</td>
</tr>
';
$stickybar = true;
}
elseif (!$topic['is_sticky'] && $stickybar && !$normalbar)
{
echo '
<tr class="titlebg">
<td colspan="', empty($options['display_quick_mod']) ? '7' : '8', '">
<strong><span style="color: white;">', $txt['costa_topico_normal'], </span>'</strong>
</td>
</tr>
';
$normalbar = true;
}


Quote from: Michael Pfaff on January 17, 2012, 07:51:32 PM
Love this mod, Costa.
Thank you :)
Title: Re: Separate the sticky topics
Post by: Michael Pfaff on January 18, 2012, 03:35:07 PM
Worked great! Thanks!
Title: Re: Separate the sticky topics
Post by: Costa on January 19, 2012, 01:15:15 PM
Quote from: Michael Pfaff on January 18, 2012, 03:35:07 PM
Worked great! Thanks!
You're welcome. :)
Title: Re: Separate the sticky topics
Post by: MadTogger on April 11, 2012, 01:25:33 PM
Very simple straight forward and excellent MOD, thank you.  :)
Title: Re: Separate the sticky topics
Post by: MadTogger on April 11, 2012, 02:07:35 PM
Just a quick ask.

Would it be possible to add a 'Locked Topics' heading?

This I think is a little complicated as for instance in my forum I have 'Locked Topics' that are not stickied and some 'Locked Topics' that are stickied.

What I was thinking is that if a topic is:

Sticky - Goes under Sticky Topics heading.
Sticky & Locked - Goes under Sticky Topics heading.
Locked - Goes under Locked Topics heading.
All other topics - Go under the Normal Topics heading.

Regards..,

MT
Title: Re: Separate the sticky topics
Post by: DBan on April 14, 2012, 10:26:24 AM
Hi, I have this in a custom theme, is there any way to edit the bar that shows 'Normal' and 'Sticky' topics?

Thanks in advance :)
Title: Re: Separate the sticky topics
Post by: Jessica. on April 14, 2012, 02:03:27 PM
good mod
Title: Re: Separate the sticky topics
Post by: live627 on April 14, 2012, 06:37:47 PM
Quote from: DBan on April 14, 2012, 10:26:24 AM
Hi, I have this in a custom theme, is there any way to edit the bar that shows 'Normal' and 'Sticky' topics?

Thanks in advance :)
Change what? Text Search for the text in ./Themes/default/languages/Modifications.english.php and change them. The single quotes wrapping thee text must be retained, though!
Title: Re: Separate the sticky topics
Post by: DBan on April 14, 2012, 11:24:48 PM
Quote from: live627 on April 14, 2012, 06:37:47 PM
Quote from: DBan on April 14, 2012, 10:26:24 AM
Hi, I have this in a custom theme, is there any way to edit the bar that shows 'Normal' and 'Sticky' topics?

Thanks in advance :)
Change what? Text Search for the text in ./Themes/default/languages/Modifications.english.php and change them. The single quotes wrapping thee text must be retained, though!

Heres what it shows on my theme:
(http://www1.picturepush.com/photo/a/8037849/640/8037849.png)
I would like to fix the seperator (above the stickied topics and where the stickied topics and normal topics seperate). How would I go about fixing this?

EDIT: Nevermind, I found out how to do it.

Find

$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', '">
<strong>', $txt['costa_topico_fixo'], '</strong>
</td>
</tr>
';
$stickybar = true;
}
elseif (!$topic['is_sticky'] && $stickybar && !$normalbar)
{
echo '
<tr class="titlebg">
<td colspan="', empty($options['display_quick_mod']) ? '7' : '8', '">
<strong>', $txt['costa_topico_normal'], '</strong>
</td>
</tr>
';
$normalbar = true;
}


Replace with

$stickybar = false;
$normalbar = false;
foreach ($context['topics'] as $topic)
{
if ($topic['is_sticky'] && !$stickybar)
{
echo '
<tr class="catbg">
<td colspan="', empty($options['display_quick_mod']) ? '7' : '8', '">
<strong>', $txt['costa_topico_fixo'], '</strong>
</td>
</tr>
';
$stickybar = true;
}
elseif (!$topic['is_sticky'] && $stickybar && !$normalbar)
{
echo '
<tr class="catbg">
<td colspan="', empty($options['display_quick_mod']) ? '7' : '8', '">
<strong>', $txt['costa_topico_normal'], '</strong>
</td>
</tr>
';
$normalbar = true;
}


I changed "titlebg" to "catbg" as my theme has it named differently.
Title: Re: Separate the sticky topics
Post by: Yudd on November 03, 2012, 11:28:22 PM
Hi, I really like this mod and what it can do.

How is it possible to make this mod viewable under a custom theme?

Thanks!

I figured it out! Thanks so much for the awesome mod.
Title: Re: Separate the sticky topics
Post by: Doc.Blade on November 04, 2012, 12:29:09 AM
Hello,

Love this mod, it works fine on my site, but unfortunately, when i try to apply the modification to make the text white, it crashes my board view page.

It only seems to be when the <span style="color: white;">  </span> is added to the file. If i re upload the original file, it works fine. The separation is still there, that is working fine, but my board has a black background, and i cant see the text.

This is the error code i am getting:


Template Parse Error!

There was a problem loading the /Themes/default/MessageIndex.template.php template or language file. Please check the syntax and try again - remember, single quotes (') often have to be escaped with a slash (\). To see more specific error information from PHP, try accessing the file directly.

You may want to try to refresh this page or use the default theme.


syntax error, unexpected '<'


It only displays that for a couple of seconds, then redirects to somewhere i have no idea about.......


I am using the latest version of SMF, and using this theme:

http://custom.simplemachines.org/themes/index.php?lemma=2211


Any help you can offer would be greatly appreciated, as i would like the text for the separator headings to show up in white.

Thank you

Doc
Title: Re: Separate the sticky topics
Post by: Doc.Blade on November 04, 2012, 06:37:04 AM
Well, had a little granny nap, and tried to re tackle the problem......lol

Managed to fix it.

Just in case anyone else has the same trouble, for the particular template i am using, i needed to edit the Themes/Black_20rc3/css/index.css file, and do the following:


Find:


.titlebg, .titlebg2, thead tr.titlebg th, tr.titlebg td, tr.titlebg2 td
{
color: #000;
font-family: arial, helvetica, sans-serif;
font-size: 1.1em;
font-weight: bold;
background: url(../images/theme/main_block.png) no-repeat -10px -120px;
}





Replace with:


.titlebg, .titlebg2, thead tr.titlebg th, tr.titlebg td, tr.titlebg2 td
{
color: #fff;
font-family: arial, helvetica, sans-serif;
font-size: 1.1em;
font-weight: bold;
background: url(../images/theme/main_block.png) no-repeat -10px -120px;
}





Hope this helps someone.

Cheers

Doc
Title: Re: Separate the sticky topics
Post by: electricwildflower on August 15, 2013, 05:04:37 PM
Just came across this works fantastic on my forums which is 2.0.5 and works well on the black storm custom theme Cheers :)
Title: Re: Separate the sticky topics
Post by: Costa on July 27, 2022, 09:16:01 AM
Updated to work with SMF 2.1
Title: Re: Separate the sticky topics
Post by: Steve on July 27, 2022, 11:52:52 AM
Didn't you already do this? Or does my 1.0.1 version work for both 2.0.19 and 2.1.2?
Title: Re: Separate the sticky topics
Post by: Costa on July 28, 2022, 05:32:14 AM
@Steve I don't think I had done that, but I wouldn't be surprised if I had. It's been a rough few weeks at work and I'm a little head over heels. I need a vacation as soon as possible.