Hi im working on a forum and I have alomost finished it but i want a user quote system like twitter and facebook with the @ sign to start it off, however even though im good at php coding and have done a code with preg_match and preg_replace to change them quotes to link.
For example if someone wrote "to quote @123456 which he said this." what would come up is "to quote 123456 which he said this." and the 123456 would be a link to their profile.
I also did the username change and got this to work but when I did that the code only got the first quoted id number and if there was two users quoted in one comment then it would have the same username going to two different profile links.
What I want to do is what facebook does, I want that @123456 link to change to the user's username. Lets say the id "123456" goes to the user "Test User" then the link would be: Code: <a href="http://tester.com/123456">Test User</a>
What I need help with is how to make a function that gets the comment looks through it for each quoted user and looks in the database for that id number and then prints out a link to their profile with the link having their username showing on the page and a link like "http://tester.com/<userid>".
For example if the php function was called "comment" then i would do this:
Code: print comment('to quote @123456 and @654321 which they said this.');
And what prints out on the page is: to quote Test User and Guest User which they said this.
And the html code would be:
Code: to quote <a href="http://tester.com/123456">Test User</a> and
<a href="http://tester.com/654321">Guest User</a> which they said this.
If anyone can help me please reply Thank You.
Shuffle Array
Hi,I am writing a script for a game that needs players to randomly be assigned a target (another player) in a loop so that each player is matched with someone other than who has them. See below:Andy
Keeping track of php uploads
Hello all.I was looking at the way PHP handles file uploads.It seems that PHP uses a temporarily directory and file name for file uploads. e.g. /var/www/virtual/SITE/phptmp/phpMhOniLThis file is
Calling All PHPFREAKS Blackberry Users
Are you a member of PHPFreaks and have a blackberry? Well RIM just recently released Blackberry Messenger 5.0! What does this mean for you, the user? It means that you have all sorts of cool new
PHP Include w/If IE Condition Statement?
I was having a problem with Internet Exploder (big surprise, right?) displaying my drop down menus improperly. I found a solution that works ... I have a PHP file that I place as an include on all my
Losing 'page' data
I have this code that allows me to update my database. But after updating, I lose the $_GET['page'] value in the browser. I need this value because it is passed when I go to other pages on the
C++ Http request?
Code:
Loosing changed contents when used FM REUSE_ALV_GRID_DISPLAY
Hi,
Help with PHP Calendar code...
Hello, I'm new to this forum and I'm glad I found it.I wrote this code for a PHP calendar as an assignment for college.It works fine, but I also want today's day to show in another color and I can't
matching numbers inside ( )
I know I can match numbers by just [0-9]+, so I thought matching numbers inside ( ) would be something like Code: [Select]/\([0-9]+\)/, but that doesn't work Can someone correct me please?
Sharing PHP Sessions Across Domains
I am in the process of writing a script to share a php session across various domains I have.The problem I have, is getting php to access the php session. It gives me a persmission error. It seems the