News:

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

Main Menu

Text colour change

Started by Rich_A, October 06, 2006, 02:31:49 PM

Previous topic - Next topic

Rich_A

This is very simple I'm sure but can't seem to find the relevent .php file for it. I want to change the default black text which describe what each of the topic types are i.e. Normal Topic, Hot Topic ect to white.


Oldiesmann

The file you want is Themes/default/MessageIndex.template.php

You can also change it by modifying the color for ".smalltext" in style.css, but this will change everything that uses this CSS class to white, so you may not want to do that.
Michael Eshom
Christian Metal Fans


Rich_A

No I can't find the relevent code for the colour of the text ..

This is what I want to change from black to white.

Topic you have posted in
Normal Topic
Hot Topic (More than 15 Replies)
Very Hot Topic (More than 25 Replies)   
Locked Topic
Sticky Topic
Poll 

Can you give me a clue, I can use search to find specific words no problem?


jacortina

As mentioned, you need to look in MessageIndex.template.php.

Those are output (in default theme) with this code:

if (!$context['no_topic_listing'])
echo '
<td style="padding-top: 2ex;" class="smalltext">', !empty($modSettings['enableParticipation']) ? '
<img src="' . $settings['images_url'] . '/topic/my_normal_post.gif" alt="" align="middle" /> ' . $txt['participation_caption'] . '<br />' : '', '
<img src="' . $settings['images_url'] . '/topic/normal_post.gif" alt="" align="middle" /> ' . $txt[457] . '<br />
<img src="' . $settings['images_url'] . '/topic/hot_post.gif" alt="" align="middle" /> ' . $txt[454] . '<br />
<img src="' . $settings['images_url'] . '/topic/veryhot_post.gif" alt="" align="middle" /> ' . $txt[455] . '
</td>
<td valign="top" style="padding-top: 2ex;" class="smalltext">
<img src="' . $settings['images_url'] . '/icons/quick_lock.gif" alt="" align="middle" /> ' . $txt[456] . '<br />' . ($modSettings['enableStickyTopics'] == '1' ? '
<img src="' . $settings['images_url'] . '/icons/quick_sticky.gif" alt="" align="middle" /> ' . $txt['smf96'] . '<br />' : '') . ($modSettings['pollMode'] == '1' ? '
<img src="' . $settings['images_url'] . '/topic/normal_poll.gif" alt="" align="middle" /> ' . $txt['smf43'] : '') . '
</td>';


As you can see, it's all syled as class="smalltext". But that class is used elsewhere and it DOES NOT have color specified in it. So, you can try to add 'color="white"' right after the class specifier. Or you could make up a class called 'smallwhitetext' in your style.css and include the color specifier in it (along with the other lines from the smalltext entry.

Rich_A

Nice, that's good info - ta.

Rich_A

Yep worked, copied the name 'headertext a:hover' which was in style.css and had color: #ffffff; to MessageIndex.template.php where you said. Thnx again. 8)

Rich_A

Can you tell me which .php to edit to change the User Info & Key Stats text, I mean change what it says?

jacortina

The User Info center in the Header area?

That's provided by the index.template.php, so the most likely place to look for the text strings for it would be the index.english.php in the theme's languages subdir.

If you look in the index.template.php, and find the line:
   // display user name

Some of the text entries ($txt[]) in the following code are:
$txt['hello_member_ndt']
$txt['unread_since_visit']
$txt['show_unread_replies']
$txt[616]

Then look in index.english.php, you'll find values:
$txt['hello_member_ndt'] = 'Hello';
$txt['unread_since_visit'] = 'Show unread posts since last visit.';
$txt['show_unread_replies'] = 'Show new replies to your posts.';
$txt[616] = 'Remember, this forum is in \'Maintenance Mode\'.';

Hope this helps.

Rich_A

#10
Hmm, I searched both those files for User and Stats and it didn't givea sentence saying Use Info and Key Stats. Must be some where else ..

jacortina

Then I don't know what section you're referring to. index.template.php has sections with comments labeling them like:

// this is the upshrink button for the user info section
and
// If the user is logged in, display stuff like their name, new messages, etc.
and
// Show the total time logged in?

Rich_A

#12
No it's the main title for that section ..

I'm using igoh10xa theme so perhaps it's in the theme some where.


jacortina

I downloaded the theme, opened the index.template.php from it, and the first part has:

// The logo and the three info boxes.
echo '
<table align="center" border="0" cellpadding="0" cellspacing="0" width="100%">
<tbody>
<tr><td align="left" width="20" class="titlebg_l" height="25">&nbsp;</td><td colspan="2" align="center" class="titlebg">', $txt['top_info'] ,'<span style="font-size: 1px;">&nbsp;</span>


A quick 'find' yielded $txt['top_info'] as being in Modifications.english.php in that theme's languages directory. Looking at that showed:

$txt['top_info'] = 'User Info &amp; Key Stats';

So, from
   // The logo and the three info boxes.
to
   // Show the menu here, according to the menu sub template.

Is that upper area and any $txt's there are the language strings used.

Rich_A

Haha, you sound like a robot lol. Thankyou.. I take a look at that later. Slowly learning how it works. :)

jacortina

Well, I guess I was trying to convey that there are some standard steps to investigate/attempt when trying to track these things down. You have the bulk of the 'logic' in the Sources directory and the presentation layer in your Themes/<theme> directory (along with its subdirectories; but if your theme doesn't supply a specific xxxxx.template.php file, it will use the one from the default directory).

If you haven't already done it, you might want to set yourself up to mirror your SMF forum on your own PC. There are a couple of choices for local server/MySQL setup (I use XAMPP). But you can dig away at the stuff, trying anything you want, without constantly transferring files (or, worse, 'experimenting' on a functioning forum).

Especially because you're using an alternate theme (and will therefore have to work at applying mods), I think you're going to have to get used to getting 'under the hood'.

Advertisement: