diff --git a/index.php b/index.php
index 12d4461..c89213e 100644
--- a/index.php
+++ b/index.php
@@ -1,8 +1,12 @@
$email, "email" => "");
@@ -174,7 +178,12 @@ if (isset($_GET["chan"]) && isset($CHANS[$_GET["chan"]])) {
$chan = "SingularityAlpha";
}
-$pageSize = KEEP_BUILDS;
+$page = 0;
+if (isset($_GET["page"])) {
+ $page = (int)$_GET["page"];
+ }
+
+$pageSize = 25;
$builds = array();
@@ -189,7 +198,7 @@ if (isset($_GET["build_id"])) {
chan_selector($chan);
}
-if ($res = $DB->query(kl_str_sql("select * from builds where chan=!s $where order by nr desc limit !i", $chan, $pageSize + 1))) {
+if ($res = $DB->query(kl_str_sql("select * from builds where chan=!s $where order by nr desc limit !i offset !i", $chan, $pageSize, $page * $pageSize))) {
while ($row = $DB->fetchRow($res)) {
$build = new stdClass;
@@ -225,7 +234,17 @@ if ($nrBuilds) {
print '';
}
-
+
+print "
\n";
+
+if ($page > 0) {
+ print '<< Previous  ';
+ }
+
+print 'Next >>';
+
+
+
Layout::footer();
/*
diff --git a/lib/DBH.php b/lib/DBH.php
index 9443828..87b0ad0 100644
--- a/lib/DBH.php
+++ b/lib/DBH.php
@@ -12,6 +12,7 @@ class DBH
function log($line)
{
+ return;
static $f = false;
static $failed = false;
diff --git a/lib/ext_kl.php b/lib/ext_kl.php
index da2b36a..f1995ea 100644
--- a/lib/ext_kl.php
+++ b/lib/ext_kl.php
@@ -4,7 +4,7 @@
$php_str_sql_options_array = array(
"str_sql_date_format" => "Y-m-d",
"str_sql_datetime_format" => "Y-m-d H:i:s",
- "str_sql_quote_func" => "sqlite_escape_string");
+ "str_sql_quote_func" => "SQLite3::escapeString");
/**
* This method validates the sql insert string must always be used in conjunction with an insert to the db
* @return string
@@ -13,7 +13,6 @@ $php_str_sql_options_array = array(
function kl_str_sql()
{
GLOBAL $php_str_sql_options_array;
- $f = $php_str_sql_options_array['str_sql_quote_func'];
$narg = func_num_args();
$args = func_get_args();
@@ -39,7 +38,7 @@ function kl_str_sql()
if (is_null($args[$narg])) {
$res .= 'NULL';
} else {
- $res .= "'".$f($args[$narg])."'";
+ $res .= "'".SQLite3::escapeString($args[$narg])."'";
}
$narg++;
break;