It looks like you're using the GuildInfo or Guild Roster addon to get the printout. We use that addon too, and I just wrote this php code to parse out the file
. As the code is here, it will only print output to the screen, but I have it commented where you should put any calls to a database to INSERT or UPDATE your tables. I should point out that I wrote this code specifically to update a mysql database, so the webpage that displays the guild roster exists elsewhere in the site--this code prepares the info for insertion into the DB.
Best of all, it's a direct step: Copy the GuildRoster.lua file to a location accessible to the code. You don't have to get a lua engine involved
$filepath = ""); //put the relative path to your file inside the quotes, like "../files/uploads/GuildRoster.lua
$fp= fopen($filepath ,'r');
$guildname="AoE,";//put your guild name here **followed by a comma**
if(!$fp)
{
echo "<p> <strong> No lua file available."
."Please try again later.</strong></p></body></html>";
exit;
}
while(!feof($fp))
{
$order=fgets($fp, 100);
$char_array= explode("=",$order);
$element=trim(str_replace('"','',$char_array[0])); //gets rid of the spaces & quotes around data that will compose $element
$attribute =trim(str_replace('"','',$char_array[1])); //gets rid of the spaces & quotes around data that will compose $attribute
$attribute = str_replace(',',"",$attribute);//gets rid of trailing comma after attribute data
if($element=='[Name]' && $attribute != $guildname)
{$currentchar = $attribute;}
if($element=='[Note]' )
{$currentnote = $attribute;}
if($element=='[Zone]' )
{$currentzone = $attribute;}
if($element=='[Class]' )
{$currentclass = $attribute;}
if($element=='[Online]' )
{$currentonline = $attribute;}
if($element=='[RankIndex]' )
{$currentrank = $attribute;}
if($element=='[year]' )
{$currentyear = $attribute;}
if($element=='[month]' )
{$currentmonth = $attribute;}
if($element=='[hour]' )
{$currenthour = $attribute;}
if($element=='[day]' )
{$currentday = $attribute;}
if($element=='[Level]' )
{$currentlevel = $attribute;}
if ($currentonline == 1 ) {$lastonline = "Online during roster snapshot";}
else{
$lastonline = "";
if ($currentyear == 1){$lastonline .="1 year, ";}
if ($currentyear > 1) {$lastonline .=$currentyear." years, "; }
if ($currentmonth == 1){$lastonline .="1 month, ";}
if ($currentmonth > 1) {$lastonline .=$currentmonth." months, ";}
if ($currentday == 1){$lastonline .="1 day, ";}
if ($currentday > 1) {$lastonline .=$currentday." days, ";}
if ($currenthour == 1){$lastonline .="1 hour ";}
if ($currenthour > 1) {$lastonline .=$currenthour." hours ";}
}
if ($element == "[Rank]"){
echo "<BR><BR>Character: $currentchar--Lvl $currentlevel $currentclass.";
echo "Guild Rank=$currentrank. <BR>Last online: $lastonline. Notes: $currentnote";
//if you want to include any interactions with a mysql db regarding this info, run it here, BEFORE the closing bracket of the if statement
}//end of if ($element)
}//closeof while(!feof($fp));
fclose($fp);