Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Jan 2012
    Posts
    2
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Integrating scripts

    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...

    PHP 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
          </
    td></tr
        {/if} 

    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.

  • #2
    Regular Coder
    Join Date
    Jun 2010
    Posts
    289
    Thanks
    63
    Thanked 8 Times in 8 Posts
    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:

    PHP Code:
    // CHAT

    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>".
           
    "</td></tr>";

    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.
    Last edited by XmisterIS; 01-10-2012 at 09:25 AM.

  • Users who have thanked XmisterIS for this post:

    Lavanaut (01-11-2012)

  • #3
    New to the CF scene
    Join Date
    Jan 2012
    Posts
    2
    Thanks
    1
    Thanked 0 Times in 0 Posts
    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.
    Last edited by Lavanaut; 01-11-2012 at 03:28 AM.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •