forked from EddieRingle/wicketpixie
/
home.php
307 lines (273 loc) · 15.8 KB
/
home.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
<?php get_header(); ?>
<?php $wp_auth_credit= wp_get_option( 'auth_credit' ); ?>
<!-- content -->
<div id="content">
<!-- google_ad_section_start -->
<?php query_posts('showposts=1'); ?>
<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>
<!-- post -->
<div class="post" style="border-bottom:0;">
<?php
require_once(TEMPLATEPATH .'/app/customcode.php');
$glob = fetchcustomcode('global_announcement.php',true);
if($glob != "" && $glob != fetchcustomcode('idontexist.no')): ?>
<div class="highlight">
<?php
echo $glob;
?>
</div>
<?php endif; ?>
<h1><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>" style="text-decoration:none;"><?php the_title(); ?></a></h1>
<div class="post-comments">
<div class="post-comments">
<ul>
<?php
$addlink="#respond";
$countlink="#comments";
?>
<li class="post-comments-count"><a href="<?php the_permalink(); echo $countlink; ?>" title="View all <?php comments_number('0', '1', '%'); ?> Comments"><?php comments_number('0', '1', '%'); ?></a></li>
<li class="post-comments-add"><a href="<?php the_permalink(); echo $addlink; ?>" title="Add a Comment"><span> </span>Add a Comment</a></li>
</ul>
</div>
</div>
<div class="post-author">
<?php if( $wp_auth_credit == 1 ) { ?>
<?php echo get_avatar( get_the_author_email(), $size = '36', $default = 'images/avatar.jpg' ); ?>
<p><strong><?php the_time('l, F jS') ?></strong><br/>
by <?php the_author_posts_link(); ?></p>
<?php } else { ?>
<p><strong><?php the_time('l, F jS') ?></strong><br/>
at <?php the_time('g:ia') ?></p>
<?php } ?>
</div>
<div class="clearer"></div>
<!-- post-ad -->
<?php
if(is_enabled_adsense() == true) {
?>
<div id="post-ad">
<?php $adsense->wp_adsense('blog_post_side'); ?>
<ul style="margin: 15px 0 0 5px">
<p align="center">
<script type="text/javascript" src="http://tweetmeme.com/i/scripts/button.js"></script>
</p>
<?php if (wp_get_option('plug_related-posts')):?>
<?php wp_related_posts(5); ?>
<?php endif;?>
</ul>
</div>
<?php
} else {
?>
<div id="post-ad">
<!-- Enable Adsense on the WicketPixie Adsense Ads admin page. -->
<ul style="margin: 15px 0 0 5px">
<?php if (wp_get_option('plug_related-posts')):?>
<?php wp_related_posts(5); ?>
<?php endif;?>
</ul>
</div>
<?php
}
?>
<!-- /post-ad -->
<div class="KonaBody">
<?php the_content('Continue reading »'); ?>
</div>
<?php wp_after_home_post_code(); ?>
</div>
<!-- /post -->
<!-- google_ad_section_end -->
<!-- post-meta -->
<div class="post-meta">
<?php if(wp_get_option('plug_related-posts') && function_exists(wp_related_posts)):?>
<!-- related-posts -->
<div id="related-posts">
<h3>You might also be interested in...</h3>
<ul>
<?php wp_related_posts(5); ?>
</ul>
</div>
<!-- /related-posts -->
<?php endif;?>
<!-- post-meta-right -->
<div class="post-meta-right">
<!-- post-meta-tags -->
<div class="post-meta-tags">
<h6>Tags</h6>
<?php the_tags('<ul><li>','</li><li>','</li></ul>'); ?>
</div>
<!-- /post-meta-tags -->
<!-- post-meta-categories -->
<div class="post-meta-categories">
<h6>Categories</h6>
<p><?php the_category(); ?></p>
</div>
<!-- /post-meta-categories -->
<!-- post-bigbox -->
<div class="post-bigbox">
<?php
if(is_enabled_adsense() == true) {
$adsense->wp_adsense('blog_post_bottom');
} elseif(is_enabled_adsense() == false) {
?>
<!-- Enable Adsense on the WicketPixie Adsense admin page. -->
<?php
}
?>
</div>
<!-- /post-bigbox -->
</div>
<!-- /post-meta-right -->
<div class="clearer"></div>
</div>
<!-- /post-meta -->
<!-- Custom Code Area -->
<?php
if(wp_get_option('home_custom') != false && wp_get_option('home_custom') != "") {
echo stripslashes(wp_get_option('home_custom'));
}
?>
<!-- /Custom Code Area -->
<?php endwhile; ?>
<?php endif; ?>
<?php
if(wp_get_option('home_video') != "0") { ?>
<div id="home-categories">
<?php
if(wp_get_option('home_show_vid_heading') != "0") {
echo "<h2>My Videos</h2>";
}
if(wp_get_option('home_video_code') != false && wp_get_option('home_video_code') != "") {
echo stripslashes(wp_get_option('home_video_code'));
} else {
?>
<object width="500" height="285"><param name="movie" value="http://www.youtube.com/cp/vjVQa1PpcFOi2GvexXT8XYrvBOsPoeQUt32UxT-AJgI="></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/cp/vjVQa1PpcFOi2GvexXT8XYrvBOsPoeQUt32UxT-AJgI=" type="application/x-shockwave-flash" wmode="transparent" width="500" height="285"></embed></object>
<?php
}
?>
</div>
<div class="clearer"></div>
<?php } ?>
<?php
if(wp_get_option('home_flickr') != "0") { ?>
<!-- home-photos -->
<div id="home-photos">
<?php
if(wp_get_option('flickrid') != false && wp_get_option('flickrid') != "") {
$flickrid = wp_get_option('flickrid');
} else {
$flickrid = '49503157467@N01';
}
if(wp_get_option('home_show_photo_heading') != "0") {
echo "<h2>Recent Photos</h2>";
}
?>
<script type="text/javascript" src="http://www.flickr.com/badge_code_v2.gne?count=6&display=latest&size=s&layout=x&source=user&user=<?php echo $flickrid; ?>"></script>
</div>
<!-- /home-photos -->
<div class="clearer"></div>
<?php
}
?>
<!-- home-tags
<div id="home-tags">
<h2>Popular Tags</h2>
<ul>
<?php wp_tag_cloud('orderby=count&order=DESC&unit=px&smallest=11&largest=11&format=list'); ?>
</ul>
<div class="clearer"></div>
</div>
/home-tags -->
</div>
<!-- content -->
<!-- sidebar -->
<div id="sidebar">
<?php
if(wp_get_option('home_sidebar_buttons') != "0") {
include TEMPLATEPATH .'/widgets/sidebar-buttons.php';
}
?>
<!-- width = 340, height = 240 -->
<?php if (wp_get_option('home_ustream')):?>
<div id="home-youtube">
<?php echo "<h3>".wp_get_option('home_ustream_heading')."</h3>"; ?>
<?php $key = "uzhqbxc7pqzqyvqze84swcer"; ?>
<?php
if (wp_get_option('ustreamchannel') != false && wp_get_option('ustreamchannel') != "") { $chan = wp_get_option('ustreamchannel'); } else { $trip = true; }
if (wp_get_option('home_ustream_height') != false && wp_get_option('home_ustream_height') != "") { $height = wp_get_option('home_ustream_height'); } else { $trip = true; }
if (wp_get_option('home_ustream_width') != false && wp_get_option('home_ustream_width') != "") { $width = wp_get_option('home_ustream_width'); } else { $trip = true; }
if (wp_get_option('home_ustream_autoplay') == "1") { $autoplay = true; } else { $autoplay = false; }
if ($trip == true) {
$out = "<!-- Please go back to the Home Editor and set the settings for this widget. -->";
} else {
$url = "http://api.ustream.tv/php/channel/$chan/getInfo?key=$key";
$cl = curl_init($url);
curl_setopt($cl,CURLOPT_HEADER,false);
curl_setopt($cl,CURLOPT_RETURNTRANSFER,true);
$resp = curl_exec($cl);
curl_close($cl);
$resultsArray = unserialize($resp);
$out = $resultsArray['results'];
}
echo '<object id="utv_o_'.$out['id'].'" height="'.$height.'" width="'.$width.'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"><param value="http://www.ustream.tv/flash/live/'.$out['id'].'" name="movie" /><param value="true" name="allowFullScreen" /><param value="always" name="allowScriptAccess" /><param value="transparent" name="wmode" /><param value="viewcount=true&autoplay='.$autoplay.'" name="flashvars" /><embed name="utv_e_'.$out['id'].'" id="utv_e_'.$out['id'].'" flashvars="viewcount=true&autoplay='.$autoplay.'" height="'.$height.'" width="'.$width.'" allowfullscreen="true" allowscriptaccess="always" wmode="transparent" src="http://www.ustream.tv/flash/live/'.$out['id'].'" type="application/x-shockwave-flash" /></object>';
?>
</div>
<?php endif; ?>
<!-- /youtube -->
<!-- recent-posts -->
<div id="sidebar1">
<div class="widget">
<h3>What else is new?</h3>
<?php query_posts('showposts=5&offset=1'); ?>
<?php while (have_posts()) : the_post(); ?>
<!-- post -->
<h5><a href="<?php the_permalink() ?>" rel="bookmark" title="Continue reading <?php the_title(); ?>"><?php the_title(); ?></a></h5>
<p style="font-size:1em"><?php the_time('l, F jS') ?> | <?php comments_popup_link('No Comments', '1 Comment', '% Comments'); ?></p>
<!-- /post -->
<?php endwhile; ?>
<div style="padding-bottom:15px"></div>
<h3>Recent Comments</h3>
<style type="text/css">
.recentcomments a {
display: inline !important;
padding: 0 !important;
margin: 0 !important;
}
</style>
<ul class="recentcomments">
<?php
if(!$comments = wp_cache_get('recent_comments','widget')) {
$comments = $wpdb->get_results("SELECT * FROM $wpdb->comments WHERE comment_approved = '1' ORDER BY comment_date_gmt DESC LIMIT 5");
wp_cache_add('recent_comments',$comments,'widget');
}
if($comments) : foreach((array)$comments as $comment) :
echo '<li class="recentcomments">',sprintf(_x('%1$s on %2$s','widgets'),get_comment_author_link(),'<a href="'.esc_url(get_comment_link($comment->comment_ID)).'">'.get_the_title($comment->comment_post_ID).'</a>'),'</li>';
endforeach; endif;
?>
</ul>
<div style="padding-bottom:15px"></div>
<h3>Random Posts From the Archive</h3>
<?php query_posts('showposts=5&random=true'); ?>
<?php while (have_posts()) : the_post(); ?>
<h5><a href="<?php the_permalink() ?>" rel="bookmark" title="Continue reading <?php the_title(); ?>"><?php the_title(); ?></a></h5>
<p style="font-size:1em"><?php the_time('l, F jS') ?> | <?php comments_popup_link('No Comments', '1 Comment', '% Comments'); ?></p>
<?php endwhile; ?>
<div style="padding-bottom:15px"></div>
<h3>Popular Tags</h3>
<?php wp_tag_cloud('orderby=count&order=DESC&unit=px&smallest=8&largest=16&format=flat'); ?>
<div style="padding-bottom:15px"></div>
<!-- Custom Sidebar Code -->
<?php
require_once(TEMPLATEPATH .'/app/customcode.php');
fetchcustomcode('homesidebar.php');
?>
<!-- /Custom Sidebar Code -->
<div style="padding-bottom:15px"></div>
</div>
</div>
<!-- /recent-posts -->
</div>
<!-- sidebar -->
<?php get_footer(); ?>