Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+14 votes
2.4k views
in Plugins by
edited by

Hashtagger is a free plugin which allows users to group their questions, answers and comments by adding hashtags into their messages. Thus, all unspaced words which start with a "#" symbol will be tagged automatically and converted to HTML links. Read more about Hashtags on Wikipedia.


How it works?
When a user submit a question, answer or comment, the plugin will replace hashtags (#[\w\-]+) with HTML links. For example: the #free-plugin will be replaced with <a href="/tag/%23free-plugin">#free-plugin</a> (depending on options of the URL structure, on your site the URL may have a different format, as the plugin automatically detects which URL format need be used).

Please note, that all missed hashtags will be automatically inserted into question tags, with no matter where it was added — question, answer or comment. This is done to prevent broken links.


How to install?

Please see the new version of plugin: Hashtagger v1.1

Q2A version: 1.6.3
by
thanks, but where can we have a look?

5 Answers

+1 vote
by
edited by
Hey, great job I downloaded the plugin and it helped.

One thing that needs a little change is that when I type "#tag" in the Question or other places, it will generate a tag automatically with the "#", which means it will generate a new tag that is different from other "tag"s so that they won't be grouped together.

This is easy to modify. Thanks for your plugin anyway.

 

PS: I just modified it. In function build_hashtags, line131, replace the original code with this : qa_hashtagger::$hashtags[] = substr($hashtag, 1);

and it's done !
by
Thank you for your feedback. I’m very glad that you find this plugin useful. For some reason I decided that default tags should be different from hashtags, and therefore did not remove the symbol "#" from the tag name. If you really want to remove this symbol, for better performance at line 153 find (#[\w\-]+) and replace it with ([\w\-]+). Then, go to line 135 and instead of <a href='{$url}'>{$hashtag}</a> write <a href='{$url}'>#{$hashtag}</a>
by
For now, this behaviour can be configured in Administration Centre. See more details here http://www.question2answer.org/qa/31733/free-plugin-hashtagger-v1-1
0 votes
by
I don't know about tags much, but can you tell me one thing that if we already have tags in q2a functionality then what different feature does your plugin offer...
by
Sorry, but did you read the description of the plugin? Anyway, you should know that Hashtagger it is not a substitute for basic functionality.
by
I have read the description buy I couldn't understand original use of hashtags that's why I asked you that. Everyone is liking your plugins that means it would be awesome. But I just want to know what is the difference between your hashtags plugin and those tags in q2a core.
by
The main feature of this plugin, is that he automatically creates HTML links to the tag page. To read more about hashtags, read this article http://en.wikipedia.org/wiki/Hashtag Also, see how and why Twitter uses hashtags https://support.twitter.com/entries/49309
by
@Gurjyot I think this tags should be used with # symbol in front of the words. This will anable to find easily others regarding any word who also using # symbol with the same word.
by
Actually I have searched some more about these tags and what I have came out with this is that, "tags" really help in seo or ranking purpose of a website on Google as they act as keywords and hashtags help in grouping stuff on a website. And this grouping can be on a really large scale as well. But while searching something in a particular website these hashtags play a real good role as they give the most relevant result.
So thanks a lot victor for such a wonderful plugin.
+5 votes
by
it"s useful, thank u. 
1- what about performance, will this plugin make high load by use preg_replace_callback on question, answer and comment. 
 
2- can u add plz user hash, example @Victor -> <a href="/qa/user/Victor">Victor</a>, and add it in event table, so if user use notification plugin, tagged user"s will be informed. 
thank u
 

 

by
1) Initially I thought to use DOM functions, explode() and str_replace() instead of preg_replace() function, but the code gets bigger and run slower. This is why I decided to keep code clean and use preg_replace() — in this case it does not play a major role in terms of performance, because messages are processed only when they are saved (not when displayed) and only if they contains a # symbol. Also, the preg_replace() function becomes slower when are used large volumes of data, but, as rule messages are not such. So, do not worry about performance ;)

2) Thanks for a great idea. Soon I’ll publish a new version of the plugin.
+1 vote
by

Thank You Victor for plugin. I want to suggest you to modify it, so that passes over the censored words that I have added as a hashtag and used them as a tag. Test it using the "censored words" option. Thanks for your attention. 

P. S. Sorry for my English.
by
plugin not work on user wall
by
Hi,
thank you for feedback.

1) Really, here is a problem with censored words. I’ll fix it in the next release.
2) The plugin not work for wall messages because the filter module (http://www.question2answer.org/modules.php?module=filter) does not have a function for processing these messages.
0 votes
by
Hi, really great work. I updated your new version and it worked very well.

 

One thing I wanna mention is that is there any way to handle the hashtag in the question TITLE?

If a user wanna only put hashtags in the TITLE instead of the question content, it is supposed to generate hashtags from title also.

 

Thank you !
...