pornophobic Posted August 20, 2009 Share Posted August 20, 2009 Hi. This is my first post, won't be my last though. I found this site searching for help on my problem and decided to join up and get help here (and give it where I can.) Anyways, on to my problem... (I've been at this one for a good four hours now, to no avail.) I'm trying to create a hack for a chatroom I'm using (Flashchat 5.0.10) It's somewhat integrated with the phpfox 2 beta, the purpose of this hack is a "for-fun" filter where users can type a certain string ('xuserx' in this case) and the result would be, for the viewer, their own user name. I.E: input: xuserx is awesome output: $username is awesome So far, I've been able to retrieve data from the user's own cookie and have it print this into the chat. Would it be possible to have the chat read the viewer's cookie and print that data? or would it be better to actually use flashchat as a closed CMS integrated right into the phpfox database? I'm trying to use cookies first as it would take less coding at this point. Any ideas (pseudo-code is fine for me ) Quote Link to comment https://forums.phpfreaks.com/topic/171215-echo-cookie-data-per-user-in-chatroom/ Share on other sites More sharing options...
MadTechie Posted August 20, 2009 Share Posted August 20, 2009 Hello and welcome to PHPFreaks, Personally I would do the replace xuserx for $username during the output stage, however I don't use Flashchat so I have no idea how it works, From what you have said I'm going to assume the user inputs a message the that's written to a database and then Flashchat read from the database to display the messages. So really my question is where is PHP involved ? as I'll need to know what entry points you have available, even if you Flashchat reads data from a data file for messages that would be a possible entry point. Quote Link to comment https://forums.phpfreaks.com/topic/171215-echo-cookie-data-per-user-in-chatroom/#findComment-902896 Share on other sites More sharing options...
MadTechie Posted August 20, 2009 Share Posted August 20, 2009 I just downloaded a copy to take a peek, in the message.php file just update the parse function to something like this function parse($txt) { if($this->command != 'usrp') { $txt = $this->replaceBadWord(htmlspecialchars($txt)); if($this->command == 'msg') { $txt = $this->parseURL($txt); $txt = $this->keyWords($txt); } } return $txt; } function keyWords($txt) { $txt = str_replace("xuserx",$_COOKIE['UserName'],$txt); return $txt; } Quote Link to comment https://forums.phpfreaks.com/topic/171215-echo-cookie-data-per-user-in-chatroom/#findComment-902901 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.