diff --git a/SpecialWiretap.php b/SpecialWiretap.php index b40886e..e57d829 100644 --- a/SpecialWiretap.php +++ b/SpecialWiretap.php @@ -307,10 +307,17 @@ public function uniqueTotals ( $showUniquePageHits = false ) { $rows = $this->getUniqueRows( $showUniquePageHits, "DESC" ); + // This writes the Unique User-Hit data to a file named "UUHitsforWiki_.csv" that is accessible by browser off of the server base url. + $fp = fopen("/opt/htdocs/UUHitsforWiki_".str_replace("/","",str_replace("Special:Wiretap","",SpecialPage::getTitleFor('Wiretap')->getLocalURL())).".csv", 'w'); + fwrite($fp, "Date, UUHits\n" ); + foreach($rows as $row) { $html .= "{$row['date']}{$row['hits']}"; + fwrite($fp, "{$row['date']}, {$row['hits']}\n" ); } + fclose($fp); + $html .= ""; $wgOut->addHTML( $html );