Twitist Forums
How to make hashtag on my website? - Printable Version

+- Twitist Forums (http://twitist.com)
+-- Forum: Twitter forums (/forum-1.html)
+--- Forum: Twitter Hashtag (/forum-2.html)
+--- Thread: How to make hashtag on my website? (/thread-96396.html)



How to make hashtag on my website? - Liam - 02-18-2014 06:30 PM

Hi I am making a small social network for my friends and me and I wanted to know: how do i make something like a hastag. It doesn't matter the Symbol, it could be a $ or a # or what ever, I just want to group messages based on hashtags. I know PHP, Html and a bunch of coding languages so I would love to know to write this in code. If you see any online, a tutorial would be very appreciated.
Thanks a lot
Liam


- EddieJ - 02-18-2014 06:41 PM

You don't want to "make hashtag" on your website.

You want to "group messages based on hashtags".

You want it to be "#" (not "$") because the users will be typing that in and that's what they are used to from other sites.

How you would do the grouping would depend on exactly how you implement your network.


- Audrey - 02-18-2014 06:45 PM

1. Navigate to the Twitter homepage. Click the "Sign In" link in the top right corner. Enter your Twitter account information and click "Sign In."
2. Click the "What's Happening" text input field. Enter your tweet, keeping it under 140 characters. Type "#" before the word you want to make a hashtag. For example, the Twitter trend of "Follow Friday" includes hashtag "#FF".
3. Click "Tweet" to send your tweet, including the hashtag.


- Nancey - 02-18-2014 07:00 PM

You can take helps from Google.


- Mister.Chrispy - 02-18-2014 07:16 PM

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!