News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

A two part question

Started by crexor, August 30, 2004, 03:58:03 PM

Previous topic - Next topic

crexor

I looked over the boards with a cursory glance, and coulnt gleem any information to help me answer my question. My problem is that i want to be able to bold topics, and possible italicize them, etc, apply some simply text formatting to them, I coulnt find this in any built-in functionality of SMF, and was wondering if there is a mod of some-sort to allow it. The second part is, that if there is, if it contains a way to make it only available to moderators, and admins, so everyone cant go willy-nilly bolding their topics. Thank you.

[Unknown]

I like bolding text on occasion, but sometimes I think italics looks nicer.  Then again, I can be a sucker for underline - but that's just me.

Click quote on my message to see what I typed - I used what's called BBC or "bulletin board code".  More information can be found here:
http://www.simplemachines.org/community/index.php?action=help

But.... I'm sure you probably know this ;) - just not totally sure.  If you're talking about topic subjects... currently, there is no way, but it's pretty easy (just a few places...) to make it do it....

Making it admin-only would not be simple, though, although it would be possible.

-[Unknown]

crexor

alright, well, yea, I definitely totally understand BBC, yea, my question was about the topic subjects, just to have a few sticky threads, and to also bold them, just to make them clear to users, like a sticky rules thread of some sort, where the topic could be bolded, in your reply you said "there is no way" im assuming with an unmodded SMF board, but would you be willing to help me in modding my board to allow for bolded topics, the admin-only functionality can wait, if it is that complicated. TIA

Amacythe

I like the idea of bold topics on sticky threads.  Is there a way to just make all sticky threads default to bold?

[Unknown]

Quote from: Amacythe on August 31, 2004, 12:53:41 AM
I like the idea of bold topics on sticky threads.  Is there a way to just make all sticky threads default to bold?

Find, MessageIndex template:
<td class="windowbg" valign="middle">
', $topic['first_post']['link'];


Replace:
<td class="windowbg" valign="middle">';

if ($topic['is_sticky'])
echo '
<b>', $topic['first_post']['link'], '</b>';
else
echo '
', $topic['first_post']['link'];


-[Unknown]

Amacythe


crexor

beautiful, exactly what i was looking for, thanks :)

3fifty

Im in:
forum/Themes/default/MessageIndex.php

      <td class="windowbg" valign="middle" width="42%">

         ' . $topic['first_post']['link'] . ' ' . ($topic['new'] && $context['user']['is_logged'] ? '<a href="' . $scripturl . '?topic=' . $topic['id'] . '/from' . $topic['newtime'] . '#new"><img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/new.gif" alt="' . $txt[302] . '" border="0" /></a>' : '') . ' <span class="smalltext">' . $topic['pages'] . '</span></td>

Is that what I replace with:

<td class="windowbg" valign="middle">';

      if ($topic['is_sticky'])
         echo '
                  <b>', $topic['first_post']['link'], '</b>';
      else
         echo '
                  ', $topic['first_post']['link'];

[Unknown]

You're using an older template.

Replace this part of that:
$topic['first_post']['link'] . ' '

With:

$topic['first_post']['link'];

echo ' '


And then what I quoted should apply, roughly.

-[Unknown]

3fifty

Thanks for the quick reply and always having patience with ignorant people with me.  :)  I dont think I comprehended it though, as I couldnt get it to work.  Thanks for trying anyways.

3fifty

Like this?


<td class="windowbg" valign="middle" width="42%">

' . $topic['first_post']['link'];
                                echo ' '
if ($topic['is_sticky'])
echo '
<b>', $topic['first_post']['link'], '</b>';
else
echo '', $topic['first_post']['link'];
                                            . ($topic['new'] && $context['user']['is_logged'] ? '<a href="' . $scripturl . '?topic=' . $topic['id'] . '/from' . $topic['newtime'] . '#new"><img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/new.gif" alt="' . $txt[302] . '" border="0" /></a>' : '') . ' <span class="smalltext">' . $topic['pages'] . '</span></td>

[Unknown]

Oops, sorry, in this case just remove that part entirely.  Like this:


<td class="windowbg" valign="middle" width="42%">';

if ($topic['is_sticky'])
echo '
<b>', $topic['first_post']['link'], '</b>';
else
echo '', $topic['first_post']['link'];

echo ($topic['new'] && $context['user']['is_logged'] ? '<a href="' . $scripturl . '?topic=' . $topic['id'] . '/from' . $topic['newtime'] . '#new"><img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/new.gif" alt="' . $txt[302] . '" border="0" /></a>' : '') . ' <span class="smalltext">' . $topic['pages'] . '</span></td>


-[Unknown]

3fifty

Works now!  Thanks again for your help.

Advertisement: