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="<?php echo $webbase?>/d3.min.js"></script>
21 <link rel="stylesheet" type="text/css" href="<?php echo $webbase?>/normalize.css" />
22 <link rel="stylesheet" type="text/css" href="<?php echo $webbase?>/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="permalink"></div>
33 <div class="index"></div>
34 <div class="pics"> </div>
37 This gallery belongs to <?php echo htmlspecialchars($admin) ?>.
38 <div class="copyright"> code: copyright 2011 Arun Persaud arun@nubati.net, code available at nubati.net/git/f-spot-gallery</div>
42 <script type="text/javascript" >
45 var pics = d3.select(".pics").append("ul");
47 var page=<?php echo $page ?>;
48 var N=<?php echo $N ?>;
51 function myreload(a) {
52 d3.json("<?php echo $webbase?>/getjson.php?T=1", function(json) {
57 s+=" <a href=\"<?php echo $webbase?>/page/"+i+"\">"+i+"</a>";
59 d3.select(".index").html(s);
61 d3.json("<?php echo $webbase?>/getjson.php?P="+a, function(json) {
63 pics.selectAll("li").remove();
64 pics.selectAll("li").data(json)
67 .attr("href",function(d) {
68 s= d.base_uri+'/'+d.filename;
69 s = s.replace('file:\/\/<?php echo "".str_replace("/","\/",$dbprefix); ?>','<?php echo $webbase; ?>/Photos-small/');
73 .attr("src",function(d) {
75 s= d.base_uri+'/'+d.filename;
76 s = s.replace('file:\/\/<?php echo "".str_replace("/","\/",$dbprefix); ?>','<?php echo $webbase?>/Photos-tiny/');
82 permalink="<?php echo $webbase ?>/page/"+page;
83 d3.select(".permalink").html("Permalink: <a href=\""+permalink+"\">"+permalink+"</a>");
84 d3.select(".debug").text("P,N ="+a+" "+N);
88 if (page>=2) page=page-1;
97 function checkbutton() {
100 { d3.select("button.prev").attr("disabled","disabled");}
102 { d3.select("button.prev").attr("disabled", null);};
105 { d3.select("button.next").attr("disabled","disabled");}
107 { d3.select("button.next").attr("disabled",null);}