summaryrefslogtreecommitdiff
path: root/libs/pictures/plibb.php
blob: 351f1abd212bcbd2a2b3bb11cc43e7d1f7eeccc6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
<!DOCTYPE html>
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	<meta http-equiv="expires" content="Friday 24 October 1997 09:30 GMT">
	<title>Picture browser</title>
	<link rel=stylesheet href='../../common.css' type='text/css'>
	<script type="text/javascript">
		function changeImage(img){
			document.getElementById('aqt').src=img;
		}
	</script>
	<style>
		.inlinediv
		{
			display:inline-block;
			word-wrap:break-word;
			max-height:24em;
			max-width:24em;
			margin:1em;
			border:1px solid black;
			text-align:center;
		}
		.limimg{max-height:20em;max-width:20em;}
	</style>
</head>
<body style="background-color:#acf;">
	<div class="TText" style="font-size:2em"><a href="../../../">Chrisoft</a>::Picture Library</div>
	<div>
		<?php
			$startpage=0;
			if(!empty($_GET['p']))
				$startpage=intval($_GET['p']);
			$files=scandir("/var/www/html/libs/pictures/b/");
			for($i=$startpage*20,$c=count($files);$i<$c&&$i-$startpage*20<20;$i++)
			{
				if(!(strstr($files[$i],"jpg"))&&!(strstr($files[$i],"gif"))&&!(strstr($files[$i],"png")))continue;
				$ret=sprintf("
				<div class=\"inlinediv\"><a href=\"./b/%s\">
				<img class=\"limimg\" src=\"./b/%s\">
				<br>%s</a>
				</div>",$files[$i],$files[$i],$files[$i]);
				echo $ret;
			}
			$totalsp=count($files)/20+(count($files)%20==0?0:1)-1;
			$minsp=$startpage-5;if($minsp<0)$minsp=0;
			$maxsp=$startpage+6;if($maxsp>$totalsp)$maxsp=$totalsp;
			echo "<div style=\"text-align:center;\">";
			for($i=$minsp;$i<$maxsp;$i++)
			{
				if($i===$startpage)
				echo $i+1 . ' ';
				else
				{
					$t=sprintf("<a href=\"./plibb.php?p=%d\">%d</a> ",$i,$i+1);
					echo $t;
				}
			}
			echo "</div>";
		?>
	</div>
</body>
</html>