Help
Posted: Tue Oct 25, 2005 10:39 am
Is there any way for someone who is using Freewebs.com as their host to use the data collected on there guild from here? I dont think my freewebs.com account uses php
Any help whould be great.

Plus no CGI or Perl Scripts, so it's kind of hard for it do be implemented on your Freeweb.com site.What about MySQL, MSACCESS, and PHP?
Unfortunately, Freewebs does not offer these functions.
Code: Select all
<?php
//
// Rostertest.php
//
// Sample guild export downloader and display
// You may use this script as you wish. This is only some sample code
// provided to help get a jumpstart!
//
// Created: february 1st 2005
//
// Author: Cooper Sellers aka Rollie - Bloodscalp
//
//
//
//
$local_directory = "./"; // this is the directory where your local files
// will be written to and read from. Make sure
// you have WRITE priveledges on this directory
$guild_id = 364279; // get this number from the link posted on the
// guilddisplay.php page
//
// Remember to check the status file so that you are not pulling data
// more than once per day
//
$localstatusfile = $local_directory . "status.txt";
$infile = fopen ($localstatusfile, "r");
$current_timestamp = 0;
if (!$infile)
{
echo "<p>No status file available, assuming this is the first run<br>";
}
else
{
// read our status file time
$buffer = fgets($infile, 4096);
$current_timestamp = trim( $buffer );
echo '<body {BODY} width="750" bgcolor="black" link="darkgoldenrod" vlink="firebrick" text="darkgoldenrod"><p align="center"> Local status file reads : ' . strftime("%m/%d/%y %H:%M:%S",$current_timestamp) . '<br>';
}
fclose( $infile ); // close our local status file
$filename = "http://www.warcraftrealms.com/exports/status.txt";
$infile = fopen ($filename, "r"); // open remote status file
if (!$infile)
{
echo "<p>Unable to open status file.<br>";
exit;
}
$remote_timestamp = 0;
if(!feof ($infile)) // only 1 read should be needed for the status file
{
$buffer = fgets($infile, 4096);
$remote_timestamp = trim( $buffer );
echo 'Remote status file reads : ' . strftime("%m/%d/%y %H:%M:%S",$remote_timestamp) . '<br>';
}
fclose( $infile ); // close the remote status file
if( $remote_timestamp - $current_timestamp > 86400 ) // 1 day = 60*60*24
{
//
// We can do a full get
//
// write our new status file
$outfilename = $local_directory . "status.txt";
$outfile = fopen($outfilename, "w");
if( !$outfile )
{
echo "<p>Unable to open save file => " . $outfilename . "<br>";
exit;
}
fputs($outfile, $buffer);
fclose($outfile);
//
// Now get our guild roster file
//
$filename = 'http://www.warcraftrealms.com/exports/guildexport.php?guildid=' . $guild_id;
$infile = fopen ($filename, "r");
if (!$infile)
{
echo "<p>Unable to open remote file.<br>\n";
exit;
}
$outfilename = $local_directory . "guildroster.csv";
$outfile = fopen($outfilename, "w");
if( !$outfile )
{
echo "<p>Unable to open save file => " . $outfilename . "<br>\n";
exit;
}
while (!feof ($infile))
{
$buffer = fgets($infile, 4096);
fputs($outfile, $buffer);
}
fclose($outfile);
fclose($infile);
}
//
// Now let's just output our roster as it's given
//
$filename = $local_directory . "guildroster.csv";
$infile = fopen ($filename, "r");
if (!$infile)
{
echo "<p>Unable to open local roster file.<br>";
exit;
}
// do one read to get the header
$buffer = fgets($infile, 4096);
// read the entries
echo '<br><table align="center" width="750" border="3" bordercolor="firebrick" cellspacing="5" cellpadding="3" cellspacingcolor="firebrick" frame="void" rules="rows"><tr><th align="center">Name</th><th align="center">Race</th><th align="center">Class</th><th align="center">Level</th><th align="center">Last Seen</th><th align="center">Guild Rank</th><th align="center">PVP Rank</th></tr>';
while (!feof ($infile))
{
$buffer = fgets($infile, 4096);
list( $name, $race, $class, $level, $last_seen, $guild_rank, $pvp_rank ) = explode(",",$buffer);
$member_count++;
{
echo '<tr><td align="center">' . $name . '</td><td align="center">' . $race . '</td><td align="center">' . $class . '</td><td align="center">' . $level . '</td><td align="center">' . $last_seen . '</td><td align="center">' . $guild_rank . '</td><td align="center" >' . $pvp_rank . '</td></tr align="center">';
}
}
echo '</table>';
echo '<table class="content"><tr><td class="topcontent"><center>Statistics</center><tr><td class="content" align="center">';
echo "Total Members: ";
echo "$member_count"-1;
echo '<p></center>';
// don't forget our credit link =)
echo "Guild data provided by <a href='http://www.warcraftrealms.com/'>WarcraftRealms.com</a>.<br>Huge Thanks to Rollie for starting this script!";
?>
Code: Select all
$pvpranktext[5] = "Private";
$pvpranktext[6] = "Corporal";
$pvpranktext[7] = "Sergeant";
$pvpranktext[8] = "Master Sergeant";
$pvpranktext[9] = "Sergeant Major";
$pvpranktext[10] = "Knight";
$pvpranktext[11] = "Knight-Lieutenant";
$pvpranktext[12] = "Knight-Captain";
$pvpranktext[13] = "Knight-Champion";
$pvpranktext[14] = "Lieutenant Commander";
$pvpranktext[15] = "Commander";
$pvpranktext[16] = "Marshal";
$pvpranktext[17] = "Field Marshall";
$pvpranktext[18] = "Grand Marshall";
Code: Select all
<td align="center" >' . $pvp_rank . '</td>
Code: Select all
<td align="center" >' . $pvpranktext[$pvp_rank] . '</td>
Code: Select all
$pvpranktext[5] = "Private";
$pvpranktext[6] = "Corporal";
$pvpranktext[7] = "Sergeant";
$pvpranktext[8] = "Master Sergeant";
$pvpranktext[9] = "Sergeant Major";
$pvpranktext[10] = "Knight";
$pvpranktext[11] = "Knight-Lieutenant";
$pvpranktext[12] = "Knight-Captain";
$pvpranktext[13] = "Knight-Champion";
$pvpranktext[14] = "Lieutenant Commander";
$pvpranktext[15] = "Commander";
$pvpranktext[16] = "Marshal";
$pvpranktext[17] = "Field Marshall";
$pvpranktext[18] = "Grand Marshall";
Code: Select all
$pvpranktext[1] = "Private";
$pvpranktext[2] = "Corporal";
$pvpranktext[3] = "Sergeant";
$pvpranktext[4] = "Master Sergeant";
$pvpranktext[5] = "Sergeant Major";
$pvpranktext[6] = "Knight";
$pvpranktext[7] = "Knight-Lieutenant";
$pvpranktext[8] = "Knight-Captain";
$pvpranktext[9] = "Knight-Champion";
$pvpranktext[10] = "Lieutenant Commander";
$pvpranktext[11] = "Commander";
$pvpranktext[12] = "Marshal";
$pvpranktext[13] = "Field Marshall";
$pvpranktext[14] = "Grand Marshall";
Code: Select all
$pvprank2 = $pvprank-4;
Code: Select all
$pvpranktext[$pvprank]
Code: Select all
$pvpranktext[$pvprank2]