Subversion Repositories Applications.gtt

Rev

Rev 61 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
60 jpm 1
<?php
2
function table($files, $re = NULL) {
3
 
4
	echo "<table cellpadding='4'>";
5
 
6
	foreach($files as $key => $file) {
7
 
8
		if($key%2 == 0) {
9
			echo "<tr>";
10
		}
11
 
12
		if($re === NULL or eregi($re, $file)) {
13
			image($file);
14
		}
15
 
16
		if($key%2 == 1) {
17
			echo "</tr>";
18
		}
19
 
20
 
21
	}
22
 
23
	if($key%2 == 0) {
24
		echo "</tr>";
25
	}
26
 
27
	echo "</table>";
28
 
29
}
30
 
31
function image($file) {
32
	echo "<td>
33
		<h3>".$file."</h3>
34
		<a href='".$file."'><img src='".$file."' style='border: 0px'/></a>
35
	</td>";
36
}
37
?>
38
<h2>Artichow examples</h2>
39
<?php
40
$glob = glob("*.php");
41
 
42
table($glob, "[a-z]+\-[0-9]{3}\.php");
43
?>
44
<h2>Artichow.org examples</h2>
45
<?php
46
$glob = glob("site/*.php");
47
 
48
table($glob);
49
?>
50
<h2>Artichow tutorials</h2>
51
<?php
52
$glob = glob("tutorials/*.php");
53
 
54
table($glob);
55
?>