This repository has been archived by the owner on Jan 2, 2023. It is now read-only.
/
index.php
333 lines (280 loc) · 11.2 KB
/
index.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
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
<?php
define( 'INC_FILE', 'index.inc.php' );
{
require 'common/private/start.inc.php';
$user = array();
{
// set some defaults
$user['name'] = 'First Last';
$user['mug'] = 'common/public/mug.default.png';
$user['email'] = 'user@domain.com';
$user['contact'] = 'City, State';
$user['linkedin_url'] = NULL;
$user['flickr_url'] = NULL;
$user['scholar_id'] = NULL;
$user['g_analytics'] = NULL;
$user['tabs'] = array( 'cv'=>'CV', 'links'=>'Links' );
$user['handler'] = '_example';
$user['timezone'] = 'America/Detroit';
$user['favico'] = NULL;
$user['css_base_all'] = true;
$user['css_base_print'] = true;
$user['css_custom_all'] = NULL;
$user['css_custom_print'] = NULL;
$user['rss_tab'] = NULL;
$user['footer'] = NULL;
// override if available
@include( INC_FILE );
}
$page_info['title'] = $user['name'];
date_default_timezone_set( $user['timezone'] );
// favico
if ( !is_null( $user['favico'] ) && is_readable( $user['favico'] ) )
{
$page_info['favico'] = $user['favico'];
}
// css
foreach ( array( 'all', 'print' ) as $css )
{
if ( !$user[ 'css_base_' . $css ] )
{
$page_info[ 'css-' . $css ] = '';
}
if ( !is_null( $user[ 'css_custom_' . $css ] ) && is_readable( $user[ 'css_custom_' . $css ] ) )
{
$page_info['head'][] = ( '<link href="' . htmlentities( $user[ 'css_custom_' . $css ] ) . '?' . http_build_query( array( 'type'=>$page_info['type'] ) ) . '" rel="stylesheet" type="text/css" media="' . htmlentities( $css ) . '" />' );
}
}
// rss
if ( !is_null( $user['rss_tab'] ) )
{
$page_info['head'][] = ( '<link rel="alternate" type="application/rss+xml" title="' . htmlentities( $user['name'] ) . '" href="?' . http_build_query( array( 'blank'=>'Y', 'tab'=>$user['rss_tab'] ) ) . '">' );
}
}
function _example( $id, $prefix )
{
if ( $id == 'cv' )
{
$education = array(
'B.A. in English (2000, 4.000/4.000 GPA), Erudition College, Montpelier, VT',
);
$skills = array(
'readin\'',
'\'ritin\'',
'\'rithmetic',
);
$experience = (
'Sacred Heart Hospital, <i>Sanitation Engineer</i><br />North Hollywood, CA (2001-2009)<br />' . misc_list( array('Sweep', 'Mop', 'Mess with JD') ) . '<br />' .
'Springfield Elementary School, <i>Bus Driver</i><br />Springfield (1990-present)<br />' . misc_list( array( 'Drive', 'Air Guitar' ) )
);
$t_bands_init = array();
$t_bands_change = array();
{
$t_bands_init[0] = array();
$t_bands_init[0]['width'] = '"70%"';
$t_bands_init[0]['intervalUnit'] = 'Timeline.DateTime.DAY';
$t_bands_init[0]['intervalPixels'] = '100';
$t_bands_init[1] = array();
$t_bands_init[1]['width'] = '"20%"';
$t_bands_init[1]['intervalUnit'] = 'Timeline.DateTime.WEEK';
$t_bands_init[1]['intervalPixels'] = '200';
$t_bands_init[1]['layout'] = '"overview"';
$t_bands_init[2] = array();
$t_bands_init[2]['width'] = '"10%"';
$t_bands_init[2]['intervalUnit'] = 'Timeline.DateTime.YEAR';
$t_bands_init[2]['intervalPixels'] = '350';
$t_bands_init[2]['layout'] = '"overview"';
$t_bands_change[1] = array( 'syncWith'=>'0', 'highlight'=>'true' );
$t_bands_change[2] = array( 'syncWith'=>'0', 'highlight'=>'true' );
}
echo misc_section( 'Goals', 'I have always dreamt of being a doctor.', $prefix );
echo misc_section( 'Education', misc_list( $education ), $prefix );
echo misc_section( 'Skills', misc_list( $skills ), $prefix );
echo misc_section( 'Experience', $experience, $prefix );
timeline_init( 'foo1', array('type'=>'XML', 'url'=>( $_SERVER['SCRIPT_NAME'] . '?' . http_build_query( array( 'blank'=>'Y', 'tab'=>'data' ) ) )), $t_bands_init, $t_bands_change, $prefix );
echo ( $prefix . '<span class="noprint">' . "\n" );
{
echo misc_section( 'Timeline', '<div id="foo1" style="height: 200px; border: 1px solid #aaa"></div>', ( $prefix . "\t" ) );
}
echo ( $prefix . '</span>' . "\n" );
}
else if ( $id == 'links' )
{
$work = array(
'Google: <a href="http://www.google.com" target="_blank">http://www.google.com</a>',
'Google Scholar: <a href="http://scholar.google.com" target="_blank">http://scholar.google.com</a>',
);
$procrastination = array(
'YouTube: <a href="http://www.youtube.com" target="_blank">http://www.youtube.com</a>',
'Hulu: <a href="http://www.hulu.com" target="_blank">http://www.hulu.com</a>',
);
echo misc_section( 'Work', misc_list( $work ), $prefix );
echo misc_section( 'Procrastination', misc_list( $procrastination ), $prefix );
}
else if ( $id == 'data' )
{
header('Content-type: text/xml');
$doc = new DomDocument('1.0');
$root = $doc->createElement('data');
$root = $doc->appendChild( $root );
$child = $doc->createElement('event', 'all my troubles seemed so far away');
$child->setAttribute( 'start', date( timeline_date_format(), strtotime('yesterday') ) );
$child->setAttribute( 'title', 'yesterday' );
$child->setAttribute( 'image', 'common/public/mug.default.png' );
$child = $root->appendChild( $child );
$child = $doc->createElement('event', 'is a different day');
$child->setAttribute( 'start', date( timeline_date_format(), strtotime('tomorrow') ) );
$child->setAttribute( 'title', 'tomorrow' );
$child->setAttribute( 'link', ( 'http://www.wolframalpha.com/input/?' . http_build_query( array( 'i'=>'what day is tomorrow' ) ) ) );
$child = $root->appendChild( $child );
$child = $doc->createElement('event', 'while the blossoms still cling to the vine');
$child->setAttribute( 'start', date( timeline_date_format(), strtotime('today') ) );
$child->setAttribute( 'icon', 'common/public/favico.default.ico' );
$child->setAttribute( 'title', 'today' );
$child = $root->appendChild( $child );
$child = $doc->createElement('event', 'I went to Philadelphia, but it was closed');
$child->setAttribute( 'start', date( timeline_date_format(), strtotime('monday last week') ) );
$child->setAttribute( 'end', date( timeline_date_format(), strtotime('friday last week') ) );
$child->setAttribute( 'title', 'last week' );
$child->setAttribute( 'durationEvent', 'true' );
$child->setAttribute( 'color', 'red' );
$child->setAttribute( 'textColor', 'green' );
$child = $root->appendChild( $child );
$child = $doc->createElement('event', 'I\'ll do something');
$child->setAttribute( 'start', date( timeline_date_format(), strtotime('monday next week') ) );
$child->setAttribute( 'end', date( timeline_date_format(), strtotime('friday next week') ) );
$child->setAttribute( 'title', 'next week' );
$child->setAttribute( 'durationEvent', 'true' );
$child->setAttribute( 'textColor', 'green' );
$child = $root->appendChild( $child );
echo $doc->saveXML();
}
}
?>
<?php
if ( $page_info['type'] != 'blank' )
{
?>
<div id="container">
<div id="top">
<div id="mug">
<img src="<?php echo htmlentities( $user['mug'] ); ?>" alt="<?php echo htmlentities( $user['name'] ); ?>" />
</div>
<div id="contact">
<div class="header"><?php echo htmlentities( $user['name'] ); ?></div>
<span style="font-style: italic">E-Mail</span>: <a href="mailto:<?php echo htmlentities( $user['email'] ); ?>"><?php echo htmlentities( $user['email'] ); ?></a>
<br />
<?php echo htmlentities( $user['contact'] ); ?>
<br /><br />
<?php
if ( ( $page_info['type'] == 'full' ) && !is_null( $user['scholar_id'] ) )
{
$li = array();
$li[] = '<span class="noprint">';
$li[] = ( "\t" . '<a target="_blank" href="http://scholar.google.com/citations?' . http_build_query( array( 'user'=>htmlentities( $user['scholar_id'] ), 'hl'=>'en' ) ) . '" style="text-decoration:none;"><span style="font: 80% Arial,sans-serif; color:#0783B6;"><img src="common/public/scholar.png" width="15" height="15" alt="View ' . htmlentities( $user['name'] ) . '\'s Google Scholar Citations" style="vertical-align:middle" border="0"></span></a>' );
$li[] = '</span>';
$li[] = ' ';
foreach ( $li as $v )
{
echo ( "\t\t\t" . $v . "\n" );
}
}
?>
<?php
if ( ( $page_info['type'] == 'full' ) && !is_null( $user['linkedin_url'] ) )
{
$li = array();
$li[] = '<span class="noprint">';
$li[] = ( "\t" . '<a target="_blank" href="' . htmlentities( $user['linkedin_url'] ) . '" style="text-decoration:none;"><span style="font: 80% Arial,sans-serif; color:#0783B6;"><img src="common/public/linkedin.png" width="20" height="15" alt="View ' . htmlentities( $user['name'] ) . '\'s LinkedIn profile" style="vertical-align:middle" border="0"></span></a>' );
$li[] = '</span>';
$li[] = ' ';
foreach ( $li as $v )
{
echo ( "\t\t\t" . $v . "\n" );
}
}
?>
<?php
if ( ( $page_info['type'] == 'full' ) && !is_null( $user['flickr_url'] ) )
{
$li = array();
$li[] = '<span class="noprint">';
$li[] = ( "\t" . '<a target="_blank" href="' . htmlentities( $user['flickr_url'] ) . '" style="text-decoration:none;"><img src="common/public/flickr.ico" width="15" height="15" alt="View ' . htmlentities( $user['name'] ) . '\'s Flickr pictures" style="vertical-align: middle; border: none;"></a>' );
$li[] = '</span>';
$li[] = ' ';
foreach ( $li as $v )
{
echo ( "\t\t\t" . $v . "\n" );
}
}
?>
</div>
</div>
<div id="content">
<?php
if ( count( $user['tabs'] ) > 1 )
{
jquery_create_tabs( 'tabs', $user['tabs'], $user['handler'], "\t\t" );
}
else if ( count( $user['tabs'] ) == 1 )
{
$keys = array_keys( $user['tabs'] );
call_user_func_array( $user['handler'], array( $keys[0], "\t\t" ) );
}
?>
</div>
</div>
<div id="footer">
<?php
$footer = array();
if ( !is_null( $user['footer'] ) )
{
$temp = explode( "\n", $user['footer'] );
foreach ( $temp as $t )
{
$footer[] = $t;
}
}
$footer[] = ( 'last updated on ' . htmlentities( date( 'j F Y', filemtime( ( is_readable( INC_FILE ) )?( INC_FILE ):( $_SERVER['SCRIPT_FILENAME'] ) ) ) ) . ' | powered by <a href="http://vitagen.googlecode.com" target="_blank">vitagen</a>' );
foreach ( $footer as $f )
{
echo ( "\t" . $f . '<br />' . "\n" );
}
?>
</div>
<?php
if ( !is_null( $user['g_analytics'] ) )
{
$g = array();
$g[] = ( '<script type="text/javascript">' );
$g[] = ( "\t" . 'var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");' );
$g[] = ( "\t" . 'document.write(unescape("%3Cscript src=\'" + gaJsHost + "google-analytics.com/ga.js\' type=\'text/javascript\'%3E%3C/script%3E"));' );
$g[] = ( '</script>' );
$g[] = ( '<script type="text/javascript">' );
$g[] = ( "\t" . 'try {' );
$g[] = ( "\t\t" . 'var pageTracker = _gat._getTracker("' . htmlentities( $user['g_analytics'] ) . '");' );
$g[] = ( "\t\t" . 'pageTracker._trackPageview();' );
$g[] = ( "\t" . '} catch(err) {}' );
$g[] = ( '</script>' );
foreach ( $g as $v )
{
echo ( $v . "\n" );
}
}
}
else
{
$tab = misc_param( 'tab' );
if ( empty( $tab ) )
{
$keys = array_keys( $user['tabs'] );
$tab = $keys[0];
}
call_user_func_array( $user['handler'], array( $tab, "" ) );
}
?>
<?php
{
require 'common/private/end.inc.php';
}
?>