Updating the Roster?

Questions and discussions on development tools for WarcraftRealms
Locked
Koljia
Posts: 2
Joined: Sat Jul 14, 2007 9:37 am

Updating the Roster?

Post by Koljia »

Hello I have implemented your Roster exporting code to my website and I cant wait to use it.

Unfortunatly my guild roster doesnt seem to update? The guild is a new guild that did happen to be created on the 10th. Does WCR update the information every so often?

Thank you for time.
http://www.loaded-dentarg.com/roster/roster.php

And this is the code.

Code: Select all

<php> 86400 &#41; //  1 day = 60*60*24
    &#123;
        //
        //  We can do a full get
        //

        //  write our new status file
        $outfilename = $local_directory . "status.txt";
        $outfile = fopen&#40;$outfilename, "w"&#41;;
        if&#40; !$outfile &#41;
        &#123;
            echo "<p>Unable to open save file => " . $outfilename . "<br>";
            exit;
        &#125;

        fputs&#40;$outfile, $buffer&#41;;
        fclose&#40;$outfile&#41;;

        //
        //  Now get our guild roster file
        //
        $filename = 'http&#58;//www.warcraftrealms.com/exports/guildexport.php?guildid=' . $guild_id;
        $infile = fopen &#40;$filename, "r"&#41;;
        if &#40;!$infile&#41;
        &#123;
            echo "<p>Unable to open remote file.<br>\n";
            exit;
        &#125;

        $outfilename = $local_directory . "guildroster.txt";
        $outfile = fopen&#40;$outfilename, "w"&#41;;
        if&#40; !$outfile &#41;
        &#123;
            echo "<p>Unable to open save file => " . $outfilename . "<br>\n";
            exit;
        &#125;

        while &#40;!feof &#40;$infile&#41;&#41;
        &#123;
            $buffer = fgets&#40;$infile, 4096&#41;;
            fputs&#40;$outfile, $buffer&#41;;
        &#125;

        fclose&#40;$outfile&#41;;
        fclose&#40;$infile&#41;;
    &#125;



    //
    //  Now let's just output our roster as it's given
    //
    $filename = $local_directory . "guildroster.csv";
    $infile = fopen &#40;$filename, "r"&#41;;
    if &#40;!$infile&#41;
    &#123;
        echo "<p>Unable to open local roster file.<br>";
        exit;
    &#125;

    //  do one read to get the header
    $buffer = fgets&#40;$infile, 4096&#41;;

    //  read the entries
    echo '<table border="1" cellpadding="0" cellspacing="0"><tbody><tr><td><small>Name</small></td><td><small>Race</small></td><td><small>Class</small></td><td><small>Level</small></td><td><small>Last Seen</small></td><td><small>Rank</small></td></tr><tr>';
    while &#40;!feof &#40;$infile&#41;&#41;
    &#123;
        $buffer = fgets&#40;$infile, 4096&#41;;
        list&#40; $name, $race, $class, $level, $last_seen, $rank &#41; = explode&#40;",",$buffer&#41;;

        echo '<tr><td><small>' . $name . '</small></td><td><small>' . $race . '</small></td><td><small>' . $class . '</small></td><td><small>' . $level . '</small></td><td><small>' . $last_seen . '</small></td><td><small>' . $rank . '</small></td></tr>';
    &#125;
    echo '</table>';
   
//Printing out the member data
   
   for&#40;$i = 1;$i </td>

User avatar
Rollie
Site Admin
Posts: 4783
Joined: Sun Nov 28, 2004 11:52 am
Location: Austin, TX
Contact:

Post by Rollie »

Guild rosters are updated best by downloading and taking a Census snapshot. See here for more info:

http://www.warcraftrealms.com/censusfaq.php
phpbb:phpinfo()

Koljia
Posts: 2
Joined: Sat Jul 14, 2007 9:37 am

Post by Koljia »

Great. I uploaded my .lua and it seems my CSV has disapeared from my ftp server.. :cry:

So sorry, but that was wierd.

Locked