This Forum has been archived there is no more new posts or threads ... use this link to report any abusive content
==> Report abusive content in this page <==
Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to make hashtag on my website?
02-18-2014, 07:16 PM
Post: #5
 
I would say learn some more PHP, and MySQL since you'll want databases to store your messages. Then with some basic regular expressions you can extract #hashtagged words and convert them to links to search for the #hashtag when displaying a message and some basic MySQL queries to search for messages that contain said #hashtag.

Maybe
<?php
function hashToAnchor( $message ) {
return preg_replace( '/#(\w.)/g' , '<a href = "/search?q=${1}' , $message );
}
?>
To add links to messages

and maybe
<?php
$q = $_GET['q'];
mysql_query( "SELECT * FROM table WHERE message LIKE \"%#$q%\"");
?>
to retrieve messages containing a certain hash tag


Sample code is incomplete and probably inaccurate, just something to (hopefully) point you in the right direction on your journey into databases and searching. Good luck!
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
How to make hashtag on my website? - Liam - 02-18-2014, 06:30 PM
[] - EddieJ - 02-18-2014, 06:41 PM
[] - Audrey - 02-18-2014, 06:45 PM
[] - Nancey - 02-18-2014, 07:00 PM
[] - Mister.Chrispy - 02-18-2014 07:16 PM

Forum Jump:


User(s) browsing this thread: 1 Guest(s)