Simple Machines Community Forum

Customizing SMF => Modifications and Packages => Topic started by: Diego Andrés on July 09, 2022, 08:21:40 PM

Title: Topic Solved
Post by: Diego Andrés on July 09, 2022, 08:21:40 PM
Link to the mod (https://custom.simplemachines.org/index.php?mod=4339)

(https://smftricks.com/logos/logo.png) (https://smftricks.com/)

(https://img.shields.io/badge/License-MIT-248049) (https://img.shields.io/badge/Hooks%20Only-Yes-6041a3) (https://img.shields.io/badge/SMF-2.1-3f73a0)

Topic Solved
Developed by Diego Andrés (https://smftricks.com/index.php?action=profile;u=1)



Introduction
Topic Solved mod provides a very basic functionality to mark topics as solved.

Features

Localization
(https://www.simplemachines.org/site_images/lang/english.gif) English
(https://www.simplemachines.org/site_images/lang/russian.gif) Russian by Bugo (https://www.simplemachines.org/community/index.php?action=profile;u=229017)
(https://www.simplemachines.org/site_images/lang/italian.gif) Italian by ParmaU (https://github.com/ParmaU)
(https://www.simplemachines.org/site_images/lang/romanian.gif) Romanian by Aimond (https://www.simplemachines.org/community/index.php?action=profile;u=654752)


Changelog (https://github.com/SMFTricks/Topic-Solved/blob/main/CHANGELOG.md)
GitHub (https://github.com/SMFTricks/Topic-Solved)
Title: Re: Basic Topic Solved
Post by: Steve on July 10, 2022, 09:03:18 AM
During uninstall, the hook isn't removed. Is that common?
Title: Re: Basic Topic Solved
Post by: Diego Andrés on July 10, 2022, 12:52:09 PM
Seems there's a typo, I wrote remove instead of reverse when uninstalling.
Title: Re: Basic Topic Solved
Post by: Steve on July 10, 2022, 01:23:06 PM
So the mod has been updated?
Title: Re: Basic Topic Solved
Post by: Diego Andrés on July 10, 2022, 01:45:06 PM
Nope, I'll be back tomorrow  :P
Title: Re: Basic Topic Solved
Post by: Steve on July 10, 2022, 01:45:59 PM
Roger that.
Title: Re: Basic Topic Solved
Post by: Diego Andrés on July 10, 2022, 03:46:12 PM
Had some time and fixed it.

1.0.1 - 10 July 2022
Title: Re: Basic Topic Solved
Post by: Steve on July 10, 2022, 06:59:53 PM
Thanks Diego.
Title: Re: Basic Topic Solved
Post by: Diego Andrés on July 13, 2022, 02:39:02 PM
1.0.2 - 13 July 2022
Title: Re: Basic Topic Solved
Post by: gevv on July 14, 2022, 06:23:47 AM
Hello,

Thanks @Diego Andrés

It would be great if it was compatible with the data of the old mod (https://github.com/SimpleDesk/Team-Mods-TopicSolved)

Title: Re: Basic Topic Solved
Post by: Diego Andrés on July 14, 2022, 09:05:25 AM
Just change the column name to "solved" for the topics table, and any t.is_solved to t.solved :P

Or actually, you can just rename the old column to is_solved
Title: Re: Basic Topic Solved
Post by: gevv on July 15, 2022, 06:14:13 AM
Thanks.

A solution for everyone would be better :)

There may be an option to import

Title: Re: Basic Topic Solved
Post by: FredT on August 26, 2022, 06:33:24 AM
Giving back to the community: Topic Solved-German translation. Tested on smf v2.1.2

Make a new php file, call it SolveTopic.german.php
Copy it to Themes/default/languages or wherever your language files reside:



// Version: 2.1a; Topic solved mod - German translation
global $helptxt;

$txt['topic_solved_title'] = 'Topic Gelöst Mod';
$txt['solve_topic'] = '<strong style="color: green">Markiere Topic als gelöst</strong>';
$txt['unsolve_topic'] = '<strong style="color: red">Markiere Topic als nicht gelöst</strong>';
$txt['modlog_ac_solve'] = 'Gelöst &quot;{topic}&quot; von {member}';
$txt['modlog_ac_unsolve'] = 'Ungelöst &quot;{topic}&quot; von{member}';
$txt['modlog_solve_log'] = '"Topic gelöst" Log';
$txt['modlog_solve_log_desc'] = 'Unten befindet sich eine Liste mit allen Topics die von Benutzern als gelöst oder nicht gelöst markiert wurden.<br /><strong>Bitte beachten:</strong> Die Einträge können nicht aus dem Log gelöscht werden, wenn sie nicht mindestens 24 Stunden alt sind.';
$txt['modlog_solve_log_no_entries_found'] = 'Es gibt derzeit keine Einträge über gelöste Topics im Log File.';
$txt['solve_log_help'] = '<strong>"Topic gelöst" Log</strong><br />Dieser Bereich erlaubt Benutzern des Moderatoren Teams die gelösten/ungelösten Topics einzusehen. Um sicherzustellen, dass Moderatoren neue Markierungen nicht gleich entfernen, müssen die gelösten Topics mindestens 24 Stunden alt sein.';
$helptxt['solve_log'] = $txt['solve_log_help'];

$txt['permissionname_solve_topic'] = 'Markiere Topics gelöst/nicht gelöst';
$txt['permissionhelp_solve_topic'] = 'Erlaube dem Benutzer seine eigenes Topic als gelöst/ungelöst zu markieren.';
$txt['permissionname_solve_topic_any'] = 'Irgendein Topic';
$txt['permissionname_solve_topic_own'] = 'Eigenes Topic';
$txt['permissionname_simple_solve_topic_own'] = 'Markiert eigene Topics als gelöst';
$txt['permissionname_simple_solve_topic_any'] = 'Markiert irgendein Topics als gelöst';

$txt['cannot_solve_topic_any'] = 'Es fehlen die Rechte um das Topic als gelöst zu markieren.';
$txt['cannot_solve_topic_own'] = 'Es fehlen die Rechte um das Topic als gelöst zu markieren.';
$txt['enable_solved_log'] = '"Topic gelöst" Log File anlegen (benötigt Moderator Logs aktiviert)';
$txt['topicsolved_board_desc'] = '<span class="smalltext">Markieren Sie entsprechende Foren um dort "Topic gelöst" zu aktivieren.</span>';
$txt['topicsolved_highlight'] = 'Gelöste Topics im Nachrichten Inhalt hervorheben';
$txt['topicsolved_highlight_col1'] = 'Farbe für hervorgehobene "Topic gelöst" (hellere, zum Beispiel Antworten/Ansichten)';
$txt['topicsolved_highlight_col2'] = 'Farbe für hervorgehobene "Topic gelöst" (dunklere, zum Beispiel Thema/Gestartet von)';
$txt['topicsolved_display_notice'] = 'Zeige Hinweise in den gelösten Topics';
$txt['topicsolved_is_solved'] = '<strong style="color: green;">Topic gelöst</strong><br />Dieses Topic wurde als gelöst markiert und benötigt keine Antworten mehr, ausser Sie wollen das Thema gerne weiter diskutieren.';
$txt['topicsolved_not_enabled'] = 'Topic gelöst ist in diesem Forum nicht aktiv.';
$txt['cannot_solve_own'] = 'Man nicht seine eigenen Topics als gelöst markieren';
$txt['cannot_solve_any'] = 'Man kann nicht irgendein Topic als gelöst markieren';

Title: Re: Topic Solved
Post by: Diego Andrés on October 15, 2022, 08:36:36 PM
1.1 - 15 October 2022


Quote from: FredT on August 26, 2022, 06:33:24 AMGiving back to the community: Topic Solved-German translation. Tested on smf v2.1.2
Oops I keep forgetting about this, which is why you guys should attach files or send PR's on GitHub  :P
I'll add this in the next update.
Title: Re: Topic Solved
Post by: Mareid on February 20, 2023, 11:30:53 AM
I would like to be able to change the wording from "Topic Solved" to something else but I have no idea how.  Can you help?
Title: Re: Topic Solved
Post by: Diego Andrés on February 20, 2023, 11:36:15 AM
You can do so by editing the language file.
Themes/default/languages/TopicSolved/.english.php
Title: Re: Topic Solved
Post by: Mareid on February 20, 2023, 12:00:18 PM
That's what I thought, but when I look at the files on the server the directory.
Themes/Default/languages/TopicSolved is empty.  The mod is installed (I used the package manager) and I'm running 2.13.
Title: Re: Topic Solved
Post by: Diego Andrés on February 20, 2023, 12:10:13 PM
That's odd, you could try editing the file locally and then uploading it to the folder.
As to why they don't appear, it's possible that on certain servers (specially windows) files that start with a dot are hidden, you might want to look for a setting that shows them.
Title: Re: Topic Solved
Post by: Mareid on February 20, 2023, 03:06:23 PM
That was the problem. Files beginning with a . are hidden on my host.  I was able to find, download and modify the file locally and reupload it.  Works great
Title: Re: Topic Solved
Post by: Matias- on February 23, 2023, 07:39:10 AM
Hello Diego, a report:

In 2.1 it works perfectly, when marking a topic as solved it is marked in green, the problem is that when closing the topic this green color is lost.

Example Topic Solved OK:

(https://i.imgur.com/mntsT0X.png)

Example Topic Solved + Topic Closed:

(https://i.imgur.com/226GJmS.png)

The idea is that even when closing the issue, it continues to be seen green to identify that it is a resolved issue.
Title: Re: Topic Solved
Post by: Diego Andrés on February 24, 2023, 09:16:30 PM
It's done with that intend.
You can change it by editing Themes/default/css/topicsolved.css
Remove .locked from the list. of styles.
.windowbg.solved:not(.sticky, .locked)

As a matter of fact, I'll be adding the approve class in here too, seems I forgot about it...
Title: Re: Topic Solved
Post by: Matias- on February 25, 2023, 10:48:50 AM
Quote from: Diego Andrés on February 24, 2023, 09:16:30 PMIt's done with that intend.
You can change it by editing Themes/default/css/topicsolved.css
Remove .locked from the list. of styles.
.windowbg.solved:not(.sticky, .locked)

As a matter of fact, I'll be adding the approve class in here too, seems I forgot about it...

Thanks, I got it.

For me the idea of the topic solved is to be able to mark the topic as solved and that:

- The tilde of solved is seen.
- The topic is seen in green. (Since this is how it is distinguished if it is solved or not) regardless of whether the topic is closed or open.

Thanks!!
Title: Re: Topic Solved
Post by: gevv on September 14, 2023, 01:04:37 PM
Hi,

There is a conflict with the Avatars display integration (v1.5.4)  mod. The topic solved icons do not appear.

Title: Re: Topic Solved
Post by: Diego Andrés on September 14, 2023, 01:10:41 PM
Yup it's an issue with the other MOD, documented here (https://www.simplemachines.org/community/index.php?topic=583323.0). At the moment nothing can be done about it I'm afraid.
Title: Re: Topic Solved
Post by: Pipke on September 14, 2023, 05:17:12 PM
Quote from: gevv on September 14, 2023, 01:04:37 PMHi,

There is a conflict with the Avatars display integration (v1.5.4)  mod. The topic solved icons do not appear.

Quote from: Diego Andrés on September 14, 2023, 01:10:41 PMYup it's an issue with the other MOD, documented here (https://www.simplemachines.org/community/index.php?topic=583323.0). At the moment nothing can be done about it I'm afraid.

quick fix for that conflict is here (https://www.simplemachines.org/community/index.php?msg=4160108)
Title: Re: Topic Solved
Post by: gevv on September 15, 2023, 10:20:00 AM
Hi,

How do I add "solved" text at the end of the titles?



Title: Re: Topic Solved
Post by: gevv on September 16, 2023, 11:18:48 AM
The method I used in old mod. (https://github.com/SimpleDesk/Team-Mods-TopicSolved) I tried it in new Topic Solved  mod it doesn't work, nothing appeared.

Find Sources MessageIndex.php

'css_class' => $colorClass,
add after;

'solved_link' => '<a href="' . $scripturl . '?topic=' . $row['id_topic'] . '.0">'.$txt['TSolved'].'</a> '
Themes MessageIndex.template.php


<div class="message_index_title">
add after;

'.(!empty($topic['solved']) ? $topic['solved_link'] : '').'

language;

$txt['TSolved'] = '<span class="solved2">Solved</span>';
css;

.solved2 {
   background-color: #2E78E8;
   border: 1px solid #1B5BBA;
   border-radius: 2px;
   color: #FFFFFF;
   font-family: sans-serif;
   font-size: 10px;
   font-weight: bold;
   padding: 1px 5px;
}
Title: Re: Topic Solved
Post by: Diego Andrés on September 16, 2023, 02:07:00 PM
Quote from: gevv on September 16, 2023, 11:18:48 AMadd after;

'.(!empty($topic['solved']) ? $topic['solved_link'] : '').'

I don't use a 'solved' column.
Try with 'is_solved'.

'.(!empty($topic['is_solved']) ? $topic['solved_link'] : '').'
Title: Re: Topic Solved
Post by: gevv on September 16, 2023, 02:38:22 PM
Thanks @Diego Andrés  it works 👍
Title: Re: Topic Solved
Post by: durangod on December 16, 2023, 12:03:31 AM
i installed the mod but i dont see the new button anywhere on topics
Title: Re: Topic Solved
Post by: Diego Andrés on December 16, 2023, 02:42:26 AM
You need to enable it per board when editing each, or select the boards where it applies in the settings of the MOD.
Title: Re: Topic Solved
Post by: durangod on December 16, 2023, 05:53:35 AM
Yeah ok got it... It seems to be enabled by default but one board it was not, i just happen to be in that board.  But i see it now.....  Thanks
Title: Re: Topic Solved
Post by: Steve on December 16, 2023, 07:30:29 AM
When using checkboxes for 'Show quick-moderation as', would it be difficult to add 'Mark Solved' to the dropdown list of options?
Title: Re: Topic Solved
Post by: Diego Andrés on December 16, 2023, 10:42:53 AM
Could be, is it something that would be useful? I've personally never really needed to mark many as solved at once.
Title: Re: Topic Solved
Post by: Steve on December 16, 2023, 03:01:43 PM
I would use it but I don't know that it would be useful for others.
Title: Re: Topic Solved
Post by: durangod on December 22, 2023, 10:34:14 PM
Diego, not sure if this is a theme issue or a mod issue but have a look, this is how the solved topic highlight is displayed.  Looks like its using the original default theme color and just needs a color change.  :)  maybe just make a note for the next version :)

resolvedsample.jpg

found it... its in

minified_8b486e37369017d0b309b03d104fe32e.css?smf214_1703261977

.windowbg.solved:not(.sticky,.locked,.approvetopic) {
    background: #c5edc5;
}

suggestions green gold and red, i prefer the red but its up to you what you think is best :)


suggestions only #133a13  or #46230e a red #340909

:)
Title: Re: Topic Solved
Post by: durangod on December 22, 2023, 11:59:50 PM
Just FYI i had to do them separately because my editor was tossing errors if i combined them.  However according to the docs your combined syntax is perfect.  So its my editor issue..


.windowbg.solved:not(.sticky) {
    background: #340909 !important;
}

.windowbg.solved:not(.locked) {
    background: #340909 !important;
}

.windowbg.solved:not(.approvetopic) {
    background: #340909 !important;
}


Title: Re: Topic Solved
Post by: Steve on December 23, 2023, 07:51:53 AM
The highlighted background was a deal-breaker for me too. Couldn't the background code be eliminated or made to match the current windowbg?
Title: Re: Topic Solved
Post by: durangod on December 23, 2023, 08:31:58 AM
Quote from: Steve on December 23, 2023, 07:51:53 AMThe highlighted background was a deal-breaker for me too. Couldn't the background code be eliminated or made to match the current windowbg?

Well yeah it could im sure but the problem is that there are also colors for sticky, locked, and approvetopic items so if noone cares about this being different then sure but if not then it has to be a different color for those that want a different color.  However, yeah i see what your saying just have the checkmark and leave the hightlight alone (meaning dont have one at all).  I guess maybe have a config value for that, highlight on or off, and color lol
Title: Re: Topic Solved
Post by: Diego Andrés on December 23, 2023, 10:35:23 PM
Quote from: durangod on December 22, 2023, 10:34:14 PMDiego, not sure if this is a theme issue or a mod issue but have a look, this is how the solved topic highlight is displayed.  Looks like its using the original default theme color and just needs a color change.  :)  maybe just make a note for the next version :)

That's something you'd need to adjust for a custom theme.
For Repulse, you could add this at the end of custom_edits.css

:root[data-colormode="dark"] .windowbg.solved:not(.sticky, .locked, .approvetopic) {
background: #4e654e;
}
Title: Re: Topic Solved
Post by: Dave J on February 29, 2024, 04:51:32 AM
Quote from: Steve on December 16, 2023, 03:01:43 PMI would use it but I don't know that it would be useful for others.

Yes I was just checking this on my site as I had some issues and lost the topics that were solved, now I need to go through them again and do each one individually so the droplist option would be great