View Full Version : Integrating scripts

01-10-2012, 06:00 AM
Hello, I am trying my best to integrate my Social Engine 4 users database to Flash Chat by tufat.

The only thing I can find that might work is this code...

{* CHAT*}
{if $user->level_info.level_message_allow != 0}
<tr><td class='menu_item' nowrap='nowrap'>
<a href='flashchat/flashchat.php?username={$user->user_info.user_username}' class='menu_item' target="_blank">Chat</a>

Though, this PHP code is older then what SE4 requires. I don't know how I would fix this, I've tried a lot of different things my PHP knowledge isn't very vast.

I would like to do it the most legit way possible, without many security holes. Social Engine hasn't given me any support on this.

Thank you so much in advance to anyone who tries to help me.

01-10-2012, 10:20 AM
I've never seen that style of writing PHP before, and I'm not sure what {* CHAT *} is supposed to do except cause PHP to throw an error! I assume it is meant to be a comment.

Firstly, I would re-format it something like this:


if ($user->level_info.level_message_allow != 0)
$username = $user->user_info.user_username;

echo "<tr><td class='menu_item' nowrap='nowrap'>".
"<a href='flashchat/flashchat.php?username=$username' class='menu_item' target='_blank'>Chat</a>".

The only reason why I put the html inside a string is that I personally don't like scripts which switch between PHP and ordinary markup throughout the script - it rapidly gets confusing and ugly especially if the script is long.

01-11-2012, 04:25 AM
I believe it was going to work but Flash Chat has a script built into it that doesn't allow direct login, I suppose because anyone could do it and since I'm going to have subscriptions, it will be difficult. I will need to figure out how to script the Social Engine login into the Flash Chat database. How would I go about scripting a specific section to read and create tables into another database based on the input? Any suggestion on that?

Again, thank you for all the help you have provided already, I really appreciate it.