Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Anyone for #hashtags..?

MikhaelMikhael New
edited August 2010 in Vanilla 2.0 - 2.8
Not a big issue, but I'm curious as to whether anyone is writing a plugin to provide Twitter style hashtags instead of/as well as the usual tagging method? A lot of people find hashtags very easy and convenient to use, and there's no need for an extra input field (which many people can't be bothered to use). It would also go some way to loose multi-site 'integration' at the UI level for members. Just a thought.
Tagged:
«1

Comments

  • edited August 2010
    This is kind of implemented already, actually. Hashtags seem to automaticly link to

    /search?Search=#hashtag&Mode=like
  • LincLinc Detroit Admin
    Yup. #feature-request #vanilla2
  • Neat. I hadn't thought to try it! Thanks @chi1 and @Lincoln.
  • hbfhbf wiki guy? MVP

    @lincoln i tried this on my forum and it did nothing. is there something that needs to be enabled specifically?

  • LincLinc Detroit Admin
    edited December 2011

    Have you not been copying config-defaults.php in your upgrades This must be in your config:

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

    Note that using Markdown as your formatter will break hashtags.

  • hbfhbf wiki guy? MVP

    oh hadn't noticed that before. im relatively new to vanilla, but i really like the software so far.

    I just turned it on, it seems totally disconnected from the discussion tagging system. is there anyway to tie them together?

  • LincLinc Detroit Admin

    No, they don't work together unfortunately.

  • currently

    #heading

    You should make a space for heading

    # heading

    http://daringfireball.net/projects/markdown/syntax#header

    grep is your friend.

  • PamelaPamela ✭✭

    Lincoln said:
    No, they don't work together unfortunately.

    is it still true with future 2.1 version?

  • In fact :) it seems to work #hashtags now... even with Markdown inputformatter

    but something like #hashtags

    do not !

  • LincLinc Detroit Admin

    Yes, still true in 2.1. We've revamped the Tagging plugin, but still no #hashtag integration. It's not on the roadmap.

  • Lincoln said:

    Yes, still true in 2.1. We've revamped the Tagging plugin, but still no #hashtag integration. It's not on the roadmap.

    can someone explain what hashtag integration means?

    Do you mean entering a #newtag links to the tags in the tagging database and inserts the tag in the tagging database if it doesn't already exist?

    if so I could probably modify the autolink plugin to do this.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • peregrine said:
    Do you mean entering a #newtag links to the tags in the tagging database and inserts the tag in the tagging database if it doesn't already exist?

    if so I could probably modify the autolink plugin to do this.

    Awesome! Something for the core! peregrine makes it and the Vanilla guys integrate it into the core :-)

    There was an error rendering this rich post.

  • I initially thought that a #hashtag would be a good way of linking to search results for that word, but it's not – it links to search results for the word with a hash symbol in front of it only :/

  • nicepaul said:
    I initially thought that a #hashtag would be a good way of linking to search results for that word, but it's not – it links to search results for the word with a hash symbol in front of it only :/

    I think it used to work the way you wanted. I wonder if it is a bug or intentional.

    underdog said
    Awesome! Something for the core! peregrine makes it and the Vanilla guys integrate it into the core :-)

    I wasn't implying what you say, but saying that I could change the plugin if enough people found that this type of thing was useful. It obviously would have to parse the entire discussion, but I don't think it would be too big of a performance hit.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • nicepaul said:
    I initially thought that a #hashtag would be a good way of linking to search results for that word, but it's not – it links to search results for the word with a hash symbol in front of it only :/

    @nicepaul

    if you want to change the behavior (which I think is a bug). Here is a fix for vanilla 2.1.

    in /library/core/class.format.php

    you need to remove %23

    from here

        // Handle #hashtag searches
                if(C('Garden.Format.Hashtags')) {
                    $Mixed = preg_replace(
                        '/(^|[\s,\.>])\#([\w\-]+)(?=[\s,\.!?]|$)/i',
                        '\1'.Anchor('#\2', '/search?Search=%23\2&Mode=like').'\3',
                        $Mixed
                    );
                }
    

    and replace it with this

     // Handle #hashtag searches
                if(C('Garden.Format.Hashtags')) {
                    $Mixed = preg_replace(
                        '/(^|[\s,\.>])\#([\w\-]+)(?=[\s,\.!?]|$)/i',
                        '\1'.Anchor('#\2', '/search?Search=\2&Mode=like').'\3',
                        $Mixed
                    );
                }
    

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • @peregrine

    That "bug" in /library/core/class.format.php is still there in 2.1b1. Can you explain what removing %23 does?

  • hgtonighthgtonight ∞ · New Moderator

    @MasterOne said:
    peregrine

    That "bug" in /library/core/class.format.php is still there in 2.1b1. Can you explain what removing %23 does?

    %23 is the url encoded entity for #. Removing it will direct the search to the hash tag without # sign

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

  • @hgtonight

    I think I do not understand, is it still a hashtag search if the hash is removed?

    Maybe I should read up on the use of hashtags first, as I still have no clue on how to use it and what benefit it has.

  • hgtonighthgtonight ∞ · New Moderator

    The idea is that you can prefix a search term with a # sign and the formatter will automatically link to a search on that term.

    It seems less helpful if it requires the # to appear in the search results. This mod gets rid of the # in the search query.

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

Sign In or Register to comment.