Simple Machines Community Forum

Customizing SMF => SMF Coding Discussion => Topic started by: bwceo on January 29, 2019, 10:39:05 AM

Title: Sticky post
Post by: bwceo on January 29, 2019, 10:39:05 AM
Hello guys!

I'm using Zone99 and I have a problem.

I changed some things for Sticky posts. When I go and press on Make this a Sticky post i want the post in the board to change a color (like on the second picture) . IDK how to explain. Look at the pictures

This is  the color rgba(189, 189, 189, 0.2)

Here are the codes
$stickybar = false;
$normalbar = false;
foreach($context['topics'] as $topic)
{
if($topic['is_sticky'] && !$stickybar)
{
echo'<tr class="titlebg" height="20"><td colspan="', empty($options['display_quick_mod']) ? '7' : '8', '">Vazne teme</td></tr>';
$stickybar = true;
}
else if(!$topic['is_sticky'] && $stickybar && !$normalbar)
{
echo'<tr class="titlebg" height="20"><td colspan="', empty($options['display_quick_mod']) ? '7' : '8', '">Obicne teme</td></tr>';
$normalbar = true;
}


Thanks
Title: Re: Sticky post
Post by: Aleksi "Lex" Kilpinen on January 29, 2019, 10:41:52 AM
In most themes, there is already a defined separate css for a sticky, so you should be able to do this a whole lot easier if you took a look at the existing code, and your existing css.
Title: Re: Sticky post
Post by: Gwenwyfar on January 29, 2019, 10:43:33 AM
Quote from: Aleksi "Lex" Kilpinen on January 29, 2019, 10:41:52 AM
In most themes, there is already a defined separate css for a sticky, so you should be able to do this a whole lot easier if you took a look at the existing code, and your existing css.
It's actually curious that many themes seem to completely forget about it. And the locked topic background. But the class and default code for it should still be there for most of them, either way. You just have to change the colors in the css.
Title: Re: Sticky post
Post by: Aleksi "Lex" Kilpinen on January 29, 2019, 10:44:49 AM
I've noticed - and fixed many of those for my own forum. It's irritating that theme authors just "forget" about them.
Title: Re: Sticky post
Post by: Kindred on January 29, 2019, 10:53:08 AM
That theme appears to have hard-coded text as well.... naughty author.
Title: Re: Sticky post
Post by: SychO on January 29, 2019, 10:54:49 AM
Quote from: Aleksi "Lex" Kilpinen on January 29, 2019, 10:44:49 AM
I've noticed - and fixed many of those for my own forum. It's irritating that theme authors just "forget" about them.

that's due to lack of testing, the software is full of options and settings, one has to try everything to make sure all is good however I've noticed that most themes only customize the obvious and general parts and leave the details untouched.
Title: Re: Sticky post
Post by: Aleksi "Lex" Kilpinen on January 29, 2019, 11:05:44 AM
Oh, now that I remembered where that name was so familiar from - I'm fairly sure that theme is not available anymore, and hasn't been in ages. I hope you bought it legit when it was...
Title: Re: Sticky post
Post by: bwceo on January 29, 2019, 11:17:56 AM
Quote from: Aleksi "Lex" Kilpinen on January 29, 2019, 10:41:52 AM
In most themes, there is already a defined separate css for a sticky, so you should be able to do this a whole lot easier if you took a look at the existing code, and your existing css.

Well, I went to the CSS file, found the sticky class, changed the color but its not working :(

/* Sticky topics get a different background */
.stickybg
{
background: rgba(189, 189, 189, 0.2);
}
.stickybg2
{
background: rgba(189, 189, 189, 0.2);
}
Title: Re: Sticky post
Post by: SychO on January 29, 2019, 11:18:43 AM
you have to hard refresh your page to clear the browser cache (CTRL+F5)
Title: Re: Sticky post
Post by: bwceo on January 29, 2019, 11:21:18 AM
Quote from: SychO on January 29, 2019, 11:18:43 AM
you have to hard refresh your page to clear the browser cache (CTRL+F5)

Yep. Still not working :3
Title: Re: Sticky post
Post by: Mick. on January 29, 2019, 11:23:22 AM
Quote from: Petrov2g on January 29, 2019, 11:21:18 AM
Quote from: SychO on January 29, 2019, 11:18:43 AM
you have to hard refresh your page to clear the browser cache (CTRL+F5)

Yep. Still not working :3
You need to clear your browser cookies if F5 doesnt work.
Title: Re: Sticky post
Post by: bwceo on January 29, 2019, 11:25:45 AM
Quote from: Mick. on January 29, 2019, 11:23:22 AM
Quote from: Petrov2g on January 29, 2019, 11:21:18 AM
Quote from: SychO on January 29, 2019, 11:18:43 AM
you have to hard refresh your page to clear the browser cache (CTRL+F5)

Yep. Still not working :3
You need to clear your browser cookies if F5 doesnt work.

Already tried, incognito and on my other laptop,   :(
Title: Re: Sticky post
Post by: Gwenwyfar on January 29, 2019, 11:30:52 AM
The theme might be overriding these colors somewhere else. Try adding an !important before the semicolon. If that still doesn't work it is likely something else that it has changed, you'll need to find out what.
Title: Re: Sticky post
Post by: Mick. on January 29, 2019, 11:31:25 AM
On IE, use F5. On iMac, use Command + R. In Chrome, under more tools, use Clear browsing data. If that doesnt work, there may be a chance you made the edit in the wrong css.file
Title: Re: Sticky post
Post by: Mick. on January 29, 2019, 11:33:17 AM
Yup, like this.... background: rgba(189, 189, 189, 0.2) !important;
Title: Re: Sticky post
Post by: Aleksi "Lex" Kilpinen on January 29, 2019, 11:36:07 AM
Just a quick FYI, as this is a Dziner Studio premium theme - I will no longer provide support on issues related to the theme, unless the OP can show me they obtained it legally from Dziner Studio.
Title: Re: Sticky post
Post by: Arantor on January 29, 2019, 11:37:34 AM
Which would be unlikely as DS closed some time ago.
Title: Re: Sticky post
Post by: Aleksi "Lex" Kilpinen on January 29, 2019, 11:38:14 AM
Quote from: Arantor on January 29, 2019, 11:37:34 AM
Which would be unlikely as DS closed some time ago.
Exactly.