forked from EddieRingle/wicketpixie
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathheader.php
234 lines (208 loc) · 8.69 KB
/
header.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
<?php
/**
* WicketPixie v2.0
* (c) 2006-2009 Eddie Ringle,
* Chris J. Davis,
* Dave Bates
* Provided by Chris Pirillo
*
* Licensed under the New BSD License.
*/
// Blog feed URL
if(get_option('wicketpixie_blog_feed_url') != false) {
$blogfeed = get_option('wicketpixie_blog_feed_url');
} else {
$blogfeed = get_bloginfo_rss('rss2_url');
}
$status= new SourceUpdate;
global $optpre;
global $adsense;
$adsense = new AdsenseAdmin;
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes(); ?>>
<head profile="http://gmpg.org/xfn/11">
<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />
<title><?php if (is_home()) { ?><?php bloginfo('name'); ?><?php } else { ?><?php wp_title('',true,''); ?> » <?php bloginfo('name'); ?><?php } ?></title>
<?php $time = time(); ?>
<link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); echo '?', $time; ?>" type="text/css" media="screen" />
<link rel="stylesheet" href="<?php bloginfo('template_directory'); ?>/css/reset.css?<?php echo $time; ?>" type="text/css" media="screen, projection" />
<link rel="stylesheet" href="<?php bloginfo('template_directory'); ?>/css/screen.css?<?php echo $time; ?>" type="text/css" media="screen, projection" />
<link rel="stylesheet" href="<?php bloginfo('template_directory'); ?>/css/print.css?<?php echo $time; ?>" type="text/css" media="print" />
<!--[if IE]><link rel="stylesheet" href="<?php bloginfo('template_directory'); ?>/css/ie.css?<?php echo $time; ?>" type="text/css" media="screen, projection" /><![endif]-->
<!--[if gte IE 7]><link rel="stylesheet" href="<?php bloginfo('template_directory'); ?>/css/ie7.css?<?php echo $time; ?>" type="text/css" media="screen, projection" /><![endif]-->
<!--[if lte IE 6]><link rel="stylesheet" href="<?php bloginfo('template_directory'); ?>/css/ie6.css?<?php echo $time; ?>" type="text/css" media="screen, projection" /><![endif]-->
<link rel="alternate" type="application/rss+xml" title="<?php bloginfo('name'); ?> RSS Feed" href="<?php echo $blogfeed; ?>" />
<link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />
<link rel="shortcut icon" type="image/ico" href="<?php bloginfo('home'); ?>/favicon.ico" />
<?php ob_flush(); flush(); ?>
<style type="text/css">
.recentcomments a {
display: inline !important;
padding: 0 !important;
margin: 0 !important;
}
</style>
<?php
include_once (TEMPLATEPATH . '/plugins/random-posts.php');
include_once (TEMPLATEPATH . '/plugins/search-excerpt.php');
clearstatcache();
if(!is_dir(TEMPLATEPATH . '/app/cache')) {
mkdir(TEMPLATEPATH . '/app/cache',0777);
}
if(!is_dir(TEMPLATEPATH . '/app/cache/activity')) {
mkdir(TEMPLATEPATH . '/app/cache/activity',0777);
}
wp_head();
echo "\n";
wp_customheader();
echo "\n";
?>
<?php
$blogurl = get_bloginfo('url');
$currurl = $blogurl.$_SERVER['REQUEST_URI'];
$currurl = preg_quote($currurl,'/');
if(preg_match('/('.$currurl.'index.php)/','http://'.$_SERVER['SERVER_NAME'].$_SERVER['PHP_SELF']) || preg_match('/('.$currurl.'index.php)/','https://'.$_SERVER['SERVER_NAME'].$_SERVER['PHP_SELF'])) {
if(get_bloginfo('description') != '') {
$metadesc = get_bloginfo('description'); // We're at the home page
} else {
$supdate = new SourceUpdate;
$metadesc = $supdate->display(0);
}
} else {
// We must be in a page or a post
$postdata = get_post($postid,ARRAY_A);
$metadesc = substr($postdata['post_content'],0,134) . ' [...]';
}
$metadesc = strip_tags($metadesc);
?>
<meta name="description" content="<?php echo $metadesc; ?>" />
</head>
<body>
<?php flush(); ?>
<!-- google_ad_section_start(weight=ignore) -->
<!-- topbar -->
<div id="topbar">
<!-- topbar-inner -->
<div id="topbar-inner">
<ul>
<li id="topbar-subscribe"><a href="#">Subscribe</a></li>
<!--<li id="topbar-share"><a href="#">Bookmark/Share</a></li>-->
<?php if (is_user_logged_in()) { ?><li id="topbar-admin"><a href="<?php bloginfo('wpurl'); ?>/wp-admin" rel="nofollow">Admin</a></li><?php } ?>
</ul>
<?php include (TEMPLATEPATH . '/searchform.php'); ?>
</div>
<!-- /topbar-inner -->
</div>
<!-- /topbar -->
<!-- subscribe -->
<div id="subscribe">
<ul>
<li><a href="<?php echo $blogfeed; ?>" title="Subscribe to my feed" class="feed" rel="nofollow">RSS Feed</a></li>
<li><a href="http://www.bloglines.com/sub/<?php echo $blogfeed; ?>" class="feed" rel="nofollow">Bloglines</a></li>
<li><a href="http://fusion.google.com/add?feedurl=<?php echo $blogfeed; ?>" class="feed" rel="nofollow">Google Reader</a></li>
<li><a href="http://feeds.my.aol.com/add.jsp?url=<?php echo $blogfeed; ?>" class="feed" rel="nofollow">My AOL</a></li>
<li><a href="http://my.msn.com/addtomymsn.armx?id=rss&ut=<?php echo $blogfeed; ?>&ru=<?php echo get_settings('home'); ?>" class="feed" rel="nofollow">My MSN</a></li>
<li><a href="http://add.my.yahoo.com/rss?url=<?php echo $blogfeed; ?>" class="feed" rel="nofollow">My Yahoo!</a></li>
<li><a href="http://www.newsgator.com/ngs/subscriber/subext.aspx?url=<?php echo $blogfeed; ?>" class="feed" rel="nofollow">NewsGator</a></li>
<li><a href="http://www.pageflakes.com/subscribe.aspx?url=<?php echo $blogfeed; ?>" class="feed" rel="nofollow">Pageflakes</a></li>
<li><a href="http://technorati.com/faves?add=<?php echo get_settings('home'); ?>" class="feed" rel="nofollow">Technorati</a></li>
<li><a href="http://www.live.com/?add=<?php echo $blogfeed; ?>" class="feed" rel="nofollow">Windows Live</a></li>
</ul>
</div>
<!-- /subscribe -->
<!-- share -->
<div id="share">
</div>
<!-- /share -->
<!-- header -->
<div id="header">
<!-- header-inner -->
<div id="header-inner">
<div id="logo">
<?php
if(get_option('wicketpixie_theme_header_size')) {
$fontsize = get_option('wicketpixie_theme_header_size');
echo '<span style="font-size:',$fontsize,'px;">';
?>
<a href="<?php echo get_option('home'); ?>/" rel="nofollow"><?php bloginfo('name'); ?></a>
<?php
echo "</span>";
} else {
?>
<a href="<?php echo get_option('home'); ?>/" rel="nofollow"><?php bloginfo('name'); ?></a>
<?php } ?>
</div>
<!-- google_ad_section_end -->
<?php if (function_exists('aktt_latest_tweet')) { ?>
<!-- status -->
<div id="status">
<div id="twitter-tools">
<?php echo get_avatar('1', $size = '36', $default = 'images/avatar.jpg'); ?>
<p><?php aktt_latest_tweet(); ?></p>
<div id="status-bottom"> </div>
</div>
</div>
<!-- /status -->
<?php } elseif ($status->select()) { ?>
<!-- status -->
<div id="status">
<?php echo get_avatar('1', $size = '36', $default = 'images/avatar.jpg'); ?>
<p><?php echo $status->display(); ?></p>
<div id="status-bottom"> </div>
</div>
<!-- /status -->
<?php } else { ?>
<div id="status">
<?php echo get_avatar('1', $size = '36', $default = 'images/avatar.jpg'); ?>
<p id="description"><?php bloginfo('description'); ?></p>
<div id="status-bottom"> </div>
</div>
<?php } ?>
<!-- google_ad_section_start(weight=ignore) -->
<!-- leaderboard -->
<?php
if(is_enabled_adsense() == true) {
?>
<div id="leaderboard">
<?php $adsense->wp_adsense("blog_header"); ?>
</div>
<?php
} elseif(is_enabled_adsense() == false) {
?>
<!-- Enable Adsense on the WicketPixie Adsense Ads admin page. -->
<?php
}
?>
<!-- /leaderboard -->
</div>
<!-- /header-inner -->
</div>
<!-- /header -->
<!-- nav -->
<div id="nav">
<ul>
<?php
if (!is_home()) { ?>
<li><a href="<?php bloginfo('home'); ?>/">Home</a></li>
<?php
}
if (get_option('wicketpixie_adsense_search_enabled') == 'true') {
$sp = get_page_by_title('Search');
$id = $sp->ID;
wp_list_pages("depth=1&sort_column=menu_order&exclude=${id}&title_li=");
echo "<!-- Excluding $id -->";
unset($sp,$id);
} else {
wp_list_pages("depth=1&sort_column=menu_order&title_li=");
}
?>
</ul>
</div>
<!-- /nav -->
<!-- google_ad_section_end -->
<!-- wrapper -->
<div id="wrapper">
<!-- mid -->
<div id="mid" class="content">