r10194 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r10193‎ | r10194 | r10195 >
Date:06:59, 18 July 2005
Author:kateturner
Status:old
Tags:
Comment:
generate all urls list better
(fe) show a link to it in the output
Modified paths:
  • /trunk/logwood/fe/logwood.php (modified) (history)
  • /trunk/logwood/run_reports.php (modified) (history)

Diff [purge]

Index: trunk/logwood/run_reports.php
@@ -47,26 +47,27 @@
4848 $qsites->execute();
4949 $qsites->store_result();
5050 while ($qsites->fetch()) {
51 - $site = $row["si_id"];
52 -
53 - $insert_topurls->bind_param("i", $site);
 51+ $insert_topurls->bind_param("i", $si_id);
5452 $insert_topurls->execute();
5553
56 - $insert_topagents->bind_param("i", $site);
 54+ $insert_topagents->bind_param("i", $si_id);
5755 $insert_topagents->execute();
5856
59 - $insert_toprefs->bind_param("i", $site);
 57+ $insert_toprefs->bind_param("i", $si_id);
6058 $insert_toprefs->execute();
6159
6260 $date = date('Y-m');
6361 $fdate = date('Y-m-d H:i:s');
64 - fwrite($fh, "# This is a list of all URLs for ". $row["si_name"] . "\n");
 62+ @mkdir("$lwbase/archive");
 63+ @mkdir("$lwbase/archive/$si_name");
 64+ @mkdir("$lwbase/archive/$si_name/$date");
 65+ $dir = "$lwbase/archive/$si_name/$date";
 66+ $fh = fopen("$dir/$date.$si_name.all_urls.txt", "w");
 67+ fwrite($fh, "# This is a list of all URLs for $si_name\n");
6568 fwrite($fh, "# It was last updated on $fdate.\n");
66 -
67 - $fh = fopen("$lwbase/$date.all_urls.txt");
6869
6970 $a_name = $a_path = $a_count = false;
70 - $qallurls->bind_param("i", $site);
 71+ $qallurls->bind_param("i", $si_id);
7172 $qallurls->bind_result($a_name, $a_path, $a_count);
7273 $qallurls->execute();
7374 while ($qallurls->fetch())
Index: trunk/logwood/fe/logwood.php
@@ -58,6 +58,15 @@
5959 ?>
6060
6161 <h2>Most popular URLs</h2>
 62+<div class='titlesub'>
 63+<?php
 64+$fdate = date('Y-m');
 65+$fname = "/archive/$site/$fdate/$fdate.$site.all_urls.txt";
 66+$st = @stat($lwbase.$fname);
 67+?>
 68+<a href="<?php echo "$htmlbase$fname"?>">View all URLs</a> (<?php echo $st["size"]?> bytes)
 69+</div>
 70+
6271 <table><tr><th>#</th><th>Views</th><th>URL</th></tr>
6372 <?php
6473 $i = 1;

Status & tagging log