Separate the sticky topics

Started by Costa, January 09, 2012, 01:25:14 PM

Previous topic - Next topic

Costa

Link to the mod

Link to Mod

Author: Costa
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

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 and I will reply as soon as possible.

License
This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License.
Hugo "Costa" Fernandes - PT SMF
Todas as MP's a pedir ajuda são sujeitas a radioactividade, microondas, queimadas e atiradas borda fora.

"At least someone appreciates the fact that I am doing and not thinking..."
"Laziness is counter-revolutionary."

Robert.


Costa

Hugo "Costa" Fernandes - PT SMF
Todas as MP's a pedir ajuda são sujeitas a radioactividade, microondas, queimadas e atiradas borda fora.

"At least someone appreciates the fact that I am doing and not thinking..."
"Laziness is counter-revolutionary."


Eclipse16V

I worked with:
SMF 2 in German

Shop:
SID Giessen

Storman™

Interesting mod - might give it a try, many thanks  ;)

Costa

Hugo "Costa" Fernandes - PT SMF
Todas as MP's a pedir ajuda são sujeitas a radioactividade, microondas, queimadas e atiradas borda fora.

"At least someone appreciates the fact that I am doing and not thinking..."
"Laziness is counter-revolutionary."

live627

Works with both "Started By Column" and "Separate Replies and Views Column" :D

Costa

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
Hugo "Costa" Fernandes - PT SMF
Todas as MP's a pedir ajuda são sujeitas a radioactividade, microondas, queimadas e atiradas borda fora.

"At least someone appreciates the fact that I am doing and not thinking..."
"Laziness is counter-revolutionary."

Robert.

Here is the Dutch translation:

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

:)

Costa

Hugo "Costa" Fernandes - PT SMF
Todas as MP's a pedir ajuda são sujeitas a radioactividade, microondas, queimadas e atiradas borda fora.

"At least someone appreciates the fact that I am doing and not thinking..."
"Laziness is counter-revolutionary."

Michael Pfaff

Love this mod, Costa.

What code would I need to add / change to make "Sticky Topics" and "Normal Topics" to be white text?

Costa

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 :)
Hugo "Costa" Fernandes - PT SMF
Todas as MP's a pedir ajuda são sujeitas a radioactividade, microondas, queimadas e atiradas borda fora.

"At least someone appreciates the fact that I am doing and not thinking..."
"Laziness is counter-revolutionary."


Costa

Hugo "Costa" Fernandes - PT SMF
Todas as MP's a pedir ajuda são sujeitas a radioactividade, microondas, queimadas e atiradas borda fora.

"At least someone appreciates the fact that I am doing and not thinking..."
"Laziness is counter-revolutionary."

MadTogger

Very simple straight forward and excellent MOD, thank you.  :)

MadTogger

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

DBan

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 :)

Jessica.

Testing Zone - SMF 2.0.7, default Curve
School & Chat - phpBB3, over 170 mods installed, official live forum

I use the latest version of Chrome

phpBB: Forum = a section; Board = whole site
SMF: Forum = whole site; Board = a section

live627

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!

DBan

#20
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:

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.

Yudd

#21
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.

Doc.Blade

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

Doc.Blade

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

electricwildflower

Just came across this works fantastic on my forums which is 2.0.5 and works well on the black storm custom theme Cheers :)

Costa

Updated to work with SMF 2.1
Hugo "Costa" Fernandes - PT SMF
Todas as MP's a pedir ajuda são sujeitas a radioactividade, microondas, queimadas e atiradas borda fora.

"At least someone appreciates the fact that I am doing and not thinking..."
"Laziness is counter-revolutionary."

Steve

Didn't you already do this? Or does my 1.0.1 version work for both 2.0.19 and 2.1.2?
DO NOT pm me for support!

Costa

@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.
Hugo "Costa" Fernandes - PT SMF
Todas as MP's a pedir ajuda são sujeitas a radioactividade, microondas, queimadas e atiradas borda fora.

"At least someone appreciates the fact that I am doing and not thinking..."
"Laziness is counter-revolutionary."

Diego Andrés

To fix the markup for SMF 2.1:

MessageIndex.template.php
Code (Search) Select
if ($topic['is_sticky'] && !$stickybar)
{
echo '
<tr class="titlebg">
<td colspan="', empty($options['display_quick_mod']) ? '7' : '8', '">
<hr /><div class="board_icon"></div><div class="info"><strong>', $txt['costa_topico_fixo'], '</strong></div><hr />
</td>
</tr>
';
$stickybar = true;
}
elseif (!$topic['is_sticky'] && $stickybar && !$normalbar)
{
echo '
<tr class="titlebg">
<td colspan="', empty($options['display_quick_mod']) ? '7' : '8', '">
<hr /><div class="board_icon"></div><div class="info"><strong>', $txt['costa_topico_normal'], '</strong></div><hr />
</td>
</tr>
';
$normalbar = true;
}

Code (Replace) Select
if ($topic['is_sticky'] && !$stickybar)
{
echo '
<div class="title_bar">
<h3 class="titlebg">
', $txt['costa_topico_fixo'], '
</h3>
</div>';
$stickybar = true;
}
elseif (!$topic['is_sticky'] && $stickybar && !$normalbar)
{
echo '
<div class="title_bar">
<h3 class="titlebg">
', $txt['costa_topico_normal'], '
</h3>
</div>';
$normalbar = true;
}

Can also use cat_bar instead.
if ($topic['is_sticky'] && !$stickybar)
{
echo '
<div class="cat_bar">
<h3 class="catbg">
', $txt['costa_topico_fixo'], '
</h3>
</div>';
$stickybar = true;
}
elseif (!$topic['is_sticky'] && $stickybar && !$normalbar)
{
echo '
<div class="cat_bar">
<h3 class="catbg">
', $txt['costa_topico_normal'], '
</h3>
</div>';
$normalbar = true;
}

SMF Tricks - Free & Premium Responsive Themes for SMF.

Steve

DO NOT pm me for support!

Advertisement: