File: alphatest.php

package info (click to toggle)
phpwiki 1.3.12p3-5etch1
  • links: PTS
  • area: main
  • in suites: etch
  • size: 16,956 kB
  • ctags: 21,608
  • sloc: php: 82,335; xml: 3,840; sh: 1,522; sql: 1,198; perl: 625; makefile: 562; awk: 28
file content (64 lines) | stat: -rw-r--r-- 1,797 bytes parent folder | download | duplicates (4)
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
64
<html><head><title>Alpha Channel Test</title>
<script type="text/javascript"><!--
var backgroundcolor = new Array();
backgroundcolor[0] = '#ffffff';
backgroundcolor[1] = '#cccccc';
backgroundcolor[2] = '#888888';
backgroundcolor[3] = '#444444';
backgroundcolor[4] = '#000000';
backgroundcolor[5] = '#aa8888';
backgroundcolor[6] = '#88aa88';
backgroundcolor[7] = '#8888aa';
function changebg(color) { document.bgColor = backgroundcolor[color]; }
//--></script>
</head><body bgcolor="#8888aa">
<hr>
bgcolor:
<script type="text/javascript"><!--
for (var n = 0; n < backgroundcolor.length; n++)
{ document.write(
' <a href="#" onMouseOver="javascript:changebg(' + n + ')">' + backgroundcolor[n] + '</a>'
); }
//--></script>
<?

function find_pngs($dir) {
  $file_list = '';
  $stack[] = $dir;
  while ($stack) {
    $current_dir = array_pop($stack);
    $pngs = false;
    if ($dh = opendir($current_dir)) {
      while (($file = readdir($dh)) !== false) {
        if ($file !== '.' AND $file !== '..') {
          $current_file = "{$current_dir}/{$file}";
          if (is_file($current_file)) {
            if  (!(strcmp(substr($file, -4), ".png"))) {
              if (!$pngs) {
                print "<hr /><h4>\n{$current_dir}</h4>\n";
                $pngs = true;
              }
              print "<img src=\"{$current_dir}/" . urlencode($file) . "\" alt=\"{$file}\" />\n";
            }
          }
          elseif (is_dir($current_file)) {
            $stack[] = $current_file;
          }
        }
      }
    }
  }
}

find_pngs(".");
?>
<hr>
bgcolor:
<script type="text/javascript"><!--
for (var n = 0; n < backgroundcolor.length; n++)
{ document.write(
' <a href="#" onMouseOver="javascript:changebg(' + n + ')">' + backgroundcolor[n] + '</a>'
); }
//--></script>
<hr>
</body></html>