Simple Machines Community Forum

SMF Support => SMF 2.0.x Support => Topic started by: syphergaming on July 14, 2010, 05:32:59 AM

Title: colour changing
Post by: syphergaming on July 14, 2010, 05:32:59 AM
I am trying to change the colour where it say shows unread posts since last visit.
i know it in css but when i change it.
it also changes the Started by Simple Machines the topic name and who started >:( it and i dont want that changed
any one know how i could change it  ???

thanks ;)
Title: Re: colour changing
Post by: CapadY on July 14, 2010, 07:06:10 AM
Make a new identifier for it in the css-file and edit the template with the new identifier
Title: Re: colour changing
Post by: ɔɔɔɔɔɔuɥoɾ on July 14, 2010, 10:06:16 PM
Quote from: syphergaming on July 14, 2010, 05:32:59 AM
I am trying to change the colour where it say shows unread posts since last visit.
i know it in css but when i change it.
it also changes the Started by Simple Machines the topic name and who started >:( it and i dont want that changed
any one know how i could change it  ???

thanks ;)

If you only want to change the color for that specific sentence, you would have to ad a new class to index/style.css file and change in (index.template.php) which class is used.


<ul class="reset">
<li class="greeting">', $txt['hello_member_ndt'], ' <span>', $context['user']['name'], '</span></li>
<li><a href="', $scripturl, '?action=unread">', $txt['unread_since_visit'], '</a></li>
<li><a href="', $scripturl, '?action=unreadreplies">', $txt['show_unread_replies'], '</a></li>';

The above code is where that is in index.template.php, play around with it :)


Thats exactly what capady said, but more easily explained lol
Title: Re: colour changing
Post by: syphergaming on July 15, 2010, 05:09:20 AM
kk thanx for that guys
Title: Re: colour changing
Post by: syphergaming on July 17, 2010, 09:37:11 AM
i tryed doing what u said but this keep over riding it
a:link, a:visited
{
color: #a2a2a2;
text-decoration: none;
}


im new to css and php

Title: Re: colour changing
Post by: ɔɔɔɔɔɔuɥoɾ on July 17, 2010, 11:17:15 AM
Quote from: syphergaming on July 17, 2010, 09:37:11 AM
i tryed doing what u said but this keep over riding it
a:link, a:visited
{
color: #a2a2a2;
text-decoration: none;
}


im new to css and php



What you do is add a new class completely, thus not overriding anything.

for example, you want to change only the unred topics text so..


a:link, a:visited
{
   color: #a2a2a2;
   text-decoration: none;
}

Then add another class below that to get



a:link, a:visited
{
   color: #a2a2a2;
   text-decoration: none;
}
.unreadtopics{
   color: your color here;
   text-decoration: none;
}

Then go to the index.template.php file and...

            <ul class="reset">
               <li class="greeting">', $txt['hello_member_ndt'], ' <span>', $context['user']['name'], '</span></li>
               <li><a href="', $scripturl, '?action=unread">', $txt['unread_since_visit'], '</a></li>
               <li><a href="', $scripturl, '?action=unreadreplies">', $txt['show_unread_replies'], '</a></li>';

The bold parts are classes, mess around with that and you will see then, that will change the styles for unread and unread replies.
You would put unreadtopics in place of the current classes above in bold.
Title: Re: colour changing
Post by: syphergaming on July 17, 2010, 12:00:20 PM
arrrrr ok i just changed the reset not the 2nd one that what i was doing wrong :o
i do this right now
Title: Re: colour changing
Post by: ɔɔɔɔɔɔuɥoɾ on July 17, 2010, 12:04:16 PM
Quote from: syphergaming on July 17, 2010, 12:00:20 PM
arrrrr ok i just changed the reset not the 2nd one that what i was doing wrong :o
i do this right now
Make sure you add the class to your CSS file, I don't know which SMF version you have but css/index.css or style.css in the current theme you are using
Title: Re: colour changing
Post by: syphergaming on July 17, 2010, 12:16:02 PM
i did what you said and I'm using smf 2.0RC3

but it still not changing it staying the link color!
and i get little white dots witch u can see in attchment

this is what i did in index.css

/* Normal, standard links. */
a:link, a:visited
{
color: #a2a2a2;
text-decoration: none;
}
.toplinks{
   color: #000000;
   text-decoration: none;
}
a:hover
{
text-decoration: underline;
}


this is what in index.template.php
// If the user is logged in, display stuff like their name, new messages, etc.
if ($context['user']['is_logged'])
{
if (!empty($context['user']['avatar']))
echo '
<p class="avatar">', $context['user']['avatar']['image'], '</p>';
echo '
<ul class="toplinks">
<li class="toplinks">', $txt['hello_member_ndt'], ' <span>', $context['user']['name'], '</span></li>
<li><a href="', $scripturl, '?action=unread">', $txt['unread_since_visit'], '</a></li>
<li><a href="', $scripturl, '?action=unreadreplies">', $txt['show_unread_replies'], '</a></li>';

// Is the forum in maintenance mode?
if ($context['in_maintenance'] && $context['user']['is_admin'])
echo '
<li class="notice">', $txt['maintain_mode_on'], '</li>';

Title: Re: colour changing
Post by: ɔɔɔɔɔɔuɥoɾ on July 17, 2010, 01:02:21 PM
Oh Doh, I see my error, the class closes, it needs to be opened again, let me code it up right now, brb

Just restore the index.template the way it was before for now.

EDIT leave your CSS file the way it is and use this in index.template.php


echo '
<ul class="reset">
<li class="greeting">', $txt['hello_member_ndt'], ' <span>', $context['user']['name'], '</span></li>
<li class="toplinks"><a href="', $scripturl, '?action=unread">', $txt['unread_since_visit'], '</a></li>
<li class="toplinks"><a href="', $scripturl, '?action=unreadreplies">', $txt['show_unread_replies'], '</a></li>';


Put the greeting and reset class back the way they were :)
Title: Re: colour changing
Post by: syphergaming on July 18, 2010, 02:43:12 AM
not working still   :(

index.css
a:link, a:visited
{
color: #a2a2a2;
text-decoration: none;
}
.toplinks {
color: #000000;
text-decoration: none;
}
a:hover
{
text-decoration: underline;
}


index.template.php
<ul class="reset">
<li class="greeting">', $txt['hello_member_ndt'], ' <span>', $context['user']['name'], '</span></li>
<li class="toplinks"><a href="', $scripturl, '?action=unread">', $txt['unread_since_visit'], '</a></li>
<li class="toplinks"><a href="', $scripturl, '?action=unreadreplies">', $txt['show_unread_replies'], '</a></li>';


Title: Re: colour changing
Post by: ɔɔɔɔɔɔuɥoɾ on July 18, 2010, 12:35:36 PM
Quote from: syphergaming on July 18, 2010, 02:43:12 AM
not working still   :(

index.css
a:link, a:visited
{
   color: #a2a2a2;
   text-decoration: none;
}
.toplinks {
   color: YOUR COLOR GOES HERE;
   text-decoration: none;
}
a:hover
{
   text-decoration: underline;
}


index.template.php
            <ul class="reset">
            <li class="greeting">', $txt['hello_member_ndt'], ' <span>', $context['user']['name'], '</span></li>
            <li class="toplinks"><a href="', $scripturl, '?action=unread">', $txt['unread_since_visit'], '</a></li>
            <li class="toplinks"><a href="', $scripturl, '?action=unreadreplies">', $txt['show_unread_replies'], '</a></li>';




Now change the color to whichever color you want, check above :)
Title: Re: colour changing
Post by: syphergaming on July 18, 2010, 11:02:29 PM
i done that all ready i enter in
#000000
witch is black
Title: Re: colour changing
Post by: ɔɔɔɔɔɔuɥoɾ on July 19, 2010, 12:52:15 AM
Quote from: syphergaming on July 18, 2010, 11:02:29 PM
i done that all ready i enter in
#000000
witch is black

Your saying its black that you want and your not getting that?
Title: Re: colour changing
Post by: CapadY on July 19, 2010, 04:32:12 AM
css is cached, so, empty your forum cache before testing this
Title: Re: colour changing
Post by: syphergaming on July 19, 2010, 12:33:55 PM
Quote from: ♪ JohnCcCcCc ♫ on July 19, 2010, 12:52:15 AM
Quote from: syphergaming on July 18, 2010, 11:02:29 PM
i done that all ready i enter in
#000000
witch is black

Your saying its black that you want and your not getting that?

yep that what im saying it not doing it
Title: Re: colour changing
Post by: syphergaming on July 19, 2010, 12:35:14 PM
Quote from: capady on July 19, 2010, 04:32:12 AM
css is cached, so, empty your forum cache before testing this
how do i do that by refreshing the page?
if so i do that all the time
Title: Re: colour changing
Post by: CapadY on July 19, 2010, 12:49:43 PM
Admin - Maintenance - Forum Maintenance - Routine.

Then activate "Empty the file cache" at the bottom end.
Title: Re: colour changing
Post by: ɔɔɔɔɔɔuɥoɾ on July 19, 2010, 01:17:18 PM
I'm pretty sure the CSS is not in the forums cache, possibly your browsers cache though

Could you please post a link and details to a regular members temporary account so we can see?

Also, just to be sure, You are changing the index.css for the theme your currently using right?
Title: Re: colour changing
Post by: syphergaming on July 20, 2010, 11:21:57 AM
that seems like it will change the bacground color not the text color
Title: Re: colour changing
Post by: ɔɔɔɔɔɔuɥoɾ on July 20, 2010, 12:21:01 PM
Quote from: syphergaming on July 20, 2010, 11:21:57 AM
that seems like it will change the bacground color not the text color

Deleted, that post belonged to another topic, sorry lol

That does work, I have tested it on my local hosted smf forum, I noticed you sent me a pm with a regular member login, I will see what I can do then..

EDIT, with the information you have provided, I have tried to change it myself, using web developer addon.

As far as I can see, looking at the source, you have added the class, but not added the edits to index.template.php

Attach both, make sure to attach the ones from the theme you are currently using.

./Themes/{current theme}/css/index.css
./Theme/{current theme}/index.template.php

Also, with your index.css

.toplinks
a:link, a:visited
{
    color: red;
    text-decoration: none;
}
Title: Re: colour changing
Post by: syphergaming on July 20, 2010, 01:16:28 PM
it worked!!!!!!!!! :D :D :D :D :D :D :D :D :D :D :D :D 8) :P
thanx so much!!!!!!!
Title: Re: colour changing
Post by: ɔɔɔɔɔɔuɥoɾ on July 20, 2010, 01:32:37 PM
Your Welcome, Glad you got what you wanted :)

If you decide you want more custom coding, feel free to start a topic in the SMF Coding Discussion board :)