-
Notifications
You must be signed in to change notification settings - Fork 8
/
utils.php
190 lines (167 loc) · 6.71 KB
/
utils.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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
<?php
function spritemeStyle() {
return <<<OUTPUT
BODY { margin: 0; font-family: "trebuchet ms", sans-serif; color: #222; font-size: 10.5pt; }
#siteheader { padding: 8px 8px 0 12px; background: url(images/logo-64x64-04.png) repeat-x; height: 64px; }
A.navlink, A.navlink:visited { text-decoration: none; color: #000; }
A.navlink:hover { text-decoration: underline; }
A { color: #404; }
A:visited { color: #695782; }
H2 { margin-bottom: 0; margin-top: 8px; font-weight: normal; font-size: 2em; }
.ahover, .ahover:visited { text-decoration: none; }
.ahover:hover { text-decoration: underline; }
.contents { width: 800px; margin: 8px 16px 16px 16px; }
.imgborder { border: 2px solid #CCC; padding: 4px; background: #EEE; }
.sprite { margin-bottom: 20px; float: left; width: 200px; }
.btn_box { background: #CCC url(images/btn_grad.gif) repeat-x 0 -25px; width: 65px; text-align: center; float: right; margin-right: 8px; }
.btn_box_sel { background: #FFD8FF url(images/btn_grad_sel.gif) repeat-x 0 -10px; width: 65px; text-align: center; float: right; margin-right: 8px; }
.btn_box_demo { background: #CEEEF4; width: 560px; margin-right: 8px; }
.btn_top div { background: url(images/btn_white_tl.gif) no-repeat top left; }
.btn_top { background: transparent url(images/btn_white_tr.gif) no-repeat top right; }
.btn_bottom div { background: url(images/btn_white_bl.gif) no-repeat bottom left; }
.btn_bottom { background: transparent url(images/btn_white_br.gif) no-repeat bottom right; }
.btn_top div, .btn_top, .btn_bottom div, .btn_bottom { width: 100%; height: 10px; font-size: 1px; }
.btn_content { margin: 0 10px; line-height: 0.4; }
.btn_content_demo { margin: 0 10px; height: 240px; }
OUTPUT;
}
function spritemeHeader($sSubtitle = "") {
return '<div id=siteheader> <div style="width: 800px; font-size: 3em; color: #222;">' .
'<a href="."><img border=0 src="images/spriteme-200x49-transp.gif" width=200 height=49 style="vertical-align: bottom;"></a> ' .
( $sSubtitle ? '<span style="font-size: 0.9em;">' . $sSubtitle . '</span>' : '' ) .
'</div></div>';
}
function spritemeFooter() {
$sFooter =<<<OUTPUT
<hr style='margin-top: 80px; color: #A293B7;'>
<div style='text-align: center; width: 800px; margin-bottom: 20px;'>
<a style='margin-left: 16px;' href='.'>Home</a>
<a style='margin-left: 16px;' href='https://github.com/stevesouders/spriteme'>Code</a>
<a style='margin-left: 16px;' href='http://groups.google.com/group/spriteme'>Group</a>
<a style='margin-left: 16px;' href='https://github.com/stevesouders/spriteme/issues'>Bugs</a>
<a style='margin-left: 16px;' href='http://groups.google.com/group/spriteme/post'>Contact</a>
</div>
<script type='text/javascript'>
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-10547666-1']);
_gaq.push(['_trackPageview']);
document.documentElement.firstChild.appendChild(document.createElement('script')).src = ('https:' === document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/u/ga_beta.js';
</script>
OUTPUT;
return $sFooter;
}
function spritemeNav($sPage) {
return
'<div id=sav_btn class="btn_box' .
( 'sav' == $sPage ? '_sel' : '' ) .
'"><div class="btn_top"><div></div></div><div class="btn_content"><a class=navlink href="results.php">Savings</a></div><div class="btn_bottom"><div></div></div></div>' .
'<div id=faq_btn class="btn_box' .
( 'faq' == $sPage ? '_sel' : '' ) .
'"><div class="btn_top"><div></div></div><div class="btn_content"><a class=navlink href="faq.php">FAQ</a></div><div class="btn_bottom"><div></div></div></div>' .
'<div id=demo_btn class="btn_box' .
( 'demo' == $sPage ? '_sel' : '' ) .
'"><div class="btn_top"><div></div></div><div class="btn_content"><a class=navlink href="demo.php">Demo</a></div><div class="btn_bottom"><div></div></div></div>' .
'<div id=home_btn class="btn_box' .
( 'home' == $sPage ? '_sel' : '' ) .
'"><div class="btn_top"><div></div></div><div class="btn_content"><a class=navlink href=".">Home</a></div><div class="btn_bottom"><div></div></div></div>' .
'';
}
// return the full URL to the current path, eg, "http://spriteme.org/images/"
function curPath() {
$curUrl = curUrl();
return substr($curUrl, 0, strrpos($curUrl, "/") + 1);
}
function curUrl() {
$protocol = ( "on" == $_SERVER["HTTPS"] ? "https" : "http" );
$port = ( "80" != $_SERVER["SERVER_PORT"] ? ":" . $_SERVER["SERVER_PORT"] : "" );
$curUrl = $protocol . "://" . $_SERVER["SERVER_NAME"] . $port . $_SERVER["REQUEST_URI"];
return $curUrl;
}
// Alexa U.S. top 100 9/4/09
$gaUrls = array("http://google.com/",
"http://yahoo.com/",
"http://facebook.com/",
"http://youtube.com/",
"http://myspace.com/",
// now bing "http://live.com/",
"http://wikipedia.org/",
"http://craigslist.org/",
"http://ebay.com/",
"http://msn.com/",
"http://blogger.com/",
"http://amazon.com/",
"http://aol.com/",
"http://twitter.com/",
"http://go.com/",
"http://bing.com/",
"http://cnn.com/",
"http://flickr.com/",
"http://espn.go.com/",
"http://wordpress.com/",
"http://microsoft.com/",
"http://imdb.com/",
"http://photobucket.com/",
"http://linkedin.com/",
"http://weather.com/",
"http://comcast.net/",
"http://about.com/",
"http://nytimes.com/",
"http://apple.com/",
"http://netflix.com/",
"http://cnet.com/",
"http://doubleclick.com/",
"http://zynga.com/",
"http://verizon.net/",
"http://mapquest.com/",
"http://hulu.com/",
"http://foxnews.com/",
"http://adobe.com/",
"http://rapidshare.com/",
"http://walmart.com/",
"http://digg.com/",
"http://rr.com/",
"http://answers.com/",
"http://mlb.com/",
"http://reference.com/",
"http://ask.com/",
"http://ehow.com/",
"http://bbc.co.uk/",
"http://target.com/",
"http://mozilla.com/",
"http://att.com/",
"http://livejournal.com/",
"http://bankofamerica.com/",
"http://bestbuy.com/",
"http://mywebsearch.com/",
"http://yelp.com/",
"http://ning.com/",
"http://usps.com/",
"http://huffingtonpost.com/",
"http://deviantart.com/",
"http://dell.com/",
"http://twitpic.com/",
"http://ezinearticles.com/",
"http://vmn.net/",
//"http://fastclick.com/",
"http://valueclickmedia.com/",
"http://imageshack.us/",
//"http://att.net/",
"http://att.my.yahoo.com/",
"http://wsj.com/",
"http://pandora.com/",
"http://newegg.com/",
"http://ups.com/",
"http://tagged.com/",
"http://disney.go.com/",
"http://thepiratebay.org/",
"http://files.wordpress.com/",
"http://washingtonpost.com/",
"http://foxsports.com/",
"http://latimes.com/",
"http://comcast.com/",
"http://expedia.com/",
"http://verizonwireless.com/",
"http://gamefaqs.com/",
"http://gamespot.com/"
);
?>