]> CyberLeo.Net >> Repos - SourceForge/phpwiki.git/blob - themes/alphatest.php
Convert to UTF-8
[SourceForge/phpwiki.git] / themes / alphatest.php
1 <html><head><title>Alpha Channel Test</title>
2 <script type="text/javascript"><!--
3 var backgroundcolor = new Array();
4 backgroundcolor[0] = '#ffffff';
5 backgroundcolor[1] = '#cccccc';
6 backgroundcolor[2] = '#888888';
7 backgroundcolor[3] = '#444444';
8 backgroundcolor[4] = '#000000';
9 backgroundcolor[5] = '#aa8888';
10 backgroundcolor[6] = '#88aa88';
11 backgroundcolor[7] = '#8888aa';
12 function changebg(color) { document.bgColor = backgroundcolor[color]; }
13 //--></script>
14 </head><body bgcolor="#8888aa">
15 <hr>
16 bgcolor:
17 <script type="text/javascript"><!--
18 for (var n = 0; n < backgroundcolor.length; n++)
19 { document.write(
20 ' <a href="#" onmouseover="javascript:changebg(' + n + ')">' + backgroundcolor[n] + '</a>'
21 ); }
22 //--></script>
23 <?php
24
25 function find_pngs($dir) {
26   $file_list = '';
27   $stack[] = $dir;
28   while ($stack) {
29     $current_dir = array_pop($stack);
30     $pngs = false;
31     if ($dh = opendir($current_dir)) {
32       while (($file = readdir($dh)) !== false) {
33         if ($file !== '.' AND $file !== '..') {
34           $current_file = "{$current_dir}/{$file}";
35           if (is_file($current_file)) {
36             if  (!(strcmp(substr($file, -4), ".png"))) {
37               if (!$pngs) {
38                 print "<hr /><h4>\n{$current_dir}</h4>\n";
39                 $pngs = true;
40               }
41               print "<img src=\"{$current_dir}/" . urlencode($file) . "\" alt=\"{$file}\" />\n";
42             }
43           }
44           elseif (is_dir($current_file)) {
45             $stack[] = $current_file;
46           }
47         }
48       }
49     }
50   }
51 }
52
53 find_pngs(".");
54 ?>
55 <hr>
56 bgcolor:
57 <script type="text/javascript"><!--
58 for (var n = 0; n < backgroundcolor.length; n++)
59 { document.write(
60 ' <a href="#" onmouseover="javascript:changebg(' + n + ')">' + backgroundcolor[n] + '</a>'
61 ); }
62 //--></script>
63 <hr>
64 </body></html>