summaryrefslogtreecommitdiffstats
path: root/index.php
diff options
context:
space:
mode:
authorArun Persaud <arun@nubati.net>2011-11-24 11:03:27 -0800
committerArun Persaud <apersaud@lbl.gov>2011-11-24 11:03:27 -0800
commitdb1b03220d1d9eced86e6177f6787e59e5fd69a5 (patch)
tree39f0f133f0c7bd76a37a6c58619ecc4359d19021 /index.php
parent01394769937f108ee0f3a8077b34bb5fc9bffe24 (diff)
downloadphoto-tags-db1b03220d1d9eced86e6177f6787e59e5fd69a5.tar.gz
photo-tags-db1b03220d1d9eced86e6177f6787e59e5fd69a5.tar.bz2
photo-tags-db1b03220d1d9eced86e6177f6787e59e5fd69a5.zip
make index.php page aware; make default page start at 1
this way page=0 can be used for an overview
Diffstat (limited to 'index.php')
-rw-r--r--index.php15
1 files changed, 11 insertions, 4 deletions
diff --git a/index.php b/index.php
index d3d569f..44be53b 100644
--- a/index.php
+++ b/index.php
@@ -7,6 +7,13 @@ $admin=$iniarray["admin"];
$title=$iniarray["title"];
$N=$iniarray["pics_per_page"];
/* end parse ini-file */
+
+/* parse flags */
+if(isset($_REQUEST["page"]))
+ $page = intval($_REQUEST["page"]);
+else
+ $page = 1;
+
?>
<html>
<title><?php echo htmlspecialchars($title) ?></title>
@@ -35,8 +42,8 @@ $N=$iniarray["pics_per_page"];
var pics = d3.select(".pics").append("ul");
-var page=0;
-var N=<?php echo $N?>;
+var page=<?php echo $page ?>;
+var N=<?php echo $N ?>;
var count=0;
function myreload(a) {
@@ -65,7 +72,7 @@ function myreload(a) {
}
function left() {
- if (page>=1) page=page-1;
+ if (page>=2) page=page-1;
myreload(page);
}
@@ -76,7 +83,7 @@ function right() {
function checkbutton() {
- if (page==0)
+ if (page==1)
{ d3.select("button.prev").attr("disabled","disabled");}
else
{ d3.select("button.prev").attr("disabled", null);};