Help
-
- Gear Dependent Squirrel
- Posts: 1471
- Joined: Tue Sep 06, 2005 6:22 am
- Location: Austin, TX
- Contact:
Most of the guild display codes (including mine) is in PHP, but according to the FAQ's at Freewebs.com (http://members.freewebs.com/page.jsp?page=faqs#mysql)
I did a quick search for a free hosting from Free-webhosts.com and 100Webhosting offers what you need:
http://www.100webspace.com/freeplan.html
Hope this helps
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.
I did a quick search for a free hosting from Free-webhosts.com and 100Webhosting offers what you need:
http://www.100webspace.com/freeplan.html
Hope this helps
Ok now I have a page up and running. The only change I want to do is have the number values for the pvp rank changed to the accuall rank. Since I am new to php, can some one make a suggestion? You can view the page at http://ioa.freefronthost.com/memberlist.php. Also here is the code I am using.
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!";
?>
What you can do is set up an array with the correct values, and then just index into that array based on the pvp rank value.
For example:
After you have declared that (like at the top), then you would just need to change
to
in the output section.
For example:
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>
phpbb:phpinfo()
Had to change
to
add
and change
to
For some reason it doesnt look at $pvprank as a number.
Hope this helps other ppl in the future.
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]
Hope this helps other ppl in the future.
whoa, it's been a few years since i've done any programming, and i've never programmed in php, but i think i got everything worked out and in the right place:
http://warcraft.kotls.com/rostertest.php
It's not as nice looking as this (edited manually each week) but we're getting too big for manual edits.
http://warcraft.kotls.com/wowmembers.htm
Thanks for all the help and information!
http://warcraft.kotls.com/rostertest.php
It's not as nice looking as this (edited manually each week) but we're getting too big for manual edits.
http://warcraft.kotls.com/wowmembers.htm
Thanks for all the help and information!