Bugfixing

svn path=/trunk/; revision=23842
This commit is contained in:
otto 2012-07-17 12:25:28 +00:00
parent 982b07d3bf
commit 4c7f91b42c
2 changed files with 7 additions and 6 deletions

View File

@ -2,7 +2,7 @@
// This file is temporary - now I just need so see the db contents
// to develop email confirmation function
//die("This file is for debugging only.");
die("This file is for debugging only.");
$db = new PDO("sqlite:../../../db/support.sqlite");

View File

@ -37,14 +37,15 @@ for ($i = 90; $i >= 0; $i--) {
$sql = "SELECT *, COUNT(*) AS supporters FROM t1 WHERE time <= Datetime('". ts_days_ago($i) ."') ";
// enable stats for single referrers
if ($_GET['ref_id'] != '') {
if (isset($_GET['ref_id'])) {
$sql .= "AND WHERE ref_id = '". sqlite_escape_string($_GET['ref_id']) ."' ";
}
if ($_GET['ref_url'] != '') {
if (isset($_GET['ref_url'])) {
$sql .= "AND WHERE ref_url LIKE '". sqlite_escape_string($_GET['ref_url']) ."%' ";
}
$sql .= "GROUP BY country_code ORDER BY supporters DESC";
echo $sql;
$query = $db->prepare($sql);
$query->execute();
}
@ -196,10 +197,10 @@ foreach ($series as $k => $v) {
</head>
<body>
<h1>Supporter count status
<h1>a Supporter count status
<?php
if ($_GET['ref_url'] != '') { echo " for referrer URLs starting with ". htmlspecialchars($_GET['ref_url']); }
if ($_GET['ref_id'] != '') { echo " for referrer fsfe.org/support?". htmlspecialchars($_GET['ref_id']); }
if (isset($_GET['ref_url'])) { echo " for referrer URLs starting with ". htmlspecialchars($_GET['ref_url']); }
if (isset($_GET['ref_id'])) { echo " for referrer fsfe.org/support?". htmlspecialchars($_GET['ref_id']); }
?>
<small><?php date("Y-m-d") ?></small></h1>