This repository was archived by the owner on Jul 3, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcommon.php
121 lines (112 loc) · 5.14 KB
/
common.php
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
<?php
/*----------------------------------------------------------------------------------------
Function: docHead()
Purpose: writes out the stuff needed in the <head> of the doc
----------------------------------------------------------------------------------------*/
function docHead() {
metaTags();
links();
scripts();
} # end head()
/*----------------------------------------------------------------------------------------
Function: metaTags()
Purpose: writes out the stuff needed in the <head> of the doc
----------------------------------------------------------------------------------------*/
function metaTags() { ?>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Language" content="en-us" />
<meta name="author" content="Aaron Gustafson (aaron at easy-designs dot net)" />
<meta name="MSSmartTagsPreventParsing" content="true" />
<meta name="ROBOTS" content="ALL" />
<meta name="Copyright" content="(CC) <?php ccDate(); ?> Easy Designs, LLC. Except where otherwise noted, this site is licensed under a Creative Commons License." />
<meta http-equiv="imagetoolbar" content="no" />
<meta name="Rating" content="General" />
<?php
} # end metaTags()
/*----------------------------------------------------------------------------------------
Function: links()
Purpose: writes out the links for all docs
----------------------------------------------------------------------------------------*/
function links() {
if( !isNakedDay() ){ ?>
<link rel="stylesheet" type="text/css" media="screen" href="/css/basic.css" />
<link rel="stylesheet" type="text/css" media="screen, projection" href="/css/advanced.css" />
<link rel="stylesheet" type="text/css" media="print" href="/css/print.css" />
<?php
} # naked day ?>
<link rel="shortcut icon" type="image/ico" href="/favicon.ico" />
<link rel="copyright" href="/license.php" />
<?php
} # end links()
/*----------------------------------------------------------------------------------------
Function: scripts()
Purpose: writes out the scripts for all docs
----------------------------------------------------------------------------------------*/
function scripts() { ?>
<!--script type="text/javascript" src="/scripts/jsUtilities.js"></script-->
<script type="text/javascript" src="/scripts/main.js"></script>
<script type="text/javascript" src="/scripts/pageGlossary.js"></script>
<script type="text/javascript" src="/scripts/footnoteLinks.js"></script>
<script type="text/javascript" src="http://www.google-analytics.com/urchin.js"></script>
<?php
} # end links()
/*----------------------------------------------------------------------------------------
Function: message()
Purpose: write out a site-wide message
----------------------------------------------------------------------------------------*/
function message(){
if( isNakedDay() ){ ?>
<div id="site_notice">
<h3>What happened to the design?</h3>
<p>To know more about why styles are disabled on this website visit the <a href="http://naked.dustindiaz.com" title="Web Standards Naked Day Host Website">Annual <abbr title="Cascading Style Sheets">CSS</abbr> Naked Day</a> website for more information.</p>
</div>
<?php
}
}
/*----------------------------------------------------------------------------------------
Function: foot()
Purpose: write the copyright date
----------------------------------------------------------------------------------------*/
function foot(){ ?>
<div id="footer">
<?php cc(); ?>
</div>
<script type="text/javascript">
// <![CDATA[
_uacct = 'UA-176472-1';
urchinTracker();
// ]]>
</script>
<?php
} # end foot()
/*----------------------------------------------------------------------------------------
Function: ccDate()
Purpose: write the copyright date
----------------------------------------------------------------------------------------*/
function ccDate() {
echo "1999-".date('Y');
} # end ccDate()
/*----------------------------------------------------------------------------------------
Function: cc()
Purpose: write the creative commons license paragraph
----------------------------------------------------------------------------------------*/
function cc(){ ?>
<p class="copyright"><a id="cc" href="http://creativecommons.org/licenses/by-sa/2.0/" title="View the Creative Commons license for this page">(CC)</a> <?php ccDate(); ?> Easy Designs, LLC. Except where otherwise <a href="/license.php">noted</a>, this site is licensed under a <a href="http://creativecommons.org/">Creative Commons</a> License.</p>
<?php
} # end cc()
/*----------------------------------------------------------------------------------------
Function: is_naked_day()
Purpose: let's me know if it is naked day
----------------------------------------------------------------------------------------*/
function isNakedDay(){
$start = date('U', mktime(-12,0,0,04,05,date('Y')));
$end = date('U', mktime(36,0,0,04,05,date('Y')));
$now = time();
if( $now >= $start &&
$now <= $end ){
return true;
} else {
return false;
}
}
?>