dcsimg
A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Forum News Export

  1. #1
    Junior Member
    Join Date
    Feb 2006
    Posts
    7

    Forum News Export

    I am using Hubert's IBP News Export to export the latest topics to a .php file, here is the code that it uses:

    <br>
    <?php


    # CONFIGURATION SECTION
    # SQL Database information concerns the database IPB is stored in

    // SQL Database Host Address
    $dbhost = 'localhost';

    // SQL Database Name
    $dbname = 'database name';

    // SQL Database Username
    $dbusername = 'database username';

    // SQL Database Password
    $dbpassword = 'database username password';

    // URL path to folder containing index.php of your forum (NO ENDING SLASH!)
    $forumpath = 'http://path/to/your/forum';

    // Forum ID to export posts from (look for the XX in index.php?showforum=XX part of the forums URL)
    $forumid = 'ID OF FORUM YOU WANT NEWS TO NE EXPORTED FROM';

    // Number or posts to export
    $posts = '10';

    # Recommended IPB 2.0 Only
    // Name of emoticon directory
    $emoticons = 'default';
    // Name of Image directory
    $img_dir = '1';

    # Code to export posts. Edit only template areas inbetween the Echo tags

    mysql_connect ($dbhost, $dbusername, $dbpassword);
    mysql_select_db ($dbname);
    $topics = mysql_query ("select* from ibf_topics where forum_id=".$forumid." order by start_date desc");
    $numberPosts = mysql_query ("select* from ibf_forums where id=".$forumid."");
    $maxposts = mysql_fetch_array($numberPosts);
    if ($maxposts['topics']<$posts) {$posts=$maxposts['topics'];}
    for ($i=0; $i <$posts; $i++)
    {
    $topicrow = mysql_fetch_array($topics);
    $titleid = $topicrow["tid"];
    $topictitle = ($topicrow["title"]);
    $postq = mysql_query ("SELECT * FROM `ibf_posts` where topic_id = ".$titleid." order by post_date");
    $postfetch = mysql_fetch_array($postq);
    $post = $postfetch["post"];
    $authorid = $postfetch["author_id"];
    $unixdate = $topicrow["start_date"];
    $date = date("F jS, Y",$unixdate);
    $author = $topicrow["starter_name"];
    $post = str_replace('<#EMO_DIR#>', $emoticons, $post);
    $post = str_replace('<#IMG_DIR#>', $img_dir, $post);

    # Variable Explaination
    # '.$topictitle.' = Title of post
    # '.$post.' = The post text
    # '.$author.' = The author of the post
    # '.$authorid.' = User ID of author (for profile link)
    # '.$date.' = Date written
    # '.$titleid.' = Topic ID number

    # Change this to your forum's style sheet located in style_images \/
    echo ('

    <table width="100%" border="1" bordercolor="#7A7A7A">

    <img src="images/arr.gif"> <U><b><a href="'.$forumpath.'/index.php?showtopic='.$titleid.'">'.$topictitle.'</U></a></B><br><br /></td></div>


    <div align="left">'.$post.'</div><br>

    <center>Posted on <B>'.$date.'</B> by <a href="'.$forumpath.'/index.php?showuser='.$authorid.'"><B>'.$author.'</B></a> - <b><a href="'.$forumpath.'/index.php?showtopic='.$titleid.'">Comments</B></a></center><hr></table>
    ');
    }
    echo('<center><strong><a href="http://www.gta-ultra.net/index.php">IPB News Export By Hubert</a></center></strong>')
    ?>

    And to export it into a .php file, I just used:
    <?php include("Forum/ipbnews.php");

    but now I have a problem. How do I get this info into flash? I was thinking I'd make it export into a text file and then have flash read off it, but how would I get it to export to a text file, or is there another way of doing it?

    Thanks,
    Forsaken231

  2. #2
    Secret Agent
    Join Date
    Sep 2000
    Location
    San Francisco, CA
    Posts
    169
    This is kind of off topic. Check php threads for how to export from php to a file: either xml or text.
    Then concentrate on how to get that file back into flash.

Posting Permissions

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




Click Here to Expand Forum to Full Width

HTML5 Development Center