Link to Mod (http://custom.simplemachines.org/mods/index.php?mod=4034)
Allows users to add tags to their topics by just wrapping them in brackets at the title.
Mod's source repo can be found in Gitlab (https://gitlab.com/wadanon/super-simple-thread-tags).
Features
- Allows an easy visual categorization of threads by seeing tags.
- Tags are coloured automatically based on the contents of the tag.
- Clicking a tag will show all threads with that tag as long the user can use your forum's search
ConfigurationNone required. To disable the tags, the mod must be uninstalled.
Special InformationThis mod makes use of CSS3 features, mainly border-radius and rgba colouring.
Special ThanksI want to thank the ABXD team for their software, where the original tag code came from.
The license for ABXD may be seen here (https://github.com/ABXD/ABXD/blob/master/LICENSE.md).
Update History(1.2) 21-Ago-2015 - Add SSI support for tags. I'm so sorry.
(1.1a) 22-Feb-2015 - Fix an error related to guest tag searching.
(1.1) 17-Feb-2015 - Make use of SMF Search as a "tag search" function.
(1.0a) 11-Feb-2015 - Make tags more consistent within all SMF actions.
Update InformationThis mod doesn't require to uninstall for upgrading as long you're in the last 3 versions before the latest one. This is to make upgrades easier in my end.
Note: If you have errors upgrading from 1.1a, try uninstalling the mod first, then install 1.2.
LicenseThis mod is released under the MIT license.
How cool is that?? Runs off to try it ...
I updated the mod to 1.1.
Just install over and the mod will be upgraded.
This update adds a "tag search" system that makes use of SMF search. If a user is logged in on the forum and search is enabled for that user, they can click that tag to search more threads with that tag.
Nice tag and update! Will try to convert it to my forums on 2.0.8 today! :)
BTW, how many tags are allowed per topic?
Quote from: Dragon Fruit on February 17, 2015, 03:29:54 AM
Nice tag and update! Will try to convert it to my forums on 2.0.8 today! :)
BTW, how many tags are allowed per topic?
It should work for 2.0.8 with emulation. If not, I can fix it :)
There is no limit for tags as long the thread title has space for them (80 characters iirc)
There seem to be an issue in messageindex.template.php
There was a problem loading the /Themes/default/MessageIndex.template.php template or language file. Please check the syntax and try again - remember, single quotes (') often have to be escaped with a slash (\). To see more specific error information from PHP, try accessing the file directly.
syntax error, unexpected T_IF, expecting ',' or ';'
Find
', $topic['is_sticky'] ? '<strong>' : '', '<span id="msg_' . $topic['first_post']['id'] . '">', $topic['first_post']['link'], (!$context['can_approve_posts'] && !$topic['approved'] ? ' <em>(' . $txt['awaiting_approval'] . ')</em>' : ''), '</span>', $topic['is_sticky'] ? '</strong>' : ''
Add after
, $topic['first_post']['tags'] ? ' ' . $topic['first_post']['tags'] : ''
In my messageindex, this is my line:
', ($topic['is_sticky'] || $topic['new']) ? '<strong>' : '', '<span id="msg_' . $topic['first_post']['id'] . '">', $topic['first_post']['link'], (!$context['can_approve_posts'] && !$topic['approved'] ? ' <em>(' . $txt['awaiting_approval'] . ')</em>' : ''), '</span>', ($topic['is_sticky'] || $topic['new']) ? '</strong>' : '' ;
If I put your code after this line, it says Parse error.
IF I replace my code with your line it also says it has a parse error.. :(
Try this. It should work. If it doesn't, I should sleep before doing support :p
Thanks! That worked indeed! :)
I have 2 suggestions:
Change [ text ] to #text to make tags in topic (Otherwise it's so colorful, see attachment :P);
Personally to my forums it for the better to enable/disable per board :)
Quote from: Dragon Fruit on February 17, 2015, 05:03:00 AM
Thanks! That worked indeed! :)
I have 2 suggestions:
Change [ text ] to #text to make tags in topic (Otherwise it's so colorful, see attachment :P);
Personally to my forums it for the better to enable/disable per board :)
Tags can be more than one word so the brackets are perfect for that case.
And for the colorful, that's the intention of the tags :P
You can change it by opening Subs.php and changing this part:
// That multiplier is only there to make "nsfw" and "18" the same color.
$color = 'hsl(' . (($hash * 57) % 360) . ', 70%, 40%)';
Experiment by changing the second and third values (70% and 40%) to your liking.
Due to how I make the tags on the board, the per board setting won't there be for some time.
What particular code do I need to change if I would like to change [text] to #text? :)
Is it this one? :)
$title = str_replace('[' . $tag . ']', '', $title);
Quote from: Dragon Fruit on February 17, 2015, 12:14:48 PM
What particular code do I need to change if I would like to change [text] to #text? :)
This one:
preg_match_all('/\[(.*?)\]/', $title, $matches);
Be sure to change this line too:
$tags .= '<a class="threadTag" style="background-color: ' . $color . ';" href="' . $scripturl . '?action=search2;search=' . htmlspecialchars('[' . $tag . ']') . '" title="' . sprintf($txt['sstd_search_tag'], $tag) . '">' . $tag . '</a>';
And Modificacions.english.php too:
$txt['sstd_search_tag'] = 'Search all threads that are tagged [%1$s]';
Have fun.
Edit: Never mind, I give up. :P
I found an error with the guest tag searching, produces this error:
8: Undefined index: is_guest
File: /wwwroot/Sources/Subs.php
Line: 4442
Because of:
if (!$context['is_guest'] && $canSearch)
If somebody get this error too, than change it in Sources/Subs.php to:
if (!$context['user']['is_guest'] && $canSearch)
Quote from: navMartin on February 22, 2015, 05:18:12 AM
I found an error with the guest tag searching, produces this error:
8: Undefined index: is_guest
File: /wwwroot/Sources/Subs.php
Line: 4442
Because of:
if (!$context['is_guest'] && $canSearch)
If somebody get this error too, than change it in Sources/Subs.php to:
if (!$context['user']['is_guest'] && $canSearch)
Thanks. I have uploaded 1.1a with (only) the fix.
You're welcome. ;)
Love this Mod....thank you :)
Would there be any chance of this working along side http://custom.simplemachines.org/mods/index.php?mod=579 ?
Quote from: 420connect.info on March 18, 2015, 05:58:30 PM
Would there be any chance of this working along side http://custom.simplemachines.org/mods/index.php?mod=579 ?
I'll look on that. It shouldn't be that hard to integrate.
so much love for you! :-*
I thought that I posted this last weekend... Oh well.
I'm still working on the stuff that 420connect.info requested. I got the basic stuff working but there are some quirks that I want to get done first (the next update has the per board permissions stuff) and uni/college/whatever you want to call it leaves me with so little time for that. Don't expect the update soon but if it's possible, I'll try to get it done on these weeks.
I really appreciate your updates and look forward to testing it out when it's ready! :)
Great mod.. works great, but I use it together with the Ajax recent topics mod.. and on the recent topics page no tags are displayed, only [this]. Can I add some simple code into the recent topic mod to display the tags?
Quote from: dakey on March 25, 2015, 06:56:49 PM
Great mod.. works great, but I use it together with the Ajax recent topics mod.. and on the recent topics page no tags are displayed, only [this]. Can I add some simple code into the recent topic mod to display the tags?
Try this:
On Sources/Recent.php:
while ($row = $smcFunc['db_fetch_assoc']($request))
{
$threadTags = makeThreadTags($row['subject']);
$row['subject'] = $threadTags[0];
$threadTags = $threadTags[1];
'link' => '<a href="' . $scripturl . '?topic=' . $row['id_topic'] . '.0">' . $row['subject'] . '</a>',
'link' => '<a href="' . $scripturl . '?topic=' . $row['id_topic'] . '.0">' . $row['subject'] . '</a>' . $threadTags,
If it doesn't work, tell me. I just did the edit based on reading the mod for 5 minutes.
That was the best 5 minutes ever, it works! Many thanks 8)
This is probably the most appreciated (by my users) mod I have :)
Also looking forward to integration that 420 requested ;)
Do you have a demo site? The small image you posted doesn't really show much. Thanks.
Quote from: Kimmie on April 11, 2015, 01:07:13 PM
Do you have a demo site? The small image you posted doesn't really show much. Thanks.
My site (on my profile here) uses a custom version of the mod for all boards there. Feel free to look and that stuff. I'll probably setup a demo site sometime later.
Just an update. I was going to upload the update last tuesday but my PC got fried and I can't really upload the update from a phone. Expect the update this monday.
I can give a sneak of what will contain at the very least:
- Per-board permissions.
- Specify in what places the tags would be shown.
- More styles for the tags.
- And some more...
The update that 420connect.info requested will be released separately (but not on the same date as the update) but linked to on the mod page to this thread.
Quote from: WadaNon on April 24, 2015, 10:50:42 PM
Just an update. I was going to upload the update last tuesday but my PC got fried and I can't really upload the update from a phone. Expect the update this monday.
I can give a sneak of what will contain at the very least:
- Per-board permissions.
- Specify in what places the tags would be shown.
- More styles for the tags.
- And some more...
The update that 420connect.info requested will be released separately (but not on the same date as the update) but linked to on the mod page to this thread.
Looking forward to this!
Many thanks for considering my request too :)
Why do you not use an established symbol # to denote tags?
Quote from: gorbi on April 26, 2015, 05:33:31 AM
Why do you not use an established symbol # to denote tags?
Quote from: Dragon Fruit on February 17, 2015, 05:03:00 AM
I have 2 suggestions:
Change [ text ] to #text to make tags in topic (Otherwise it's so colorful, see attachment :P);
Yup :)
Quote from: WadaNon on February 17, 2015, 12:02:14 PM
Tags can be more than one word so the brackets are perfect for that case.
As twitter
#LarryALoveToRemember
#БУНТАРСКИЙВЫХОДНОЙ
#NepalEarthquake
Let's wait for WadaNon, maybe he will support it within one of the next versions :)
Quote from: Dragon Fruit on April 26, 2015, 01:26:19 PM
Let's wait for WadaNon, maybe he will support it within one of the next versions :)
+100500 ;)
You will be able to share posts on social networks at once with #tags
Just wondered if this was still being supported/developed by Wada..
I'm trying to get tags showing in Simple Portal blocks.
I have added the mod css to both portal css files
and
added code as in post #22 here to portal_blocks in sources
forum still works OK but no change to tags in the block............... any one an ideas ?
Quote from: iain sherriff on August 09, 2015, 03:54:49 PM
I'm trying to get tags showing in Simple Portal blocks.
I have added the mod css to both portal css files
and
added code as in post #22 here to portal_blocks in sources
forum still works OK but no change to tags in the block............... any one an ideas ?
I'd also be interested in this should anyone solve it! ;)
Oh wow. Sorry for that. I just remembered that about the mod. I said that I would get a new version few months ago but work, uni and life stuff came so fast that I completely forgot about it until now that I checked my mail (I have a separate mail for this forum, so...).
I got a new PC and well... I trashed the old drive with the code of the new version. I'm so sorry.
btw do you guys still want the hashtag thing?
Sorry for the double post but I can't edit my last post :P
Updated the mod to 1.2.
This is only a "cover all bases" update, mainly for users that use SSI.php and want tags too. (*cough*SimplePortal*cough*)
For SimplePortal users: If you modified your blocks to add tag support, please undo them. It should work now out of the box. If not, feel free to reply or send me 20 mails about the matter.
Quote from: WadaNon on August 21, 2015, 01:40:59 AM
Oh wow. Sorry for that. I just remembered that about the mod. I said that I would get a new version few months ago but work, uni and life stuff came so fast that I completely forgot about it until now that I checked my mail (I have a separate mail for this forum, so...).
I got a new PC and well... I trashed the old drive with the code of the new version. I'm so sorry.
btw do you guys still want the hashtag thing?
No worries, I completely understand!
and I'd at least appreciate the
#thing if you have the time?
.. & sorry, did 1.2 include the mod integration thing? ???
Quote from: 420Connect.co.uk on August 22, 2015, 04:39:00 PM
-quote-
No worries, I completely understand!
and I'd at least appreciate the #thing if you have the time?
.. & sorry, did 1.2 include the mod integration thing? ???
I knew something was missing :/ The update only does the SSI.php edits.
I'll look at that mod thing and the hashtag. I don't promise an eta though. We know how it would end ;)
;) No worries and thanks again!
Sorry to bug ya, love the mod, but on my forum it has one error that I can't seem to fix: the tags show while inside the topic, and when doing a search, but not in topic view.
During install it had trouble with the change to MessageIndex.template.php, which i semi-ignored because I'm an idiot :P
I looked at what it was having trouble with (sadly I forgot now), and whenever i tried to add the code, i'd get a blank page which from what I understand means there's an error? So I removed it and here I am....
Quote from: GenesisMUGEN on August 24, 2015, 09:11:57 PM
Sorry to bug ya, love the mod, but on my forum it has one error that I can't seem to fix: the tags show while inside the topic, and when doing a search, but not in topic view.
During install it had trouble with the change to MessageIndex.template.php, which i semi-ignored because I'm an idiot :P
I looked at what it was having trouble with (sadly I forgot now), and whenever i tried to add the code, i'd get a blank page which from what I understand means there's an error? So I removed it and here I am....
Can you upload your MessageIndex template or the relevant parts of it? It's probably a conflict with an edit that the theme you use or another mod did.
Sure thing. I had assumed it was the theme.
Here you go.
/me
Awesome! Thank you so much.
You have no idea how perfect this mod is for my site :P
This mode is very nice and I like the future Simpleportal/SSI integration idea. It would be nice if tags also showed up anywhere including SimplePortal Recent Topics blocks. :)
Quote from: DJ Omnimaga on September 02, 2015, 12:54:13 AM
This mode is very nice and I like the future Simpleportal/SSI integration idea. It would be nice if tags also showed up anywhere including SimplePortal Recent Topics blocks. :)
What idea? The update is live :P
The tags should show in SimplePortal's blocks since I edited SSI to include them unless I missed something and they don't actually show because I didn't tested (too lazy to dl SimplePortal) >_>
Weird, because for me the tags do not show up at all in SimplePortal blocks. The [tag] content is stripped off with this update, but it won't show the tags.
Succesfully tested on my forum and it's very nice.
Congratulations.
Quote from: DJ Omnimaga on September 05, 2015, 12:27:03 AM
Weird, because for me the tags do not show up at all in SimplePortal blocks. The [tag] content is stripped off with this update, but it won't show the tags.
Can you try this in SSI.php (do this with all instances of this search)?
$row['subject'] = $threadTags[0];
$row['subject'] = $threadTags[0] . $threadTags[1];
YAY! That fix worked. The tags even show up in a custom recent posts PHP block I am using. Thanks for the update. :)
Do you think the fix will be included in the next update?
Hey it's me again!
Just wondering, would it be possible in a later update for capitalization? I notice everything is lowercase even if my tags were typed in uppercase. OCD organization :P
Quote from: GenesisMUGEN on September 19, 2015, 09:07:01 AM
Hey it's me again!
Just wondering, would it be possible in a later update for capitalization? I notice everything is lowercase even if my tags were typed in uppercase. OCD organization :P
You can do this in Subs.php
$tag = htmlspecialchars(strtolower($tag));
$tag = htmlspecialchars($tag);
Quote from: DJ Omnimaga on September 06, 2015, 12:50:49 PM
YAY! That fix worked. The tags even show up in a custom recent posts PHP block I am using. Thanks for the update. :)
Do you think the fix will be included in the next update?
Probably. I did the original update thinking that SimplePortal used the links that SSI already made and not generating the links on its own. I'll have to rethink how to approach it without making a mess.
That was easy. Thanks!
To add cyrillic and other non-latin characters to tags, just change:
Subs.php
$tag = htmlspecialchars(strtolower($tag));
To:
$tag = mb_strtolower($tag, 'UTF-8');
Hi,
Tags with spaces don't get processed as they should. I'm trying to get people to use underscores between terms, but it's kind of tricky to do.
Thanks for this mod!
Hello! I ma searching for such a mod for my forum. Are there any plans to update to 2.1.2? Thanks for any feedback!
Quote from: Varlov on October 09, 2022, 02:39:27 PMHello! I ma searching for such a mod for my forum. Are there any plans to update to 2.1.2? Thanks for any feedback!
Looking at the profile of the mod author it says:
Last active:February 25, 2016, 01:56:15 AM
They haven't been active here for the last 6 years. You would be better off requesting a new mod at our Mod Requests (https://www.simplemachines.org/community/index.php?board=79.0) board.
Really like this plugin, so I tried to adapt it to 2.1.4, works at topiclist, maybe someone can improve.
https://disk.yandex.ru/d/7XOJmfSDbfA3kQ