News:

Wondering if this will always be free?  See why free is better.

Main Menu

Separating the sticky topics from the normal ones

Started by Alexandre P., September 05, 2004, 06:23:54 PM

Previous topic - Next topic

Doc.Blade

Hello,

Sorry to dredge up an old post, but i just need a little help :)

I have the latest version of SMF 2.0 running.

I am using the following code for separating the stickies and posts:

Find:

foreach($context['topics'] as $topic)
{


Replace With:

$stickybar = false;
$normalbar = false;
foreach($context['topics'] as $topic)
{
if($topic['is_sticky'] && !$stickybar)
{
echo'<tr class="titlebg"><td colspan="', empty($options['display_quick_mod']) ? '7' : '8', '"><b>Stickies</b></td></tr>';
$stickybar = true;
}
else if(!$topic['is_sticky'] && $stickybar && !$normalbar)
{
echo'<tr class="titlebg"><td colspan="', empty($options['display_quick_mod']) ? '7' : '8', '"><b>Posts</b></td></tr>';
$normalbar = true;
}



This works perfectly on my forums, with one exception.  The bars that separate things on my template are black, and makes the writing invisible.

The writing is definitely on the bar, as i can highlight it with my mouse and see it.

I just need to know what to change so the text can come up in white please?

I appreciate any help anyone can offer.

Thanx

Doc

MrGrumpy

A link would help to see exactly what you mean.
the possession of knowledge is worthless unless imparted upon others
My Custom Themes
2.0 themes only - I don't do 1.1.x

Doc.Blade

Unfortunately it is a private forum, so links wont show you what i am talking about.

So, i took some screen captures.  First one is looking at the forum, second is highlighting the text so you can see it is actually there, just in a black font and pretty well invisible:






I basically need to know what i need to do with the code in my original post to make the text (Stickies and Posts) font to be white.

Thanx in advance for any help anyone can offer.

Doc

MrGrumpy

Look at the titlebg class in index.css, on that class you will have color: #000;color:#000000; or color: black; (it can be done in 3 ways)
Change that color to what you want.
the possession of knowledge is worthless unless imparted upon others
My Custom Themes
2.0 themes only - I don't do 1.1.x

Doc.Blade

unfortunately titlebg comes up 32 times in my index.css file, dont know which one to change.  They are all colored #000

MrGrumpy

can you make a test account so I can access your site and i will able to tell you exactly which to change then you can delete the account after.
the possession of knowledge is worthless unless imparted upon others
My Custom Themes
2.0 themes only - I don't do 1.1.x

Kindred

do note that that CSS also controls the display on a dozen other pages....
Сл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."

MrGrumpy

Yeah I know and I was bearing in mind the possibility of the need to create a new class just for that section of coding if changes would cause problems throughout the theme but didn't want to overload Doc.Blade with too much information or suggestions in 1 go.
the possession of knowledge is worthless unless imparted upon others
My Custom Themes
2.0 themes only - I don't do 1.1.x

Doc.Blade

site is in the initial stages of being built, wanted to see if i can work this out before i go any further, in case i need to change themes or something.

also been far too busy with work to work on the site too much.

just opened what i have setup so far by taking off the .htaccess from the directory.

http://www.docblade.com/Toombul/forum

Cheers for your help.

Doc

MrGrumpy

Looking at your site all the titlebg's have the black text on them so I would actually change them all to white as your titlebg image is black so anywhere titlebg is used the text on it will be black, including titlebg2 and the h3/h4.titlebg's

On another note the text for the titles on the bars for the sticky/normal topics is hard coded into the file rather than using text strings, I would do it this way.

$stickybar = false;
$normalbar = false;
foreach($context['topics'] as $topic)
{
if($topic['is_sticky'] && !$stickybar)
{
echo'<tr class="titlebg"><td colspan="', empty($options['display_quick_mod']) ? '7' : '8', '"><strong>',$txt['Stickied_Topics'],'</strong></td></tr>';
$stickybar = true;
}
else if(!$topic['is_sticky'] && $stickybar && !$normalbar)
{
echo'<tr class="titlebg"><td colspan="', empty($options['display_quick_mod']) ? '7' : '8', '"><strong>',$txt['Normal_Topics'],'</strong></td></tr>';
$normalbar = true;
}


You need to make an edit to index.template.php to implement this.

Find

/* Set the following variable to true if this theme requires the optional theme strings file to be loaded. */
$settings['require_theme_strings'] = false;


Change to

/* Set the following variable to true if this theme requires the optional theme strings file to be loaded. */
$settings['require_theme_strings'] = true;


Then make a new file named ThemeStrings.english.php and upload it to the orange themes languages folder (I would attach the file for you but it won't let me attach here)

The contents of the file should be


<?php
// Version: 2.0; Themes

$txt['Stickied_Topics'] = 'Stickied Topics';
$txt['Normal_Topics'] = 'Normal Topics';
?>




You don't have to do this, you can just stick with the way you have it with the title hardcoded into the file but this way is better practice.
the possession of knowledge is worthless unless imparted upon others
My Custom Themes
2.0 themes only - I don't do 1.1.x

Doc.Blade

brilliant, thank you MrGrumpy!  I left the coding the way i had it, it works for now...lol

Just one more thing, sorry to be a pain.  How would i change the other titles from white to the orange? 

Like on the Index Page:


  • Category titles
  • Info Center title


When you go into a category:


  • the Subject / Started by
  • Replies / Views
  • Last post


and when you go into a topic:


  • the AuthorTopic title



Thank you again for your help so far, and thanx in advance for your help with what will HOPEFULLY be my last questions....lol

Doc

MrGrumpy

Change the white or #ffffff hex colors to the orange color on the catbg css like how you changed the titlebg css
the possession of knowledge is worthless unless imparted upon others
My Custom Themes
2.0 themes only - I don't do 1.1.x

Doc.Blade

Awesome, that got all of them, except for when you go into a category:


  • the Subject / Started by
  • Replies / Views
  • Last post


Do you know which one that will be?

Thank you so much for your help so far, it has been invaluable!

Doc

MrGrumpy

Change the #fff in this code to orange, starts on line 881 in index.css


/* The half-round header bars for some tables. */
.table_grid thead th
{
    height: 28px;
    color: #fff;
    font-family: arial, helvetica, sans-serif;
    font-size: 1.1em;
    font-weight: bold;
    background: url(../images/theme/main_block.png) no-repeat -10px -160px;
}
.table_grid thead th a:link, .table_grid thead th a:visited
{
    color: #fff;
}
the possession of knowledge is worthless unless imparted upon others
My Custom Themes
2.0 themes only - I don't do 1.1.x

Doc.Blade

Perfect, thank you so much for your help MrGrumpy, it is greatly appreciated!

MrGrumpy

the possession of knowledge is worthless unless imparted upon others
My Custom Themes
2.0 themes only - I don't do 1.1.x

MaNaRa

Hi, I'm trying to add this mod in the latest version of smf (2.0), but can not find this code in the Messageindex.template.php
foreach($context['topics'] as $topic)
{


Any help?
mi versión de foro es SMF 2.0

MrGrumpy

The spacing isn't right in that bit of code for the 2.0 file

search for

foreach ($context['topics'] as $topic)
the possession of knowledge is worthless unless imparted upon others
My Custom Themes
2.0 themes only - I don't do 1.1.x

MaNaRa

mi versión de foro es SMF 2.0

Advertisement: