News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Little Topic Solved improvement

Started by NanoSector, May 03, 2012, 06:16:31 PM

Previous topic - Next topic

NanoSector

Hi!

Today (or, a couple of minutes ago) I was browsing a random PHP-related website running SMF.

The site had a pretty useful effect, showing the Solved topics in green.
Here is an example:
http://www.phpfreaks.com/forums/index.php?PHPSESSID=q20eae9kb52qq5n6m49i1t76j6&board=11.0

I thought this could be useful on this site, too, for having an overview of solved topics in the support boards.

What do you guys think?
My Mods / Mod Builder - A tool to easily create mods / Blog
"I've heard from a reliable source that the Answer is 42. But, still no word on what the question is."

French

Agree this is useful Yoshi2889,would like to know how they have done that.

Arantor

Looks like the Topic Solved mod that the SimpleDesk team were working on a long time ago, actually. What it amounts to is a template change to the message index to use a different style in the individual rows when a topic is solved.

Colin

"If everybody is thinking alike, then somebody is not thinking." - Gen. George S. Patton Jr.

Colin

NanoSector

Arantor: Yep, it's actually just like the Locked status, but then a greenie :P
My Mods / Mod Builder - A tool to easily create mods / Blog
"I've heard from a reliable source that the Answer is 42. But, still no word on what the question is."

Arantor

Yes, and there's some CSS injected to handle the custom added style... (I think it was Nas who wrote the SD team one, though I don't think it ever got finished)

NanoSector

Quote from: Arantor on May 03, 2012, 08:33:24 PM
Yes, and there's some CSS injected to handle the custom added style... (I think it was Nas who wrote the SD team one, though I don't think it ever got finished)
That wouldn't be hard to add, would it? I'd say copy the locked status CSS over and change it's color. Maybe it isn't just that simple, I dunno lol.
My Mods / Mod Builder - A tool to easily create mods / Blog
"I've heard from a reliable source that the Answer is 42. But, still no word on what the question is."

Arantor

Uh, no it wouldn't be hard? (I thought you knew how to write mods like this, adding to $context['html_headers'] is trivial...)

NanoSector

Quote from: Arantor on May 03, 2012, 08:40:02 PM
Uh, no it wouldn't be hard? (I thought you knew how to write mods like this, adding to $context['html_headers'] is trivial...)
I know how to write mods, lol, though I epically suck with CSS and positioning and that crap :P
A mod to add such functionality isn't hard, though I have no idea what topic solved mod is used here.
My Mods / Mod Builder - A tool to easily create mods / Blog
"I've heard from a reliable source that the Answer is 42. But, still no word on what the question is."

Arantor

The one here IIRC is a modified version of Sinan's.

NanoSector

Quote from: Arantor on May 03, 2012, 08:53:47 PM
The one here IIRC is a modified version of Sinan's.
Right. Might check for a quick edit for that mod tomorrow/today (it's 3:00 AM here), I'm pretty tired now.
My Mods / Mod Builder - A tool to easily create mods / Blog
"I've heard from a reliable source that the Answer is 42. But, still no word on what the question is."

French

Any progress on how to showing the Solved topics in green Yoshi2889  ;)
Just don´t know how to add this line in Message index.pp

NanoSector

#12
Quote from: French on May 11, 2012, 12:21:28 PM
Any progress on how to showing the Solved topics in green Yoshi2889  ;)
Just don´t know how to add this line in Message index.pp
Woops, totally forgot about this.

I'll check on this later today or tomorrow :)
My Mods / Mod Builder - A tool to easily create mods / Blog
"I've heard from a reliable source that the Answer is 42. But, still no word on what the question is."

French

MessageIndex.template.php
Is it possible to add a line this is an example elseif ($topic['is_solved']) $color_class = 'solvedbg';   The same way as Sticky topics
Just don't know how you determined the color green
            
foreach ($context['topics'] as $topic)
{
// Is this topic pending approval, or does it have any posts pending approval?
if ($context['can_approve_posts'] && $topic['unapproved_posts'])
$color_class = !$topic['approved'] ? 'approvetbg' : 'approvebg';
// We start with locked and sticky topics.
elseif ($topic['is_sticky'] && $topic['is_locked'])
$color_class = 'stickybg locked_sticky';
// Sticky topics should get a different color, too.
elseif ($topic['is_sticky'])
$color_class = 'stickybg';
                     // Locked topics get special treatment as well.
elseif ($topic['is_locked'])
$color_class = 'lockedbg';
// Last, but not least: regular topics.
else
$color_class = 'windowbg';

// Some columns require a different shade of the color class.
$alternate_class = $color_class . '2';

NanoSector

Oh, thanks for looking into this French :)

In index.css define this:
.solvedbg
{
background-color: rgb(205, 233, 199);
}
.solvedbg2
{
background-color: rgb(205, 233, 199);
}


I guess.
My Mods / Mod Builder - A tool to easily create mods / Blog
"I've heard from a reliable source that the Answer is 42. But, still no word on what the question is."

French

changed in index.css /* Color for background of *topics* requiring approval */.approvetbg

/* Sticky topics get a different background */
.stickybg
{
   background: #625349;
}
.stickybg2
{
   background: #625349;
}
/* Solved topics get a different background */
.solvedbg
{
background: #66FF33;
}
.solvedbg2
{
   background: #66FF33;
}


changed in MessageIndex.template.php
foreach ($context['topics'] as $topic)
{
// Is this topic pending approval, or does it have any posts pending approval?
if ($context['can_approve_posts'] && $topic['unapproved_posts'])
$color_class = !$topic['approved'] ? 'approvetbg' : 'approvebg';
// We start with locked and sticky topics.
elseif ($topic['is_sticky'] && $topic['is_locked'])
$color_class = 'stickybg locked_sticky';
// Sticky topics should get a different color, too.
elseif ($topic['is_sticky'])
$color_class = 'stickybg';
                        // Solved topics should get a different color, too.
                        elseif ($topic['is_solved']) $color_class = 'solvedbg';
                     // Locked topics get special treatment as well.
elseif ($topic['is_locked'])
$color_class = 'lockedbg';
// Last, but not least: regular topics.
else
$color_class = 'windowbg';

Unfortunately it does not work  :-[

French

Last adds after getting this information
QuoteYou need to implement the solved background in the following pages
- Themes/default/css/index.css
- Themes/default/MessageIndex.template.php
- Themes/default/Recent.template.php

On an added note, you must give a solved both CSS clasess
class = 'windowbg solvedbg";
Still Do not get it working unfortunately

c9099088


knightofdoom

Nice idea.. Would be good if implemented..  :D
Glory is fleeting, but obscurity is forever.
Web Designer Sri Lanka

Arantor

What would be great is if it could be done without file editing.

It isn't possible in SMF without *serious* work but with some effort in strengthening the plugin system it could be.

* Arantor knows what he's on about and would encourage those interested who know what I do to go check out a certain board on a certain forum where my own inspired-by-SMF variation is in use ;)

Advertisement: