htdocs/datafile.php
author Dan
Tue, 20 Jan 2009 22:08:07 -0500
changeset 51 508400fc5282
parent 20 e2f6e3af9959
permissions -rw-r--r--
Major change to permissions backend - performs whois check (only supported blitzed and freenode right now) and advanced permissions supported.

<?php
header('Content-type: application/force-download');
header('Content-disposition: attachment; filename=stats-data.csv');

require('../stats-fe.php');

echo "channel,nick,timestamp\n";

$q = eb_mysql_query('SELECT channel, nick, time FROM stats_messages ORDER BY message_id ASC;');

while ( $row = mysql_fetch_assoc($q) )
{
  echo "{$row['channel']},{$row['nick']},{$row['time']}\n";
}

mysql_free_result($q);