Once upon a time, a casual tank formed a raid coalition for BC. Stuff happened.
More stasiscl Tricks (Raid Listing Page)
Enough people have complained that they don't have old WWS parses to provide the necessary .js and .css files for the stasiscl history option that I decided to write something. Have some bad PHP. Drop this sucker in your top level raid directory (call it index.php). It should sit right next to all the directories named "sws-blahblah-1234567".
Code:
<html>
<head>
<title>Raid History</title>
<link rel="stylesheet" type="text/css" href="extras/sws2.css" />
</head>
<body>
<div class="swsmaster">
<div class="top">
<h2>Raid History</h2>
</div>
<table cellspacing="0" class="chart">
<tr>
<th>WWS report</th>
<th>Comment</th>
<th>Start time</th>
<th style='text-align: right;'>DPS</th>
<th style='text-align: right;'>DPS time</th>
<th style='text-align: right;'>Duration</th>
<th style='text-align: right;'>Players</th>
</tr>
<?
if ($dir = opendir(".")) {
while (($file = readdir($dir)) !== false) {
if (preg_match("/^sws/", $file)) {
$parser = xml_parser_create();
xml_set_element_handler($parser, "start_tag", "end_tag");
if (!($fp = fopen($file . "/data.xml", "r"))) { echo("cannot open".$filename); }
while ($data = fread($fp, 4096)){
if (!xml_parse($parser, $data, feof($fp))) {
$reason = xml_error_string(xml_get_error_code($parser));
$reason .= xml_get_current_line_number($parser);
die($reason);
}
}
}
}
}
ksort($raids);
foreach ($raids as $value) {
echo $value;
}
function start_tag($parser, $name, $attribs) {
global $players;
global $raids;
global $start;
if ($name == "RAID") {
$start = $attribs['START'] . " " . $attribs['COMMENT'];
$players = 0;
$raids[$start] = "<tr>";
$raids[$start] .= "<td><a href='" . $attribs['DIR'] . "/index.html'>" . $attribs['DIR'] . "</a></td>";
$raids[$start] .= "<td>" . $attribs['COMMENT'] . "</td>";
$raids[$start] .= "<td>" . date("D F j, H:i", $attribs['START'] / 1000) . "</td>";
$raids[$start] .= "<td style='text-align: right;'>" . $attribs['DPS'] . "</td>";
$raids[$start] .= "<td style='text-align: right;'>" . $attribs['DPSTIME'] . "%</td>";
$lghour = sprintf("%02u", $attribs['LG'] / 1000 / 60 / 60);
$lgmin = sprintf("%02u", ($attribs['LG'] / 1000 / 60) % 60);
$raids[$start] .= "<td style='text-align: right;'>" . $lghour . ":" . $lgmin . "</td>";
}
if ($name == "PLAYER") {
$players++;
}
}
function end_tag($parser, $name) {
global $players;
global $raids;
global $start;
if ($name == "RAID") {
$raids[$start] .= "<td style='text-align: right;'>" . $players . "</td>";
$raids[$start] .= "</tr>";
}
}
?>
</table>
</div>
</body>
</html>
Total Comments 4
Comments
|
|
Works great, thanks! I am using it for my alt raid parses - if someone wants to see what it looks like: http://1tb.lightbringer-pve.com/stats/
|
|
|
|
Always good when it works for someone who's not me.
![]() Players page incoming in a bit. (Maybe tonight.) |
|
|
|
Because I am stupid - what file name is this supposed to be given?
|
|
|
|
index.php should work.
<link rel="stylesheet" type="text/css" href="/logs/raids/sws2.css" /> is the line you'll need to change -- actually, hm, make it: <link rel="stylesheet" type="text/css" href="extras/sws2.css" /> And that'll work. I'm gonna change the original post. |
|
Recent Blog Entries by Abbi
- Automatic Stasiscl Log Posting (08/14/08)
- Revised stasiscl Raid Listing (07/08/08)
- More stasiscl Tricks (Raid Listing Page) (07/07/08)
- stasiscl Tricks, Volume II (06/19/08)
- Random stasiscl Tricks (05/27/08)






