1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Add data from remote php file in signature

Discussion in 'General PHP and MySQL Discussions' started by Dynamic, Jul 25, 2013.

  1. Dynamic

    Dynamic Well-Known Member

    Hello,

    Please note that I am not a coder by any means, and so far have gotten my information from Google.


    I would like to add a custom user field to user profiles where they can include a remote .txt file link (http://www.example.com/textfile.txt). This I am able to do not a problem.

    Then, I would like the text located in that file to be displayed in the users signature. I can get the raw data using a bit of php.

    Code:
    <?PHP
        $file = fopen("http://www.example.com/textfile.txt", "rb");
        $output = '';
        while (!feof($file)) {
            $output .= fread($file, 8192);
        }
        fclose($file);
        echo($output);
    ?>
    So, now that displays the remote text files text. Is there a way to do this by placing the code in the signature? So each users signature will display their chosen text file (in addition to their normal xenforo signature).

    And if possible, is there a way to format the text in bbcode?

    Thanks.
     
  2. Jeremy

    Jeremy XenForo Moderator Staff Member

    If you use BBCode to fetch it, it's a matter of running it through the parser. I have a "Comprehsive Guide" that should help you.
     
  3. Dynamic

    Dynamic Well-Known Member

    Hi King,

    Yes please, I am not a coder but a guide will most certainly help :)

    Thanks.
     
  4. Jeremy

    Jeremy XenForo Moderator Staff Member

    Last edited: Jul 26, 2013
    Dynamic likes this.
  5. Dynamic

    Dynamic Well-Known Member

    Thanks King :D
     

Share This Page