Jump to the post that solved this thread.
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Solved: 2 Years, 4 Days, 35 Minutes, 7 Seconds ago change bgcolor / font of sticky threads on forumdisplay
#1
Solved: 2 Years, 4 Days, 35 Minutes, 7 Seconds ago
Hello.

Since there doesn't appear to be a plugin to change the color of the Announcements and the Sticky Threads in the forumdisplay, I decided to use template edits.

I successfully changed the color of the Forum Announcements that appear when you view the forumdisplay (any specific forum's page with thread listing, etc). This was located in Templates > Default > Forum Display > forumdisplays_announcements_announcement.

However, I can not find the location of code (in any template) that references the Sticky Threads, because I'd love to wrap it in <span style="color:green"> or something of that sort. Big Grin

Any help, pretty please?
Reply
#2
Solved: 2 Years, 4 Days, 35 Minutes, 7 Seconds ago
In your global.css file, use this class: forumdisplay_sticky. So for instance, this would make it red with green text:

PHP Code:
.forumdisplay_sticky {
colorgreen;
backgroundred;


For reference, the regular threads are .forumdisplay_regular.

Hope this helps. Smile
Reply
#3
Solved: 2 Years, 4 Days, 35 Minutes, 7 Seconds ago
(11-16-2012, 10:47 AM)Seabody Wrote:  In your global.css file, use this class: forumdisplay_sticky. So for instance, this would make it red with green text:

PHP Code:
.forumdisplay_sticky {
colorgreen;
backgroundred;


For reference, the regular threads are .forumdisplay_regular.

Hope this helps. Smile

Thank you and +1 for the help.

That worked, although I'm puzzled. I have searched through virtually every template and I don't see a class or ID of forumdisplay_sticky being called anywhere?

Btw, your code worked (sort of), it did allow me to change the background color - which was my primary goal. However, it did not (and will not) allow me to change the font color.

This really shouldn't bother me except for my obsessive-compulsive side that won't rest until I have an answer.
Reply
#4
Solved: 2 Years, 4 Days, 35 Minutes, 7 Seconds ago
{$thread_type_class} variable is defined in forumdisplay.php

Code:
    if($thread['sticky'] == 1)
        {
            $thread_type_class = " forumdisplay_sticky";
        }
        else
        {
            $thread_type_class = " forumdisplay_regular";
        }

and if thread is sticky that variable will apply forumdisplay sticky class to sticky thread (forumdisplay_regular if thread is not sticky).
Reply
#5
Solved: 2 Years, 4 Days, 35 Minutes, 7 Seconds ago
Try this for the active links:

Code:
td.forumdisplay_sticky a{
color:orange;
}
Random Fish and Sims Maniac
MY PLUGINS
Help MyBBSupport help you - remember to mark your threads as solved

Reply
#6
Solved: 2 Years, 4 Days, 35 Minutes, 7 Seconds ago
(11-16-2012, 11:53 PM)Johnny S Wrote:  {$thread_type_class} variable is defined in forumdisplay.php

Code:
    if($thread['sticky'] == 1)
        {
            $thread_type_class = " forumdisplay_sticky";
        }
        else
        {
            $thread_type_class = " forumdisplay_regular";
        }

and if thread is sticky that variable will apply forumdisplay sticky class to sticky thread (forumdisplay_regular if thread is not sticky).

Do I smell a free plug-in with a side order of fries? Big Grin

(11-17-2012, 01:07 AM)Leefish Wrote:  Try this for the active links:

Code:
td.forumdisplay_sticky a{
color:orange;
}

I gave it a shot. It's a step in the right direction. However, what I really wanted to achieve was to make the Thread Subject (of Stickies) a chosen color. That changed all text (that were anchors) to that particular color. The issue is asthetic because for instance "Replies" is a link and "View" is not, so one font was orange and the other was black.

Not the approach I was going for, but an interesting idea, nonetheless.
Reply
#7
Solved: 2 Years, 4 Days, 35 Minutes, 7 Seconds ago
You can specify it by giving the thread subject a class as well, either by stepping through the css or cheating and putting a span class on it. Do you have firebug or dragonfly? If you use either of those you can inspect the css and apply the right style.

Something like this would never need to be a plugin in my opinion, you can do it with template edits and css.
Random Fish and Sims Maniac
MY PLUGINS
Help MyBBSupport help you - remember to mark your threads as solved

Reply
#8
Solved: 2 Years, 4 Days, 35 Minutes, 7 Seconds ago
(11-17-2012, 01:52 AM)Leefish Wrote:  You can specify it by giving the thread subject a class as well, either by stepping through the css or cheating and putting a span class on it. Do you have firebug or dragonfly? If you use either of those you can inspect the css and apply the right style.

Something like this would never need to be a plugin in my opinion, you can do it with template edits and css.

I agree. That is the technique that I used for announcement threads. But sticky threads are not differentiated in a template anywhere (that I can find, and I have looked, extensively). In fact, this question "what template do I do this in?" was posed in this thread and a response came that this would have to be done in a php file.

If I can successfully modify a template and its associated CSS please tell me which one and I would blissfully use that technique.

To be clear, what I want to do is:

Customize the Thread Subject (only) of sticky threads, such that on all forum display pages, they appear in a chosen color. (background and font colors)

I achieved this easily for announcements using template edits and css as recommended.
Reply
#9
Solved: 2 Years, 4 Days, 35 Minutes, 7 Seconds ago
Are you using firebug to inspect the page?

A sticky thread is a thread. Wrap the thread subject in a span class and target the span inside the td.forumdisplay_sticky in css.
Random Fish and Sims Maniac
MY PLUGINS
Help MyBBSupport help you - remember to mark your threads as solved

Reply
#10
Solved: 2 Years, 4 Days, 35 Minutes, 7 Seconds ago
(11-17-2012, 11:15 AM)Leefish Wrote:  Are you using firebug to inspect the page?

A sticky thread is a thread. Wrap the thread subject in a span class and target the span inside the td.forumdisplay_sticky in css.

No, I've not heard of firebug or dragonfly, I will look them up as they sound like useful tools. Thank you.

When you say wrap the thread subject in a span class, do you mean on the front end when I post a thread, enable html so I can add the style tag there right in the subject line?

I apologize for my confusion! Confused

Could you post the code you would use? Would I add it around a thread title when posting a thread? Or would I add it around a certain section of code in a particular template? It sounds like what you are suggesting will work, I just can't visualize all the steps...

Toungue
Reply
Jump to the post that solved this thread.


Forum Jump:


Users browsing this thread: 1 Guest(s)