HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Introducing the Hashtag Plugin

rbrahmsonrbrahmson "You may say I'm a dreamer / But I'm not the only one"NY ✭✭✭

The Hashtag plugin is used to automate the tagging of discussions in a similar way that Twitter and other sites work - when users create content that contain #hashtags, these tags are automatically used to tag the content and allows finding other similar content. The tags themselves are the standard Vanilla tags as enabled by the Tagging plugin.

There are two main aspects to this process:
1. Hashtag Recognition. The plugin uses the twitter syntax - a word prefixed by a hash (#) sign. While Twitter supports tags between 2 to 140 characters in length, the Admin configuration screen can change the length parameters. The admin can also specify whether hashtag recognition is limited to the Discussion title or the Title and the bodies of the discussion and subsequent comments.
2. Hashtag Linking. This process recognize #hashtags within the discussion and comment content (whether they were used to create tags or not) and link them to other discussions sharing the same hashtags. This feature requires that the "Garden.Format.Hashtags" in config.php be set to false (otherwise Vanilla will use the hashtags as text-search links as it does on this forum - see #this link).

The plugin requires permission settings in Roles and Permissions which provides the ability to limit the plugin functionality to selected users (e.g. moderators).

Hints:
1. The Tagging plugin adds a side panel with the list of popular tags. I use the "Module Sort" plugin to place the popular tags high on the side panel.
2. I set the length of the tags to be between 4 and 30 characters to prevent automatic recognition of short and very long tags. That does not interfere with users ability tag discussions manually without that restriction.

Comments

  • phreakphreak Vanilla*APP (White Label) & Vanilla*Skins Shop MVP

    Amazing @rbrahmson. We had this in discussion some years ago, but the conclusion was that somehow (don't ask me who brought that up) was that a plugin like this would be a performance drain. I tested the plugin and love it.

    What do you think about the Hashtag field when creating a discussion? I think it would make sense to remove this extra field when your plugin is integrated. Is there a way do add this to the Addon or is it possible to set this in the config?

    • VanillaAPP | iOS & Android App for Vanilla - White label app for Vanilla Forums OS
    • VanillaSkins | Plugins, Themes, Graphics and Custom Development for Vanilla
  • rbrahmsonrbrahmson "You may say I'm a dreamer / But I'm not the only one" NY ✭✭✭

    Thanks @phreak! IMHO there is no performance issue because the plugin does it's main processing only when a single discussion is edited.

    As for your enhancement - I have few additional minor things I want to include in the next version so perhaps I can do what you asked. But I want to understand better - what do you mean by "hashtag -field" can you elaborate?

  • phreakphreak Vanilla*APP (White Label) & Vanilla*Skins Shop MVP
    edited May 2016

    With hashtag field i mean the "Tags" input on starting a discussion. It would be two logics to apply tags and i think that making the hashtag just in the text is simple and smart enough. I think it could be disabled so users are less confused.

    • VanillaAPP | iOS & Android App for Vanilla - White label app for Vanilla Forums OS
    • VanillaSkins | Plugins, Themes, Graphics and Custom Development for Vanilla
  • rbrahmsonrbrahmson "You may say I'm a dreamer / But I'm not the only one" NY ✭✭✭
    edited May 2016

    OK, now I understand what you mean. What you want is to remove the tags form on the discussion edit screen.
    I was able to do that with this simple css change:

    .Form-Tags {
        display: none;
    }
    

    But before you do that, please consider these:

    • Manual tagging does not require tags that start with the "#" symbol
    • Manual Tagging may be shorter than the limit the admin imposes on Hashtags
    • Hashtags require both the Tagging Add permission and the Hashtag Add permission, a feature that provide the admin with the ability to offer manual tagging to a wide audience while limiting auto-hashtags to specific users.
    • The tag form on the edit screen provides an easy way to remove tags.

    Last but not least - thank you for using the plugin and providing feedback.

  • phreakphreak Vanilla*APP (White Label) & Vanilla*Skins Shop MVP
    edited June 2016

    @rbrahmson: Thank you for the tip. I did it like you mentioned.

    Another issue i came across is that tags only seem to get highlighted and linked in the initial post of a discussion and not in the comments. Is this by intention or a bug on my side?

    • VanillaAPP | iOS & Android App for Vanilla - White label app for Vanilla Forums OS
    • VanillaSkins | Plugins, Themes, Graphics and Custom Development for Vanilla
  • rbrahmsonrbrahmson "You may say I'm a dreamer / But I'm not the only one" NY ✭✭✭

    Works fine for me...

    I assume your config settings are correct (the plugin setting screen should validate and warn you of issues...)

    I also assume you are running 2.1 or 2.2 (not 2.3b1 which has few issues)

  • rbrahmsonrbrahmson "You may say I'm a dreamer / But I'm not the only one" NY ✭✭✭

    @phreak - I just uploaded a new version of the plugin. Please let me know if you still have the issue you reported earlier.

  • phreakphreak Vanilla*APP (White Label) & Vanilla*Skins Shop MVP

    Thank you @rbrahmson. I'm going to test that this weekend.

    • VanillaAPP | iOS & Android App for Vanilla - White label app for Vanilla Forums OS
    • VanillaSkins | Plugins, Themes, Graphics and Custom Development for Vanilla
  • I'm not seeing "Garden.Format.Hashtags" in config.php. Any ideas?

  • rbrahmsonrbrahmson "You may say I'm a dreamer / But I'm not the only one" NY ✭✭✭
    edited June 2016

    As a general rule in Vanilla, whenever a configuration option does not appear in congif.php, it is taken from config-defaults.php (which you should not change!).
    So copy the "Garden.Format.Hashtags" from config-defaults.php into config.php, set it to false, and then the plugin option would work:

    $Configuration['Garden']['Format']['Hashtags'] = false;

    Independently, I uploaded a new version related to the other issue you mentioned.

  • phreakphreak Vanilla*APP (White Label) & Vanilla*Skins Shop MVP

    Hi @rbrahmson,

    I'm still testing your plugin and one issue i found was that HEX-colors seem to be added to the hashtag list. My users tend to to color some text parts in the their posts with HTML > For example the old font tag: font color="#11eedd".

    This leads to numerous tags with color value. ;) Any idea how to conquer that?

    • VanillaAPP | iOS & Android App for Vanilla - White label app for Vanilla Forums OS
    • VanillaSkins | Plugins, Themes, Graphics and Custom Development for Vanilla
  • rbrahmsonrbrahmson "You may say I'm a dreamer / But I'm not the only one" NY ✭✭✭

    Hi @phreak, thanks for testing my plugin. Indeed you uncovered a flaw in the plugin. Here is another manifestation of the same logic flaw - try pasting a url with an anchor link - the anchor will also be captured as a Hashtag.

    I have to fix this. Will let you know when it's done.
    Again, thank you for your feedback.

  • rbrahmsonrbrahmson "You may say I'm a dreamer / But I'm not the only one" NY ✭✭✭

    I created a minor version update that addresses that issue as well as adding few enhancements.
    Use the source at github to test this minor upgrade. The only changes are in class.hashtag.plugin.php

    I'll wait to see if there is some feedback on the plugin functionality before uploading this version on the Vanilla plugin site.

  • phreakphreak Vanilla*APP (White Label) & Vanilla*Skins Shop MVP

    Thanx a lot @rbrahmson. I'm currently testing and let you know.

    • VanillaAPP | iOS & Android App for Vanilla - White label app for Vanilla Forums OS
    • VanillaSkins | Plugins, Themes, Graphics and Custom Development for Vanilla
  • rbrahmsonrbrahmson "You may say I'm a dreamer / But I'm not the only one" NY ✭✭✭

    I uploaded the new version and in addition to the bug fix it also has minor enhancements:
    Version 2.1.2 changes:

    • Fix the bug that marked html tags with an hashtag as a true user-intended hashtag
    • Decrease setting for minimum number of letters in a hashtag from 4 to 2 (this is admin-controlled)
    • Tighten up hashtags validation
    • Limit the maximum number of hashtags processed per discussion to the 'Plugin.Tagging.Max' settings of the Tagging Plugin (the Vanila default maximum value is 5). This is now clearly marked in the plugin configuration screen.
    • Added verification that the taggin plugin was not disabled after the hashtag plugin was enabled.

    Thanks to all those testing the plugin.

  • phreakphreak Vanilla*APP (White Label) & Vanilla*Skins Shop MVP

    @rbrahmson: Great! I have experienced no issues so far with the newest release. top

    • VanillaAPP | iOS & Android App for Vanilla - White label app for Vanilla Forums OS
    • VanillaSkins | Plugins, Themes, Graphics and Custom Development for Vanilla
Sign In or Register to comment.