3 $iniarray=parse_ini_file("config.ini");
4 $webbase=$iniarray["webbase"];
5 $dbprefix=$iniarray["dbprefix"];
6 $admin=$iniarray["admin"];
7 $title=$iniarray["title"];
8 $N=$iniarray["pics_per_page"];
9 /* end parse ini-file */
12 if(isset($_REQUEST["page"]))
13 $page = intval($_REQUEST["page"]);
19 <title><?php echo htmlspecialchars($title) ?></title>
20 <script src="d3.min.js"></script>
21 <link rel="stylesheet" type="text/css" href="normalize.css" />
22 <link rel="stylesheet" type="text/css" href="style.css" />
26 <div class="debug">test</div>
27 <h1><?php echo htmlspecialchars($title) ?></h1>
29 <button class="prev" disabled="disabled" onclick="left()"> prev </button>
30 <button class="next" onclick="right()">next </button>
32 <div class="pics"> </div>
35 This gallery belongs to <?php echo htmlspecialchars($admin) ?>.
36 <div class="copyright"> code: copyright 2011 Arun Persaud arun@nubati.net, code available at nubati.net/git/f-spot-gallery</div>
40 <script type="text/javascript" >
43 var pics = d3.select(".pics").append("ul");
45 var page=<?php echo $page ?>;
46 var N=<?php echo $N ?>;
49 function myreload(a) {
50 d3.json("<?php echo $webbase?>/getjson.php?P="+a, function(json) {
52 pics.selectAll("li").remove();
53 pics.selectAll("li").data(json)
56 .attr("href",function(d) {
57 s= d.base_uri+'/'+d.filename;
58 s = s.replace('file:\/\/<?php echo "".str_replace("/","\/",$dbprefix); ?>','<?php echo $webbase; ?>/Photos-small/');
62 .attr("src",function(d) {
64 s= d.base_uri+'/'+d.filename;
65 s = s.replace('file:\/\/<?php echo "".str_replace("/","\/",$dbprefix); ?>','<?php echo $webbase?>/Photos-tiny/');
71 d3.select(".debug").text("P, count= "+a+" "+count);
75 if (page>=2) page=page-1;
84 function checkbutton() {
87 { d3.select("button.prev").attr("disabled","disabled");}
89 { d3.select("button.prev").attr("disabled", null);};
92 { d3.select("button.next").attr("disabled","disabled");}
94 { d3.select("button.next").attr("disabled",null);}