MyBB Community Forums

Full Version: Hashtags for your forum!
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I've been using this MyCode on my forum for some years...

Hope you like it.

Regular expression:
(?:color: *|pid=\d*|\[color=|\[url=[^]]*\]?\]?|&)\#(*SKIP)(*F)|\#((?:\w+|á|é|í|ó|ú|ñ|Á|É|Í|Ó|Ú|Ñ|\[|\])+)

Replacement:
<a target="_blank" href="https://www.google.com.ar/search?domains=YOURWEBSITE.COM&sitesearch=YOURWEBSITE.COM&as_epq=%23$1&as_qdr=all&as_occt=any" title="Let's Google '$1'">#$1</a>

You must replace YOURWEBSITE.COM with your domain name on the replacement string.

#then #you #can #just #type #like #this

When you click on a hashtag, it will open a new search looking for posts from your site where the same hashtag was written.

Unlikely, Google is not updated instantly... you will have to wait until Google bot collects the information of your new posts in order to get the updated search result for a hashtag.

I may realease a new version (using some custom page/plugin) to use MyBB search functions... but it's not THAT easy because MyBB search only accepts POST requests and I don't want to change core files in order to make this work.
Good idea, looks promising!
Quote:but it's not THAT easy because MyBB search only accepts POST requests and I don't want to change core files in order to make this work.
I have already removed the POST expression in search.php so i can input a custom url. I dont know why they have this as default. Or at least an option to switch it off.
(2016-10-25, 11:21 AM)metulburr Wrote: [ -> ]
Quote:but it's not THAT easy because MyBB search only accepts POST requests and I don't want to change core files in order to make this work.
I have already removed the POST expression in search.php so i can input a custom url. I dont know why they have this as default. Or at least an option to switch it off.

Why would you remove that?
(2016-10-25, 11:56 AM)Neeeeeeeeeel.- Wrote: [ -> ]
(2016-10-25, 11:21 AM)metulburr Wrote: [ -> ]
Quote:but it's not THAT easy because MyBB search only accepts POST requests and I don't want to change core files in order to make this work.
I have already removed the POST expression in search.php so i can input a custom url. I dont know why they have this as default. Or at least an option to switch it off.

Why would you remove that?

Because i explicitly want to be able to make search links at the top. And the SID encapsulation only exist for 24 hours afterwords. 


Thats the only way i can have special links in my header such as My discussion (egosearch) for each user, which is for me....
http://python-forum.io/search.php?action...ads2&uid=1
http://python-forum.io/search.php?action=finduserthreads2&uid=1
and run my own functions for search
Now, your search.php is an excellent target for layer 7 DDoS attacks.
Well if mybb had basic search functions such as an egosearch option like phpbb, or a plugin to add somehow replicate this via SID, i would use that instead. Somehow the unread posts plugin and the unanswered post plugin bypasses this, but i am not sure how.