Changing thead name colours?

Started by Envy, July 31, 2005, 03:20:57 AM

Previous topic - Next topic

Envy

I'm in the process of getting everything set up to change to SMF from phpBB, but wanted to have the same (or similar) theme. I managed to work through all the .css sections and amazed myself at producing a theme almost identical to what I want. I showed it to my forum members, and they have asked for a couple of other changes.

One of them is, on phpBB, when you read a thread, it goes from a white colour to a grey, indicating you have read it. How would I go about doing that to a theme I created? Is it under the .css file? Or somewhere else?

Ivan Minic

Hm.. i used phpbb for like 3 years, even used to know some of the developers.. and i dont quite remember anything similar to this thing you are talking about... Can you explain a bit more what white/gray thing are you talking about.. maybe some screenshot?
I

[Unknown]

Well, you just use a:visited as compared to a:link...

-[Unknown]

Ivan Minic

Oh God... that...
Today is not my day.

Envy

Quote from: [Unknown] on July 31, 2005, 03:42:18 AM
Well, you just use a:visited as compared to a:link...

-[Unknown]

I looked at that, but wasn't sure if that had to do with the forum sections. I want it to only change each thread name. So when you view a thread it changes, but not if you visit a forum section.

Envy

Ok, answered my own question. I changed the a:visited to a different colour, and unfortunately it changes everything you visit. Forum names, thread names, any links etc. phpBB only changes the thread names, which is what I am after.  ::)

Envy

Hmm, ok, had a look at phpBB theme's css file, and it shows that they use different sections. Instead of just a:visited..

/* Forum title: Text and link to the forums used in: index.php */

.forumlink { font-size : 12px; font-weight : bold; text-decoration : none; color : #E3DDFF; }

a.forumlink { text-decoration: none; color : #E3DDFF; }

a.forumlink:hover { text-decoration: underline; color : #E3DDFF; }





/* Used for the navigation text, (Page 1,2,3 etc) and the navigation bar when in a forum */

.nav { font-size : 11px; font-weight : bold; text-decoration : none; color : #E3DDFF;}

a.nav { text-decoration: none; color : #E3DDFF; }

a.nav:hover { text-decoration: underline; }





/* titles for the topics: can specify viewed link colour too */

.topictitle { font-size : 11px; font-weight : bold; text-decoration : none; color : #E3DDFF; }

a.topictitle { text-decoration: none; color : #E3DDFF; }

a.topictitle:hover { text-decoration: underline; color : #E3DDFF; }

a.topictitle:visited { text-decoration: none; color : #9C96B6; }

a.topictitle:visited:hover { text-decoration: underline; }

Envy

I've tried playing around with the SMF css file, but I assume things like a.topictitle don't work for SMF? Does anyone know if there's a way to only change the topic name colour and not the forum names aswell?

xenovanis

Well, it would work, but you'll have to 'tell' the tables in MessageIndex.template.php to use it. It now probably uses class="windowbg" and class="windowbg2".
"Insanity: doing the same thing over and over again and expecting different results."

Envy

Aah, that would explain why the css file wasn't enough...

Haven't really played around with any of the template.php files yet. Would MessageIndex be the only one I would need to tell? Or would I need to also play with index.template or BoardIndex.template as well?

xenovanis

Well, if it's just the threadindex you'll want to change that should be sufficient. Otherwise, you'll have to walk through the BoardIndex.template.php as well to change the threadrelated links (like in the last column and the InfoCenter)
"Insanity: doing the same thing over and over again and expecting different results."

Envy

Aah ok, BoardIndex.template.php should be ok, that works off the standard a.visited etc, and I don't want any of those to change. It's only the thread names I want to change when you visit, some members have a problem with short term memory loss  ;)

Envy

Don't suppose you would know what I am looking for do you? The theme I have doesn't have a copy of MessageIndex.template.php, so I would have to pull one from another theme... Is there a section I can just add in info, or am I looking for something particular. Very very fresh with php language, only just getting my basic html worked out  :-*

xenovanis

This is the part you need:


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

                        // Is this topic new? (assuming they are logged in!)
"Insanity: doing the same thing over and over again and expecting different results."

Envy

Hmm ok, so I'm changing the windowbg part? Do I simply change it to what ever the css file says? ie make it say <td class="topictitle" valign="middle">?

xenovanis

"Insanity: doing the same thing over and over again and expecting different results."

Envy

Changed the background colour. Right column, it's the colour behind the thread names hehe, but didn't change the thread names  :(

http://wdtest.wowmb.net/index.php?board=3.0 if you want to see...

xenovanis

#17
Okay, I've got it. In style.css add this:


.topictitle
{
           font-size : 11px;
           font-weight : bold;
           text-decoration : none;
           color : #E3DDFF;
}

.topictitle a:link
{
            text-decoration: none;
            color : #E3DDFF;
}

.topictitle a:hover
{
           text-decoration: underline;
           color : #E3DDFF;
}

.topictitle a:visited
{
            text-decoration: none;
            color : #9C96B6;
}

.topictitle a:visited:hover
{
            text-decoration: underline;
}


In MessageIndex.template.php find:


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

                        // Is this topic new? (assuming they are logged in!)
                        if ($topic['new'] && $context['user']['is_logged'])
                                echo '
                                                <a href="', $topic['new_href'], '"><img src="', $settings['images_url'], '/', $context['user']['language'], '/new.gif" alt="', $txt[302], '" border="0" /></a>';

                        echo '
                                                <span class="smalltext">', $topic['pages'], '</span>


replace with:


<td class="windowbg" valign="middle"><div class="topictitle">
                                                ', $topic['first_post']['link'];

                        // Is this topic new? (assuming they are logged in!)
                        if ($topic['new'] && $context['user']['is_logged'])
                                echo '
                                                <a href="', $topic['new_href'], '"><img src="', $settings['images_url'], '/', $context['user']['language'], '/new.gif" alt="', $txt[302], '" border="0" /></a>';

                        echo '
                                                <span class="smalltext">', $topic['pages'], '</div></span>
"Insanity: doing the same thing over and over again and expecting different results."

Envy

Added and replaced, no change ><

Does the </div> need to go on the other side of the <span> at the end? Not sure if something like that might effect it.  :-\

xenovanis

"Insanity: doing the same thing over and over again and expecting different results."

Advertisement: