Index: trunk/logwood/run_reports.php |
— | — | @@ -47,26 +47,27 @@ |
48 | 48 | $qsites->execute(); |
49 | 49 | $qsites->store_result(); |
50 | 50 | while ($qsites->fetch()) { |
51 | | - $site = $row["si_id"]; |
52 | | - |
53 | | - $insert_topurls->bind_param("i", $site); |
| 51 | + $insert_topurls->bind_param("i", $si_id); |
54 | 52 | $insert_topurls->execute(); |
55 | 53 | |
56 | | - $insert_topagents->bind_param("i", $site); |
| 54 | + $insert_topagents->bind_param("i", $si_id); |
57 | 55 | $insert_topagents->execute(); |
58 | 56 | |
59 | | - $insert_toprefs->bind_param("i", $site); |
| 57 | + $insert_toprefs->bind_param("i", $si_id); |
60 | 58 | $insert_toprefs->execute(); |
61 | 59 | |
62 | 60 | $date = date('Y-m'); |
63 | 61 | $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"); |
65 | 68 | fwrite($fh, "# It was last updated on $fdate.\n"); |
66 | | - |
67 | | - $fh = fopen("$lwbase/$date.all_urls.txt"); |
68 | 69 | |
69 | 70 | $a_name = $a_path = $a_count = false; |
70 | | - $qallurls->bind_param("i", $site); |
| 71 | + $qallurls->bind_param("i", $si_id); |
71 | 72 | $qallurls->bind_result($a_name, $a_path, $a_count); |
72 | 73 | $qallurls->execute(); |
73 | 74 | while ($qallurls->fetch()) |
Index: trunk/logwood/fe/logwood.php |
— | — | @@ -58,6 +58,15 @@ |
59 | 59 | ?> |
60 | 60 | |
61 | 61 | <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 | + |
62 | 71 | <table><tr><th>#</th><th>Views</th><th>URL</th></tr> |
63 | 72 | <?php |
64 | 73 | $i = 1; |