1

Topic: sticky text colour...

hi, in the forums i want to be able to change the colour of the part the says "Sticky:" to red, i managed to find thsi and i duno how to it, 1st post tongue:-

            // We won't display "the dot", but we add the spaces anyway
            if ($pun_config['o_show_dot'] == '1')
                $subject = '  '.$subject;

            if ($cur_topic['sticky'] == '1')
                $subject = $lang_forum['Sticky'].': '.$subject;

            $num_pages_topic = ceil(($cur_topic['num_replies'] + 1) / $cur_user['disp_posts']);

            if ($num_pages_topic > 1)
            {
                $stop = ($num_pages_topic < 3) ? ($num_pages_topic + 1) : 4;

^ i found that in moderate.php

i also found this in viewforum.php:-

// Without "the dot"
    $result = $db->query('SELECT id, poster, subject, posted, last_post, last_post_id, last_poster, num_views, num_replies, closed, sticky, moved_to FROM '.$db->prefix.'topics WHERE forum_id='.$id.' ORDER BY sticky DESC, last_post DESC LIMIT '.$start_from.', '.$disp_topics) or error('Unable to fetch topic list for forum', __FILE__, __LINE__, $db->error());
*removed by Rickard*
^ 1337 php and mySQL sig
Like annoying people with visual basic? http://www.annoyingvb.com <-- the home for virus/spammers/trojans. ect source code!

2

Re: sticky text colour...

It's this line you want
$subject = $lang_forum['Sticky'].': '.$subject;

Change it to this
$subject = '<span class="sticky">'.$lang_forum['Sticky'].': </span>'.$subject;

Now set the colour for sticky in the stylesheets
SPAN.sticky {color: red}

There are other ways but this is the easiest.

3

Re: sticky text colour...

^ this doesnt work sad
ATM i have this in moderate.php :-

            // We won't display "the dot", but we add the spaces anyway
            if ($pun_config['o_show_dot'] == '1')
                $subject = '  '.$subject;

            if ($cur_topic['sticky'] == '1')
                $subject = '<span class="sticky">'.$lang_forum['Sticky'].': </span>'.$subject;

            $num_pages_topic = ceil(($cur_topic['num_replies'] + 1) / $cur_user['disp_posts']);

            if ($num_pages_topic > 1)
            {
                $stop = ($num_pages_topic < 3) ? ($num_pages_topic + 1) : 4;

                $subject_multipage = '[';
                for ($current = 1; $current < $stop; ++$current)
                    $subject_multipage .= ' <a href="viewtopic.php?id='.$cur_topic['id'].'&p='.$current.'">'.$current.'</a>';

                if ($num_pages_topic > 3)
                    $subject_multipage .= ' ... <a href="viewtopic.php?id='.$cur_topic['id'].'&p='.$num_pages_topic.'">'.$num_pages_topic.'</a> ]';
                else
                    $subject_multipage .= ' ]';
            }
            else
                $subject_multipage = null;

and the css style sheet can be found here

*removed by Rickard*
^ 1337 php and mySQL sig
Like annoying people with visual basic? http://www.annoyingvb.com <-- the home for virus/spammers/trojans. ect source code!

4 (edited by Paul 2004-09-14 20:54)

Re: sticky text colour...

For all those who cant be arsed clicking the link, here is my stylesheet:-

EDIT BY PAUL: The stylesheet is not needed to make sense of this thread.

*removed by Rickard*
^ 1337 php and mySQL sig
Like annoying people with visual basic? http://www.annoyingvb.com <-- the home for virus/spammers/trojans. ect source code!

5 (edited by Paul 2004-09-14 18:39)

Re: sticky text colour...

Sorry, I should have made in clear. You need to make the change in viewforum.php. You can also make it in moderate.php if you like.

It does work. I just tried it. Give me a minute to check how I did it.

EDIT: Just checked it again. It works fine. It's line 192 in viewforum.php to save you looking.

6

Re: sticky text colour...

ty soo much big_smile this has come in realy handy! hopefully newbs will now not make useless topics just because they havent read a sticky big_smile ty <3

*removed by Rickard*
^ 1337 php and mySQL sig
Like annoying people with visual basic? http://www.annoyingvb.com <-- the home for virus/spammers/trojans. ect source code!