I have been messing around with this for a while and got it todo things, Though i never truly understood it i just used code that worked and copy paste it. Thanks to this video i now understand what im actually writing thanks alot!
Thanks Mr Wilson, thanks for the feedback. Once in a blue moon people tell me to get a new mic but I use the Blue Snowball Mic which is above average quality. It sounds a lot richer and fuller than any headset type mic or even some studio quality mics. Perhaps I need to just increase the final volume for some viewers but I don't want to be louder than the rest of RUclips videos.
Thanks Adam. Question: I know you say we can search for the hastags, but something I ran across in MYSQL is that the # character is not searchable with like or full text. MYSQL simply ignores it. It would be nice if you could show how to actually search for that character. I have tried and its a no go. There are things one has to do to ones server config to override adding it and it is not possible on a shared hosting enviornment.
Hi Norman, in that case, before storing user text in database, you might need to convert any # found leading a word, into a specialized string like "[hash]". Doing that will avoid issues mentioned. Then when searching DB and rendering hashtag conversations on the hashtag.php page, you add [hash] in front of the $_GET url variable right before conducting the MySQL DB search. That will make everything synchronize correctly and the only place pound sign # would be seen is when you display conversations by converting [hash] to #. $str = str_replace("[hash]", "#", $str); // or vice versa anytime you need $str = str_replace("#", "[hash]", $str);
Adam Khoury I love that answer. Thanks, I cant wait to code it. Im adding hash tag ability to my free online journal/diary I wrote to help people have an online diary. Its personaldreamjournal.com. thanks again.
A great video. I got a lot from this. Would mentions also use the same logic?? An example is where i would mention your name in a comment and it converts it into a link and probably a notification is sent to the mentioned person??
A friend tagging system would be somewhat different because the way Facebook does it is when we are typing they wrote a program that evaluates our text in real time using Ajax to provide friend name tagging suggestions. When we select a friend to tag they wrap the name in a or or similar element. Then right before database INSERT they must be evaluating the strings to grab those specific elements and any names found in them get notification. Then on the display side when data is coming out of database to show in conversations they turn the element into a regular looking link. That is all a guess, I have no idea what their programs actually do.
i just disliked my own comment, i figured out how to apply this to my social network and it was SUPER easy, now if i could only figure out how to apply the url recognition in string script to my website
I bow at Adams feet. LOL. For real though, I love how you keep your scripts simple and explain in detail. I wish I would have found you months ago.
This 8 years old video help me more than 8x times.
Best Tutor i have ever come acrossed
I have been messing around with this for a while and got it todo things, Though i never truly understood it i just used code that worked and copy paste it.
Thanks to this video i now understand what im actually writing thanks alot!
You're a LEGEND Adam - amazing tutorial!
I hope you're doing well...I miss you.
works perfectly in one go..added my database search in it working 100%..Thanks ..
Best Tutor! #Adam Khoury ROCKS!
Thank you Adam for another usefull and well explained (as always) lesson.
Regex explanation, thumbs up for that Adam! keep it up man!
Well done Adam, and the sound is fine
Thanks Mr Wilson, thanks for the feedback. Once in a blue moon people tell me to get a new mic but I use the Blue Snowball Mic which is above average quality. It sounds a lot richer and fuller than any headset type mic or even some studio quality mics. Perhaps I need to just increase the final volume for some viewers but I don't want to be louder than the rest of RUclips videos.
Very well explained. I'm very grateful Adam. Thanks.
You made me love regex! Thank you!
I am from Ukraine and I love your videos! Thank you very much!
Thanks for the feedback. Give my love to the great Ukraine.
Nice .. Best of luck, From Nepal
you are a great teacher thank you
Good video keep up the good work
Awesoem vid mang! might be worth doing a trending script as well for a social network dude!
Love your video clips and your voice ^_^ thank a lot
explanation is awesome ...
nice regex breakdown!
Thanks man
OMG ! Greate tutorial ever !
Thanks for Adam.. more power .. :)
Thank you very much for the video
thanks man. you the best.
nice one mate 👍🏻😀
HEY ADAM.. AWESOME VIDEO AND THANKS FOR THE LOGIC - NOW I UNDERSTAND !! >> looking forward for next logic video .. (Y)
thanks, that is what i needed!
Thanks Bro!! Great Work!!
Thanks Adam. Question: I know you say we can search for the hastags, but something I ran across in MYSQL is that the # character is not searchable with like or full text. MYSQL simply ignores it. It would be nice if you could show how to actually search for that character. I have tried and its a no go. There are things one has to do to ones server config to override adding it and it is not possible on a shared hosting enviornment.
Hi Norman, in that case, before storing user text in database, you might need to convert any # found leading a word, into a specialized string like "[hash]". Doing that will avoid issues mentioned. Then when searching DB and rendering hashtag conversations on the hashtag.php page, you add [hash] in front of the $_GET url variable right before conducting the MySQL DB search. That will make everything synchronize correctly and the only place pound sign # would be seen is when you display conversations by converting [hash] to #.
$str = str_replace("[hash]", "#", $str);
// or vice versa anytime you need
$str = str_replace("#", "[hash]", $str);
Adam Khoury I love that answer. Thanks, I cant wait to code it. Im adding hash tag ability to my free online journal/diary I wrote to help people have an online diary. Its personaldreamjournal.com. thanks again.
awesome wid !!
Awesome bro
Would you recommend using this in a big social media type site?
I've never seen this $0 $1 syntax in php before. Is this a new feature of the language, or has it been around a while?
Good video
A great video. I got a lot from this. Would mentions also use the same logic?? An example is where i would mention your name in a comment and it converts it into a link and probably a notification is sent to the mentioned person??
A friend tagging system would be somewhat different because the way Facebook does it is when we are typing they wrote a program that evaluates our text in real time using Ajax to provide friend name tagging suggestions. When we select a friend to tag they wrap the name in a or or similar element. Then right before database INSERT they must be evaluating the strings to grab those specific elements and any names found in them get notification. Then on the display side when data is coming out of database to show in conversations they turn the element into a regular looking link. That is all a guess, I have no idea what their programs actually do.
Thanks!!
Thanks for all the great tutorials :) Any plans on mobile html5 app with offline capabilities?
In the sanitation part of this tutorial, what are the advantages of the preg_replace here over other sanitation methods like htmlspecialchars() ?
great!!!
Man i was looking for this everywhere... thank you so much
Which editor do you use?
Oh Dreamweaver now i see haha
Can the hashtag contain space?
Do you reccommend MVC file structure? how does layering factor into your projects?
Nice!
thanks
Awesome video...
facebook @tag code tutorial please..
hi.i'm trying to validate this code :
RECEPICE N0 2345/MAT-SG-DAPOC-DC.
May you help me to validate it using regular expression?
Who is that chinese at the end?
im totally lost on how to apply this to my own website
i just disliked my own comment, i figured out how to apply this to my social network and it was SUPER easy, now if i could only figure out how to apply the url recognition in string script to my website
6,666 views right now lol
anyway how about adding it into the DB and display it as hashtag. Does it work the same?
Who wants to have spaces just add spaces at the end of character class "/#+([a-zA-Z0-9_ ]+)/"
Whic by your eye is after thsi '_' symbol.