Some sample guild export code
I get the guild info from a guild info request. I need to do further testing on this to be sure as it might not get characters if you do not have the 'Show offline characters' box checked on the guild tab.
If there are some members missing then this might be the case, or it might be due to a still troublesome bug I am trying to track down that causes not all guild members to always update correctly.
I had thought I had put this one behind me, but it may still be around =/
If there are some members missing then this might be the case, or it might be due to a still troublesome bug I am trying to track down that causes not all guild members to always update correctly.
I had thought I had put this one behind me, but it may still be around =/
phpbb:phpinfo()
help running cron job?
Hi all,
Great, great thread, I'm looking forward to testing these php files out on my guild's site.
I've never learned how CRONtas/jobs work, however.
Any tips on what command to enter in my CRONtab field? I'm not sure what command to enter to grab the guild data file once a day.
Thanks for any tips,
Oy.
Great, great thread, I'm looking forward to testing these php files out on my guild's site.
I've never learned how CRONtas/jobs work, however.
Any tips on what command to enter in my CRONtab field? I'm not sure what command to enter to grab the guild data file once a day.
Thanks for any tips,
Oy.
It depends on your host and how they have it set up. I would suggest asking on the support forums for your host if available. Or, if you just build it into the main page, it can do the status checks for you and download the file when necessary (as the php script in the first post does).
phpbb:phpinfo()
Thanks, Rollie.Rollie wrote:It depends on your host and how they have it set up. I would suggest asking on the support forums for your host if available. Or, if you just build it into the main page, it can do the status checks for you and download the file when necessary (as the php script in the first post does).
I just cut and paste your script from the first post and edited the top two config entries, and it appears to be working great. Thanks a ton. The "Rank" field shows "Unknown" all the way down, but I'm sure I goofed that up somehow

Regardless, is there a way of my checking (maybe the local status.txt files?) to ensure the data will update come 24 hrs? I'm still not sure how the status.txt files work. Sorry for being such a newb.
Cheers,
Oy.
First off, the reason the rank field would show unknown would be due to nobody in your guild having submitted guild data using the Census+ mod. It's real easy to do and I encourage you to do so.
As for the status.txt file, it is just a timestamp of the last time certain files were generated on the server. It is a tiny file so checking the timestamp file is cheap (bandwidth wise) compared to downloading the guild info file every time to access the data. So in an effort to decrease bandwidth usage, I request that info files only be downloaded once per day.
You can either set up a cron job to download once per day, or you can check the last time you downloaded the file with the current status.txt file to see how much time has passed since the files were last generated. If enough time has lapsed (24 hours), then the files can be downloaded again!
That answer your questions?
As for the status.txt file, it is just a timestamp of the last time certain files were generated on the server. It is a tiny file so checking the timestamp file is cheap (bandwidth wise) compared to downloading the guild info file every time to access the data. So in an effort to decrease bandwidth usage, I request that info files only be downloaded once per day.
You can either set up a cron job to download once per day, or you can check the last time you downloaded the file with the current status.txt file to see how much time has passed since the files were last generated. If enough time has lapsed (24 hours), then the files can be downloaded again!
That answer your questions?
phpbb:phpinfo()
Aye, Rollie, thanks the help. Now I just need to find what command to enter to set up a cron job to download once per day. My ISP has a really nice GUI Crontabs for morons like me, but I still need to somehow tell it to grab the .csv file and put it somewhere heh. I'll work on that.Rollie wrote:First off, the reason the rank field would show unknown would be due to nobody in your guild having submitted guild data using the Census+ mod. It's real easy to do and I encourage you to do so.
As for the status.txt file, it is just a timestamp of the last time certain files were generated on the server. It is a tiny file so checking the timestamp file is cheap (bandwidth wise) compared to downloading the guild info file every time to access the data. So in an effort to decrease bandwidth usage, I request that info files only be downloaded once per day.
You can either set up a cron job to download once per day, or you can check the last time you downloaded the file with the current status.txt file to see how much time has passed since the files were last generated. If enough time has lapsed (24 hours), then the files can be downloaded again!
That answer your questions?
Thanks again, great having this guild info on our site now,
Oyjord.
Just drop the saving part into a php file, say saveinfo.php:
Now, depending on your ISP's setup, you should be able to do something like
lynx -dump /dev/null http://www.yourdomain.com/saveinfo.php > /dev/null
This would invoke the text based browser, Lynx, to process the php script. There may be some issues with having the correct path that you might have to qualify the lynx call, or the location of the saveinfo.php file, but that should do it when you get the paths correct.
Code: Select all
$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);
lynx -dump /dev/null http://www.yourdomain.com/saveinfo.php > /dev/null
This would invoke the text based browser, Lynx, to process the php script. There may be some issues with having the correct path that you might have to qualify the lynx call, or the location of the saveinfo.php file, but that should do it when you get the paths correct.
phpbb:phpinfo()
Yo, Rollie can you help me wit sumfin? I'm trying to sort the guild member list by classes into separate tables, yet after the first table is shown all the output is showing is just the table with the header (Username, Level, etc..)
and the other users arent showing.
im trying to just use an if statement like:
except with your guild roster code it's just doing what i said up top.
Basically i want it to look like:
http://www.freepgs.com/warng/rostertemplate.htm
thanks,
Frozenshade
[/code]
and the other users arent showing.
im trying to just use an if statement like:
Code: Select all
if ($class == 'Rogue') {
echo (" table info with the $name, $level, blah blah ");
}
if ($class == 'Warrior'){
echo (" more table info ");
}
Basically i want it to look like:
http://www.freepgs.com/warng/rostertemplate.htm
thanks,
Frozenshade
[/code]
To do what you are trying to do, you would have to be sure to first sort the list by class, then do a check in your output loop to catch when the class changes and output the proper html as needed.
That or build up separate table information as you process the list and then do a string replace on some key value in your template file to insert the proper html as needed.
If I have a chance this weekend, I'll try to give you an example of what to do.
That or build up separate table information as you process the list and then do a string replace on some key value in your template file to insert the proper html as needed.
If I have a chance this weekend, I'll try to give you an example of what to do.
phpbb:phpinfo()
Nice Posts guys
I'm experience in PHP and I understand what this code is doing. I have one problem. My web hosting company requires the directory to be CHMOD 755. Therefor I cannot write to the directory. Any ideas?
Cencus Borders
First of all this is great stuff. I love it!
Forgive my ignorance, but I love how the cencus looks. May i use the borders and general layout of the cencus as long as i give cridit on the website?
here is the link to my census
[url=mailto:mharmon827@gmail.com]Here[/url] is my email address
Forgive my ignorance, but I love how the cencus looks. May i use the borders and general layout of the cencus as long as i give cridit on the website?
here is the link to my census
[url=mailto:mharmon827@gmail.com]Here[/url] is my email address
was having troubles
Ya, i know next to nothing about PHP but i do some programming on the side so i generally know what is happening. I was playing with echo and where to end my table and kept loosing the link on the bottom. Its there now though. Thanks for letting me use the layout.
Here is a sample of my output code, look formilure? I want to have a border of 1px under each cell. How do go about doing this? I have been playing and tinkering, can't seem to get it. (sorry for the messy code)
[/code]
P.S. do you maintain this website yourself?
Here is a sample of my output code, look formilure? I want to have a border of 1px under each cell. How do go about doing this? I have been playing and tinkering, can't seem to get it. (sorry for the messy code)
Code: Select all
<?php
require ("test.php");
//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>';
?>
P.S. do you maintain this website yourself?
Sorting Data
I am haveing some troubles being able to sort my data. I want to make it so you can click on the header and it sorts that field.. for example click on level and it sorts it by level.. I noticed you have it on your site and wonder how you do it.
im a dummie
oke im a dummie i tried this 2 get on my website but my programming skill nill 2 zero i just dont quite get it
could some one plz explain step by step how 2 do this or maybe send me a email about this
my email paulbloom1980 @ yahoo.com
i would very much apreciate this and i know many others will 2
thnx
could some one plz explain step by step how 2 do this or maybe send me a email about this
my email paulbloom1980 @ yahoo.com
i would very much apreciate this and i know many others will 2
thnx