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, 06:30 PM
Post: #1
How to make hashtag on my website?
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

Ads

Find all posts by this user
Quote this message in a reply
02-18-2014, 06:41 PM
Post: #2
 
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.

Ads

Find all posts by this user
Quote this message in a reply
02-18-2014, 06:45 PM
Post: #3
 
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.
Find all posts by this user
Quote this message in a reply
02-18-2014, 07:00 PM
Post: #4
 
You can take helps from Google.
Find all posts by this user
Quote this message in a reply
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 


Forum Jump:


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