Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> BB2Nuke
Author Message
nuken
RavenNuke(tm) Development Team



Joined: Mar 11, 2007
Posts: 2024
Location: North Carolina

PostPosted: Wed Feb 29, 2012 4:51 pm Reply with quote

I have been working on a Twitter type hashtag mod for the forums and was wondering if this is something users would be interested in? If you are not familiar with hashtags, they are any word that you place the # sign in front of to link to other posts with the same hashtag. It is basically a lazy mans tag system. The mod I am working on finds these hashtags and links them to a keyword search in the forum. Give me some feedback so I will know if this is worth the time to test and finish it.

_________________
Tricked Out News 
View user's profile Send private message Send e-mail Visit poster's website
spasticdonkey
RavenNuke(tm) Development Team



Joined: Dec 02, 2006
Posts: 1693
Location: Texas, USA

PostPosted: Thu Mar 01, 2012 11:01 am Reply with quote

Sounds kinda cool, how exactly would it work, just use them within your post? If you use hashes within posts are they "clickable"? I've wanted something like that for this site, so support could tag threads.#browsercache #mysqli #upgrade might be some handy ones recently.
 
View user's profile Send private message Visit poster's website
nuken







PostPosted: Thu Mar 01, 2012 11:47 am Reply with quote

That is how it works. as long as there is a space in front of the # sign like so #hashtag
That word will be linked to a search. I have it on my site forums. Here is a demo using the hashtag #forummod that links to 2 other forums with the same hashtag [ Only registered users can see links on this board! Get registered or login! ]
 
spasticdonkey







PostPosted: Thu Mar 01, 2012 12:24 pm Reply with quote

Cool. Only suggestion i might have is a minimum string length for tags so you don't end up with tags like #1, #2, etc. I would think a hash should be at least 3 characters.
 
nuken







PostPosted: Thu Mar 01, 2012 12:33 pm Reply with quote

Good point.
 
eldorado
Involved
Involved



Joined: Sep 10, 2008
Posts: 424
Location: France,Translator

PostPosted: Thu Mar 01, 2012 4:22 pm Reply with quote

Very good thing and outstanding mod... Might I suggest you add this mod on raven's forums?
This is perfect to speed up #search in #ravenphpscripts #forums Smile Smile Smile

Would be very good if you add something like @@user and redirects to the user's posted posts Very Happy

_________________
United-holy-dragons.net (My RN site)- Rejekz(cod4 clan) - gamerslounge 
View user's profile Send private message Visit poster's website MSN Messenger
Guardian2003
Site Admin



Joined: Aug 28, 2003
Posts: 6799
Location: Ha Noi, Viet Nam

PostPosted: Thu Mar 01, 2012 4:48 pm Reply with quote

I like this idea A LOT! So much so, I'd like to volunteer to alpha test, possibly assist in development if you need a hand.
It sounds like it might work in a similar fashion to mediawiki tags where you use a {{keyword}} to link to related content?

I would agree with Spastic regarding a minimum length. I presume there would also be some mechanism to prevent duplicate hashtags being created and that 'links' would only be internal.
 
View user's profile Send private message Send e-mail
nuken







PostPosted: Fri Mar 02, 2012 8:01 am Reply with quote

Cool. I will work on the minimum length and do some more testing.
 
nuken







PostPosted: Fri Mar 02, 2012 12:16 pm Reply with quote

Anyone that wants to test it, here are the directions.

Open modules/Forums/viewtopic.php and find:
Code:
 $message = $postrow[$i]['post_text'];


After add:
Code:
      $message = preg_replace('/(^|\s)#([a-z0-9_-]{3,}+)/i', '$1<a href="modules.php?name=F orums&amp;file=search&amp;search_keywords=$2&amp;mode=results">#$2</a>', $message);



You will need to remove the space between the F and the o in Forums.
 
Guardian2003







PostPosted: Fri Mar 02, 2012 1:41 pm Reply with quote

Nice!
 
nuken







PostPosted: Fri Mar 02, 2012 3:09 pm Reply with quote

This is the code to use the @someone author search

Code:


$message = preg_replace('/(^|\s)@([a-z0-9_-]{3,}+)/i', '$1<a href="modules.php?name=F orums&amp;file=search&amp;search_author=$2&amp;mode=results">@$2</a>', $message);


Again, you will have to remove the space between the F and the o in Forum.

This mod may be better used on the posting side of it so a jquery dropdown list of actual users could be used. That is for another day though.
 
Guardian2003







PostPosted: Fri Mar 02, 2012 3:31 pm Reply with quote

They say the simplest idea's are the best. I was thinking of all sorts of technical things when you first mentioned this but it works a treat.
 
nuken







PostPosted: Fri Mar 02, 2012 3:43 pm Reply with quote

I like it because it's simple, easy and on the output side of the database so there is not a security risk...
 
eldorado







PostPosted: Sat Mar 03, 2012 6:26 am Reply with quote

cool , @author will be very very good for my forums to refer to someone else's post Smile
 
Guardian2003







PostPosted: Sat Mar 03, 2012 9:17 am Reply with quote

eldorado wrote:
cool , @author will be very very good for my forums to refer to someone else's post Smile

In that case you might want to use @author-username otherwise you'll have a link that isn't a unique search term
 
nuken







PostPosted: Sat Mar 03, 2012 10:33 am Reply with quote

The code I posted above for the @username should work with just the @username because it is doing an author search instead of a keyword search like the hash tag one is.
 
Guardian2003







PostPosted: Sun Mar 04, 2012 3:14 am Reply with quote

Doh! - sorry I hadn't spotted that Smile
 
eldorado







PostPosted: Sun Mar 04, 2012 12:05 pm Reply with quote

I imagine that #{multiple queries strings} isn't supported and only #{multiple will be parsed? Defeats the purpose of tags btw , but just an interresting feature to be implement differently , (through bbcodes perhaps) Smile

Now that we are doing this , is this possible to make it work for articles ,an addition for "Tricked Out News" for example using site wide search Smile (throwing my 2.cents into an already overworked mind Smile Smile Smile
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> BB2Nuke

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©