Permalink
Browse files

Fixed issue #2, stats table.

  • Loading branch information...
1 parent 38ce22a commit 2b943789e66094c59257bc2b23f77f236a45883e @alanhogan alanhogan committed Feb 28, 2010
Showing with 20 additions and 14 deletions.
  1. +13 −11 -/pages/stats.php
  2. +1 −1 -/stats.php
  3. +4 −0 CHANGES.txt
  4. +2 −2 README.md
View
@@ -9,13 +9,15 @@
<th>Hits</th>
</tr>
-<? foreach($top_urls as $url) { ?>
-<tr>
- <td><?=$url['url']?></td>
- <td><?=BCURLS_URL.base_convert($url['id'], 10, 36);?></td>
- <td><?=$url['hits']?></td>
-</tr>
-<? } ?>
+<?php foreach($top_urls as $url) {
+ $short = htmlspecialchars(BCURLS_URL.$url['custom_url'], ENT_QUOTES, 'UTF-8');
+ ?>
+ <tr>
+ <td><?php echo htmlspecialchars($url['url'], ENT_QUOTES, 'UTF-8')?></td>
+ <td><!-- <a href="<?php /*=$short*/ ?>"> --><?php echo $short?><!-- </a> --></td>
+ <td><?php echo $url['hits']?></td>
+ </tr>
+<?php } ?>
</table>
@@ -25,12 +27,12 @@
<th>Hits</th>
</tr>
-<? foreach($top_referers as $url) { ?>
+<?php foreach($top_referers as $url) { ?>
<tr>
- <td><?=$url['referer']?></td>
- <td><?=$url['hits']?></td>
+ <td><?php echo htmlspecialchars($url['referer'], ENT_QUOTES, 'UTF-8')?></td>
+ <td><?php echo $url['hits']?></td>
</tr>
-<? } ?>
+<?php } ?>
</table>
View
@@ -10,7 +10,7 @@ function record_stats($db, $url_id) {
}
function stats_top_urls($db, $count=10) {
- $stmt = $db->query('SELECT u.id,u.url,COUNT(s.url_id) as hits FROM '.DB_PREFIX.'urls u LEFT JOIN '.DB_PREFIX.'url_stats s ON u.id = s.url_id GROUP BY u.id,u.url ORDER BY hits desc LIMIT '.$count);
+ $stmt = $db->query('SELECT u.id,u.url,u.custom_url,COUNT(s.url_id) as hits FROM '.DB_PREFIX.'urls u LEFT JOIN '.DB_PREFIX.'url_stats s ON u.id = s.url_id GROUP BY u.id,u.url ORDER BY hits desc LIMIT '.$count);
return $stmt->fetchAll(PDO::FETCH_ASSOC);
}
View
@@ -1,3 +1,7 @@
+2.0.3
+- Improved security
+- Corrected the stats table
+
2.0.2
- Optimize a couple queries
- Fix for finding banned words and glyphs anywhere but the end of the slug
View
@@ -1,5 +1,5 @@
-Lessn More 2.0.2
-===============
+Lessn More 2.0.3
+================
Homepage: <http://lessnmore.net>
Source/Fork: <http://github.com/alanhogan/lessmore>

0 comments on commit 2b94378

Please sign in to comment.