News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

More topic icons

Started by Aimond, September 09, 2022, 11:51:52 AM

Previous topic - Next topic

Aimond

There is any way to add more topic icons like in the image attached.

You cannot view this attachment.

I would like to add some that explain the meaning of the icons, Like topic solved

It doesn't necessarily have to be a mod, I just need a little help how I can add one more icon.

Kindred

I believe that doing so would require code edits in a half-dozen places.
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

@rjen

#2
Just an indication (not a full manual):

Step 1:
Add some new text strings to Modifications.english.php, for example:

$txt['solved_topic'] = 'Solved topic';

Step :2
Place the icons in a folder

Step 3:
Add to the index.css a line for the icon

Below
.main_icons.watch::before {
    background-position: -239px -5px;
}

add
.main_icons.solved::before {
    background: ... link to the icon file...;
}

Step 4:
You would have to add them to this section in MessageIndex.template.php:

function template_topic_legend()
{
    global $context, $settings, $txt, $modSettings;

    echo '
    <div class="tborder" id="topic_icons">
        <div class="information">
            <p id="message_index_jump_to"></p>';

    if (empty($context['no_topic_listing']))
        echo '
            <p class="floatleft">', !empty($modSettings['enableParticipation']) && $context['user']['is_logged'] ? '
                <span class="main_icons profile_sm"></span> ' . $txt['participation_caption'] . '<br>' : '', '
                ' . ($modSettings['pollMode'] == '1' ? '<span class="main_icons poll"></span> ' . $txt['poll'] . '<br>' : '') . '
                <span class="main_icons move"></span> ' . $txt['moved_topic'] . '<br>
            </p>
            <p>
                <span class="main_icons lock"></span> ' . $txt['locked_topic'] . '<br>
                <span class="main_icons sticky"></span> ' . $txt['sticky_topic'] . '<br>
                <span class="main_icons watch"></span> ' . $txt['watching_topic'] . '<br>
            </p>';

add under
                <span class="main_icons watch"></span> ' . $txt['watching_topic'] . '<br>
                <span class="main_icons solved"></span> ' . $txt['solved_topic'] . '<br>
Running SMF 2.1 with latest TinyPortal at www.fjr-club.nl

Aimond

Thank you @rjen, this was all I needed. :D

Advertisement: