Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions SpecialWiretap.php
Original file line number Diff line number Diff line change
Expand Up @@ -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_<wikiID>.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 .= "<tr><td>{$row['date']}</td><td>{$row['hits']}</td></tr>";
fwrite($fp, "{$row['date']}, {$row['hits']}\n" );
}

fclose($fp);

$html .= "</table>";

$wgOut->addHTML( $html );
Expand Down