Right now the only way to tell the difference between the stuck topics and the regular ones is to look at the little icon beside topic, and IMO, that little graphic isn't THAT telling, so it doesn't really let you know that those items are sticky topics.
Anyway, what I'm asking is, is there a way to make the sticky topics appear in bold text, just to seperate them from the regular topics?
Themes/yourtheme/MessageIndex.template.php:
Find:
', $topic['first_post']['link'];
Replace:
<span', $topic['is_sticky'] ? ' style="font-weight: bold;"' : '', '>', $topic['first_post']['link'], '</span>';
-[Unknown]
Awesome stuff.
Thanks again
while we are on this??
what would be the modification to also make locked topics say.... in italics...
and also would that then mean that a locked sticky topic would be bold and in italics??
Perfect!
Thx [Unknown]
Quote from: LostProphecy on October 08, 2004, 05:47:55 AM
while we are on this??
what would be the modification to also make locked topics say.... in italics...
and also would that then mean that a locked sticky topic would be bold and in italics??
You could do that... just use 'is_locked'.
-[Unknown]
sooo... if i put this would it be right?
<span', $topic['is_sticky'] ? ' style="font-weight: bold;"' : '', $topic['is_locked'] ? ' style="font-weight: italics;"' : '', '>', $topic['first_post']['link'], '</span>';
<span style="', $topic['is_sticky'] ? 'font-weight: bold;' : '', $topic['is_locked'] ? 'font-weight: italics;' : '', '">', $topic['first_post']['link'], '</span>';
Try that.
italic isn't working for my locked sticky topic for some reason.
Quote from: [Unknown] on October 10, 2004, 04:47:27 PM
<span style="', $topic['is_sticky'] ? 'font-weight: bold;' : '', $topic['is_locked'] ? 'font-weight: italics;' : '', '">', $topic['first_post']['link'], '</span>';
Try that.
Wait a minute there. Font weight... italics? I just cleaned it up. Let's try this:
<span style="', $topic['is_sticky'] ? 'font-weight: bold;' : '', $topic['is_locked'] ? 'font-style: italic;' : '', '">', $topic['first_post']['link'], '</span>';
How about that?
-[Unknown]
works great! thank you
Wich file would be edited then? The bold sticky did work quite well here, but locked topic isn't quite clear to me.
Any directions for a n00bie on SMF 1.0 RC1 ?
Thanks in advance
Quote from: Lum-chan on October 26, 2004, 02:43:15 PM
Wich file would be edited then? The bold sticky did work quite well here, but locked topic isn't quite clear to me.
Any directions for a n00bie on SMF 1.0 RC1?
Same file, the MessageIndex template.
-[Unknown]
@[Unknown]: Thanks you very much. It works now (https://www.simplemachines.org/community/Themes/default/images/post/thumbup.gif)
This is gr8 :D thanks onknown. my members just pointed out having a problem telling the difference between lock/pinned topics. Thank you :)
Woudl this be right to add "Sticky:" in front of all Sticky topics?:
<span', $topic['is_sticky'] ? ' style="font-weight: bold;"' : '', '>Sticky:', $topic['first_post']['link'], '</span>';
Quote from: Waste on October 28, 2004, 11:45:30 PM
Would this be right to add "Sticky:" in front of all Sticky topics?:
Not quite...
<span', $topic['is_sticky'] ? ' style="font-weight: bold;">Sticky: ' : '>', $topic['first_post']['link'], '</span>';
Should do it.
-[Unknown]
As always, thanks for the help [Unknown].
i've been trying to add text string $txt['modlog_ac_stickied'] but with no luck, it's just too confusing :(
this is what i have for the sticky topic:
<span style="', $topic['is_sticky'] ? 'font-weight: bold;' : '', $topic['is_locked'] ? 'font-style: italic;' : '', '">', '<span title="', $topic['first_post']['preview'], '">', $topic['first_post']['link'], '</span>', '</span>';
please help, thanks
Well, modlog_ac_stickied is only defined in the admin center and mod log, etc. It's not defined when viewing a topic, because it's not needed.
-[Unknown]
okay, I know you've been waiting for this combination ;-)
If you want:
- sticky to be bold preceded by string "Sticky: "
- locked to be in italics, preceeded by string "Locked: "
and you want this to work for locked
and sticky topics then my solution is nesting <span> statements but that's ugly, i.e.
find
', $topic['first_post']['link'];
and replace with (for redability i broke the lines)
<span style="
', $topic['is_sticky'] ? 'font-weight: bold;">Sticky: ' : '">', '
<span style="
', $topic['is_locked'] ? 'font-style: italic;">Locked: ' : '">' ,'
', $topic['first_post']['link'], '
</span>
</span>';
can someone make this elegant?
btw, if I were to want to want the test
after the topic name I will have to either have two "
', $topic['first_post']['link'], ' or another set of if-then (
', $topic['is_sticky'] ? and so on ).
thanks,
Mischa
<span style="', $topic['is_sticky'] ? 'font-weight: bold;' : '', $topic['is_locked'] ? 'font-style: italic;' : '', '">
', $topic['is_sticky'] ? 'Sticky: ' : ($topic['is_locked'] ? 'Locked' : ''), ' ', $topic['first_post']['link'], '
</span>';
Perhaps? This is slightly different - a locked sticky will only show "Sticky:", but will be bold and italic.
-[Unknown]
hm, interesting idea.
though performance is of no real importance for me I wonder whether testing for property of topic four times (instead of twice) will have any impact. In my solution I was trying to get away with only one test per property.
I honestly don't know whether it has any impact on a "huge board". (Are such queries cached?) If it does I'd rather go with the nested <span>.
thanks,
mischa
Well, it's just a variable. It wouldn't hardly have that much impact, if you wanted it to be as fast as possible, you'd use an if structure instead of several nested ternaries.
But, once it's compiled it wouldn't matter anyway, so if you have a PHP accelerator/optimizer/cache... it won't really matter, no. Nor would it depend on the size of the forum, because it would only do it once per every *displayed* topic anyway; which is going to be 20 on large forums and 20 on itty-bitty ones.
-[Unknown]
Quote from: [Unknown] on September 29, 2004, 06:08:28 PM
Themes/yourtheme/MessageIndex.template.php:
Find:
', $topic['first_post']['link'];
Replace:
<span', $topic['is_sticky'] ? ' style="font-weight: bold;"' : '', '>', $topic['first_post']['link'], '</span>';
-[Unknown]
When we tried to go on the forums we got a parse error.
Does anyone know how to solve this problem?
Peace out, Andy.
Hi there, dunno how todo this now im on SMF 1.1 beta 3 and the source code has changed.
Anyone help please.
I recently upgraded to 1.1.2 and this doesn't work, giving me parse error. Any update on this would be greatly appreciated. Mainly, bold for stickied topics and italic for locked topics.
Thanks in advance.
In reference to the above question, the code may be a bit dis-similar but you should be able to find what you are looking for if you follow the general idea of what is being done.
Yes, thank you. I've figured out the code a few minutes after my last post :). Otherwise I wouldn't have stopped posting :D. Thanks anyway.
I'm actually surprised no one has made a topic multi moderation mod like IPB has.
Quote from: Assistance on June 19, 2007, 07:54:31 AM
I'm actually surprised no one has made a topic multi moderation mod like IPB has.
Not exactly sure how this has to do with this topic? But I wrote a mod for topic multi-moderation awhile ago but just haven't gotten it released. I guess it needs to be polished a little more but then I can release a beta version for testing.
in SMF 1.1.2 i cant find that code in message index template!
hi
I dont have ', $topic['first_post']['link']; in this page ! what can I do that?
I can seperate the sticky topics bot I cant bold them.
Bump please
"You'll work it out" doesnt really suffice for the braindead among us.
Theres more than one instance of similar "Search for this bit" terms.
The edits below are updated for SMF 1.1.6 and above. :)
For the default theme '/Themes/default/MessageIndex.template.php':
Find this code:
echo '
', $topic['is_sticky'] ? '<b>' : '' , '<span id="msg_' . $topic['first_post']['id'] . '">', $topic['first_post']['link'], '</span>', $topic['is_sticky'] ? '</b>' : '';
Replace with this code:
echo '
', $topic['is_locked'] ? '<i>' : '', $topic['is_sticky'] ? '<b>' : '' , '<span id="msg_' . $topic['first_post']['id'] . '">', $topic['first_post']['link'], '</span>', $topic['is_sticky'] ? '</b>' : '', $topic['is_locked'] ? '</i>' : '';
For custom themes '/Themes/default/MessageIndex.template.php':
Find this code:
', $topic['first_post']['link'], '
Replace with this code:
', $topic['is_locked'] ? '<i>' : '', $topic['is_sticky'] ? '<b>' : '' , $topic['first_post']['link'], $topic['is_sticky'] ? '</b>' : '', $topic['is_locked'] ? '</i>' : '