Some sample guild export code
I'm in Gideon's boat here. I'll try to describe my situation and maybe it will help more than the two of us.
I have purchased hosting at globat.com and have access to their tools. They run PHP, MySQL, and a host of other eCommerce things (that part I really don't care about). I have access to tools like phpMyAdmin (even though I have zilch experience in using it).
I've done my best to understand what exactly I need to do with the code listed in this forum and turn it into a viable guild roster page as it's displayed here on your site.
I do believe I have access to all the tools I need.
But like Gideon, I have zippo experience in programming (minus HTML), I haven't used PHP in the past and no experience with MySQL. I can write fairly efficient HTML code and understand it.
I guess I'd just like to be able to grasp how I take this CSV file and turn it into what you display on your site.
What I do have is energy and enthusiasm to learn what I need to do so I can present my guild's roster in a professional manner.
Thank you very much for any help and assistance you can provide.
Raffi
Officer of "The Unnamed"
Cenarius
I have purchased hosting at globat.com and have access to their tools. They run PHP, MySQL, and a host of other eCommerce things (that part I really don't care about). I have access to tools like phpMyAdmin (even though I have zilch experience in using it).
I've done my best to understand what exactly I need to do with the code listed in this forum and turn it into a viable guild roster page as it's displayed here on your site.
I do believe I have access to all the tools I need.
But like Gideon, I have zippo experience in programming (minus HTML), I haven't used PHP in the past and no experience with MySQL. I can write fairly efficient HTML code and understand it.
I guess I'd just like to be able to grasp how I take this CSV file and turn it into what you display on your site.
What I do have is energy and enthusiasm to learn what I need to do so I can present my guild's roster in a professional manner.
Thank you very much for any help and assistance you can provide.
Raffi
Officer of "The Unnamed"
Cenarius
Well, you are probably closer than you realize to being able to do it then. Do you have much/any database experience? I guess it wouldn't hurt to throw together an SQL script that would create the necessary database tables and such. Might make it a little easier to get up and running.
phpbb:phpinfo()
Getting csv with ASP
Hi all
Has anyone got this working with ASP ???
I know it should be very easy, i just have no idea how to download the csv file with ASP, the rest i can do myself, like import that csv into a database and setup a page to view it etc, but i have no idea how to pull the csv file itself.
Any help would be much appreciated,
Thanks in advance
Has anyone got this working with ASP ???
I know it should be very easy, i just have no idea how to download the csv file with ASP, the rest i can do myself, like import that csv into a database and setup a page to view it etc, but i have no idea how to pull the csv file itself.
Any help would be much appreciated,
Thanks in advance
Hello,
i'm still a PHP newbee but i like to filter the results.
Is there a way to do this.
For example:
Just show all priest >50 or members online <30 days and so on.
Can someone write me an example for this?
Im using this script (see in action http://www.marcelmertens.de/temp/guilde.php)
i'm still a PHP newbee but i like to filter the results.
Is there a way to do this.
For example:
Just show all priest >50 or members online <30 days and so on.
Can someone write me an example for this?
Im using this script (see in action http://www.marcelmertens.de/temp/guilde.php)
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: 1/27/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 = 102065; // 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 '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 '<table style="margin-left: auto; margin-right: auto; text-align: left; width: 80%; height: 60px;" border="1" cellpadding="0" cellspacing="0"><tbody><tr><td style="font-weight: bold; font-family: Verdana;"><small>Name</small></td><td style="font-weight: bold; font-family: Verdana;"><small>Rasse</small></td><td style="font-weight: bold; font-family: Verdana;"><small>Klasse</small></td><td style="font-weight: bold; font-family: Verdana;"><small>Level</small></td><td style="font-weight: bold; font-family: Verdana;"><small>Rank</small></td></tr><tr>';
while (!feof ($infile))
{
$buffer = fgets($infile, 4096);
list( $name, $race, $class, $level, $last_seen, $rank ) = explode(",",$buffer);
echo '<tr><td style="font-family: Verdana;"><small>' . $name . '</small></td><td style="font-family: Verdana;"><small>' . $race . '</small></td><td style="font-family: Verdana;"><small>' . $class . '</small></td><td style="font-family: Verdana;"><small>' . $level . '</small></td><td style="font-family: Verdana;"><small>' . $rank . '</small></td></tr>';
}
echo '</table>';
//Printing out the member data
for($i = 1;$i < count($d_file);$i++)
{
list( $name, $race, $class, $level, $last_seen, $rank ) = explode(",", $d_file[$i]);
echo '<tr class="content"><td class="content">' . $name . '</td><td class="content">' . $race . '</td><td class="content">' . $class . '</td><td class="content">' . $level . '</td><td class="content">' . $last_seen . '</td><td class="content">' . $rank . '</td></tr>';
}
echo '</table>';
//The first line contains no member data
$member_count = count($d_file) - 1;
echo '<table class="content"><tr><td class="topcontent"><center>Statistics</center><tr><td class="content">';
echo 'Total Members: ';
echo "$member_count";
echo '</center>';
echo "Guild data provided by <a href='http://www.warcraftrealms.com/'>WarcraftRealms.com</a>.";
echo '</td></tr></table>';
?>
All you would need to do is customize your output based on the results from this statement:
Which is located near the bottom in the Printing Out The Member Data section.
Code: Select all
list( $name, $race, $class, $level, $last_seen, $rank ) = explode(",", $d_file[$i]);
phpbb:phpinfo()
Could maybe somebody help me? i don?t get.
http://berentirsidh.fbhosting.com/census.php
It should be work, but it don?t. I also don?t get an error but the Datas are missing
What did I wrong? What could be the reason?
Another question: Does somebody know a free webspace provider where the script is running? Maybe I don?t have all permissions that i need, but on the other hand that cant be the reason because I dont get a permission error.
http://berentirsidh.fbhosting.com/census.php
It should be work, but it don?t. I also don?t get an error but the Datas are missing

What did I wrong? What could be the reason?
Another question: Does somebody know a free webspace provider where the script is running? Maybe I don?t have all permissions that i need, but on the other hand that cant be the reason because I dont get a permission error.
I use the same script like "Raducanu" with the difference that i had to rename the csv files to txt. But why dont the member counter works and the "Last Seen" Output?
Could somebody hlp me please?
TANKS!!
http://berentirsidh.fbhosting.com/test3.php
Could somebody hlp me please?
TANKS!!
http://berentirsidh.fbhosting.com/test3.php
Sorry,this is my actual code:
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: 1/27/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 = 153595; // 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 '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.txt";
$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.txt";
$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 '<table style="margin-left: auto; margin-right: auto; text-align: left; width: 80%; height: 60px;" border="1" cellpadding="0" cellspacing="0"><tbody><tr><td style="font-weight: bold; font-family: Verdana;"><small>Name</small></td><td style="font-weight: bold; font-family: Verdana;"><small>Rasse</small></td><td style="font-weight: bold; font-family: Verdana;"><small>Klasse</small></td><td style="font-weight: bold; font-family: Verdana;"><small>Level</small></td><td style="font-weight: bold; font-family: Verdana;"><small>Zuletzt gesehen</small></td><td style="font-weight: bold; font-family: Verdana;"><small>Rang</small></td></tr><tr>';
while (!feof ($infile))
{
$buffer = fgets($infile, 4096);
list( $name, $race, $class, $level, $last_seen, $rank ) = explode(",",$buffer);
echo '<tr><td style="font-family: Verdana;"><small>' . $name . '</small></td><td style="font-family: Verdana;"><small>' . $race . '</small></td><td style="font-family: Verdana;"><small>' . $class . '</small></td><td style="font-family: Verdana;"><small>' . $level . '</small></td><td style="font-family: Verdana;"><small>' . $last_seen . '</small></td><td style="font-family: Verdana;"><small>' . $rank . '</small></td></tr>';
}
echo '</table>';
//Printing out the member data
for($i = 1;$i < count($d_file);$i++)
{
list( $name, $race, $class, $level, $last_seen, $rank ) = explode(",", $d_file[$i]);
echo '<tr><td>' . $name . '</td><td>' . $race . '</td><td>' . $class . '</td><td>' . $level . '</td><td>' . $last_seen . '</td><td>' . $rank . '</td></tr>';
}
echo '</table>';
//The first line contains no member data
$member_count = count($d_file) - 1;
echo '<table class="content"><tr><td class="topcontent"><center>Statistics</center><tr><td class="content">';
echo 'Total Members: ';
echo "$member_count";
echo '</center>';
echo "Guild data provided by <a href='http://www.warcraftrealms.com/'>WarcraftRealms.com</a>.";
echo '</td></tr></table>';
?>
Remove all of this
Change this:
to this:
Code: Select all
//Printing out the member data
for($i = 1;$i < count($d_file);$i++)
{
list( $name, $race, $class, $level, $last_seen, $rank ) = explode(",", $d_file[$i]);
echo '<tr><td>' . $name . '</td><td>' . $race . '</td><td>' . $class . '</td><td>' . $level . '</td><td>' . $last_seen . '</td><td>' . $rank . '</td></tr>';
}
echo '</table>';
//The first line contains no member data
$member_count = count($d_file) - 1;
Code: Select all
while (!feof ($infile))
{
$buffer = fgets($infile, 4096);
list( $name, $race, $class, $level, $last_seen, $rank ) = explode(",",$buffer);
echo '<tr><td style="font-family: Verdana;"><small>' . $name . '</small></td><td style="font-family: Verdana;"><small>' . $race . '</small></td><td style="font-family: Verdana;"><small>' . $class . '</small></td><td style="font-family: Verdana;"><small>' . $level . '</small></td><td style="font-family: Verdana;"><small>' . $last_seen . '</small></td><td style="font-family: Verdana;"><small>' . $rank . '</small></td></tr>';
}
Code: Select all
while (!feof ($infile))
{
$buffer = fgets($infile, 4096);
list( $name, $race, $class, $level, $last_seen, $rank ) = explode(",",$buffer);
$member_count++;
echo '<tr><td style="font-family: Verdana;"><small>' . $name . '</small></td><td style="font-family: Verdana;"><small>' . $race . '</small></td><td style="font-family: Verdana;"><small>' . $class . '</small></td><td style="font-family: Verdana;"><small>' . $level . '</small></td><td style="font-family: Verdana;"><small>' . $last_seen . '</small></td><td style="font-family: Verdana;"><small>' . $rank . '</small></td></tr>';
}
phpbb:phpinfo()
Sorry, my english is not the best 
Okay, i will try to explain what I mean. When I execute the script (by surfing to http://berentirsidh.fbhosting.com/test3.php) the script is looking in the database of warcraftrealms for a newer guildrost,right?
I don?t need to hold it up to date manually,right?

Okay, i will try to explain what I mean. When I execute the script (by surfing to http://berentirsidh.fbhosting.com/test3.php) the script is looking in the database of warcraftrealms for a newer guildrost,right?
I don?t need to hold it up to date manually,right?