0 function head($css = null, $js = null) {
1
2 global $page, $media_type, $charset, $lang, $ent, $copyright;
3
4 $title = 'loadaverageZero';
5 if ($page['title']) $title = $page['title'] . ' - ' . $title;
6
7 $no_description = 'Dedicated to the latest Web Standards in Accessibility, ';
8 $no_description .= 'Design and Programming using Client Server Open Source technology.';
9
10 $description = $page['description'] ? $page['description'] : $no_description;
11
12 $no_keywords = 'xhtml,php,css,mysql,perl,python,apache,dom,unix,linux,bsd,rss,';
13 $no_keywords .= 'xml,html,standards,accessibility,open source,code,software';
14
15 $keywords = $page['keywords'] ? $page['keywords'] : $no_keywords;
16
17 // ODP/dmoz.org RDF -- a *very* small subset
18
19 $categories = array(
20 'APACHE' => 'Software/Internet/Servers/WWW/Apache',
21 'CSS' => 'Data_Formats/Style_Sheets/CSS',
22 'MYSQL' => 'Software/Databases/MySQL',
23 'PERL' => 'Programming/Languages/Perl',
24 'PHP' => 'Programming/Languages/PHP',
25 'XHTML' => 'Data_Formats/Markup_Languages/XHTML',
26 );
27
28 $category = 'Computers/';
29 $category .= ($cat = $categories[strtoupper($page['category'])]) ? $cat : $categories['XHTML'];
30
31 $domain = 'loadaveragezero.com';
32 $author = 'Douglas W. Clifton';
33
34 // fancy pants
35
36 $y = date('Y');
37 $copyright = $ent['copy'] . ' ' . implode('-', array_reverse(array($y--, $y)));
38 $copyright = implode(', ', array($copyright, $author, $domain, 'all rights reserved'));
39
40 print <<<_H
41 <head>
42 <title>$title</title>
43 <meta http-equiv="Content-type" content="$media_type; charset=$charset" />
44 <meta http-equiv="Content-language" content="$lang" />
45 <meta name="Resource-type" content="document" />
46 <meta name="description" content="$description" />
47 <meta name="keywords" content="$keywords" />
48 <meta name="Category" content="$category" />
49 <meta name="Distribution" content="Global" />
50 <meta name="Rating" content="General" />
51 <meta name="Robots" content="index,follow" />
52 <meta name="Author" content="$author" />
53 <meta name="Copyright" content="$copyright" />
54 <link type="$media_type" rel="home" href="/" />
55 <link type="image/x-icon" rel="shortcut icon" href="/img/favicon.ico" />
56 <link type="image/gif" rel="icon" href="/img/favicon.gif" />
57 <link type="text/css" rel="stylesheet" media="screen" href="/css/root.css" />
58 <!--[if IE]><link type="text/css" rel="stylesheet" media="screen" href="/css/ie.css" />
59
60 H;
61 $dir = array(
62 'CSS' => '/css/',
63 'JS' => '/js/'
64 );
65
66 // import additional CSS modules
67
68 if (is_array($css) and count($css) > 0) {
69 print ' <style type="text/css" media="screen">' . "\n";
70 foreach ($css as $ss) {
71 $url = $dir['CSS'] . $ss . '.css';
72 print ' @import url(' . $url . ');' . "\n";
73 }
74 print ' </style>' . "\n";
75 }
76
77 // import javascript modules
78
79 if (is_array($js)) {
80 foreach ($js as $s) {
81 $src = $dir['JS'] . $s . '.js';
82 print ' <script type="text/javascript" src="' . $src . '"></script>' . "\n";
83 }
84 }
85
86 print ' </head>' . "\n";
87
88 } // head()