Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 555 lines (494 sloc) 15.213 kB
f272040 Importing the Hybrid Tabs plugin files and folders.
greenshady authored
1 <?php
2 /**
3 * Functions for displaying tabbed content within the tabs widget.
4 * This only needs to be loaded on the front page of the site.
5 *
6 * @package HybridTabs
7 */
8
9 /**
10 * Replicates the default meta widget.
11 *
12 * @since 0.2
13 */
14 function hybrid_tabs_meta() {
15 echo '<ul>';
16 wp_register();
17 echo '<li>'; wp_loginout(); echo '</li>';
18 echo '<li><a href="' . get_bloginfo('rss2_url') . '" title="' . esc_attr( __('Syndicate this site using RSS 2.0', 'hybrid_tabs') ) . '">' . __('Entries <abbr title="Really Simple Syndication">RSS</abbr>', 'hybrid_tabs') . '</a></li>';
19 echo '<li><a href="' . get_bloginfo('comments_rss2_url') . '" title="' . esc_attr( __('The latest comments to all posts in RSS', 'hybrid_tabs') ) . '">' . __('Comments <abbr title="Really Simple Syndication">RSS</abbr>', 'hybrid_tabs') . '</a></li>';
20 echo '<li><a href="http://wordpress.org/" title="' . esc_attr( __('Powered by WordPress, state-of-the-art semantic personal publishing platform.', 'hybrid_tabs') ) . '>">WordPress.org</a></li>';
21 wp_meta();
22 echo '</ul>';
23 }
24
25 /**
26 * Displays the WordPress calendar.
27 * @uses get_calendar()
28 * @link http://codex.wordpress.org/Template_Tags/get_calendar
29 *
30 * @since 0.2
31 */
32 function hybrid_tabs_calendar() {
33 echo '<div class="calendar-wrap">';
34 get_calendar();
35 echo '</div>';
36 }
37
38 /**
39 * Lists last 10 years of archives.
40 * @uses wp_get_archives()
41 * @link http://codex.wordpress.org/Template_Tags/wp_get_archives
42 *
43 * @since 0.1
44 */
45 function hybrid_tabs_yearly_archives() {
46 echo '<ul class="xoxo yearly-archives">';
47 echo str_replace( array( "\r", "\n", "\t" ), '', wp_get_archives( array( 'type' => 'yearly', 'limit' => 10, 'echo' => false ) ) );
48 echo '</ul>';
49 }
50
51 /**
52 * Lists last 10 months of archives.
53 * @uses wp_get_archives()
54 * @link http://codex.wordpress.org/Template_Tags/wp_get_archives
55 *
56 * @since 0.1
57 */
58 function hybrid_tabs_monthly_archives() {
59 echo '<ul class="xoxo monthly-archives">';
60 echo str_replace( array( "\r", "\n", "\t" ), '', wp_get_archives( array( 'type' => 'monthly', 'limit' => 10, 'echo' => false ) ) );
61 echo '</ul>';
62 }
63
64 /**
65 * Lists last 10 weeks of archives.
66 * @uses wp_get_archives()
67 * @link http://codex.wordpress.org/Template_Tags/wp_get_archives
68 *
69 * @since 0.1
70 */
71 function hybrid_tabs_weekly_archives() {
72 echo '<ul class="xoxo weekly-archives">';
73 echo str_replace( array( "\r", "\n", "\t" ), '', wp_get_archives( array( 'type' => 'weekly', 'limit' => 10, 'echo' => false ) ) );
74 echo '</ul>';
75 }
76
77 /**
78 * Lists last 10 days of archives.
79 * @uses wp_get_archives()
80 * @link http://codex.wordpress.org/Template_Tags/wp_get_archives
81 *
82 * @since 0.1
83 */
84 function hybrid_tabs_daily_archives() {
85 echo '<ul class="xoxo daily-archives">';
86 echo str_replace( array( "\r", "\n", "\t" ), '', wp_get_archives( array( 'type' => 'daily', 'limit' => 10, 'echo' => false ) ) );
87 echo '</ul>';
88 }
89
90 /**
91 * Lists last 10 posts.
92 * @uses wp_get_archives()
93 * @link http://codex.wordpress.org/Template_Tags/wp_get_archives
94 *
95 * @since 0.1
96 */
97 function hybrid_tabs_postbypost_archives() {
98 echo '<ul class="xoxo postbypost-archives">';
99 echo str_replace( array( "\r", "\n", "\t" ), '', wp_get_archives( array( 'type' => 'postbypost', 'limit' => 10, 'echo' => false ) ) );
100 echo '</ul>';
101 }
102
103 /**
104 * Lists 10 posts in alphabetical order.
105 * @uses wp_get_archives()
106 * @link http://codex.wordpress.org/Template_Tags/wp_get_archives
107 *
108 * @since 0.2
109 */
110 function hybrid_tabs_alpha_archives() {
111 echo '<ul class="xoxo alpha-archives">';
112 echo str_replace( array( "\r", "\n", "\t" ), '', wp_get_archives( array( 'type' => 'alpha', 'limit' => 10, 'echo' => false ) ) );
113 echo '</ul>';
114 }
115
116 /**
117 * Lists blog authors.
118 * @uses wp_list_authors()
119 * @link http://codex.wordpress.org/Template_Tags/wp_list_authors
120 *
121 * @since 0.1
122 */
123 function hybrid_tabs_authors() {
124 echo '<ul class="xoxo authors">';
125 echo str_replace( array( "\r", "\n", "\t" ), '', wp_list_authors( array( 'exclude_admin' => false, 'echo' => false ) ) );
126 echo '</ul>';
127 }
128
129 /**
130 * Lists bookmarks/links from a specific link category.
131 * @uses wp_list_bookmarks()
132 * @link http://codex.wordpress.org/Template_Tags/wp_list_bookmarks
133 *
134 * @since 0.1
135 * @param object $tab The current tab being displayed.
136 */
137 function hybrid_tabs_bookmarks( $tab ) {
138
139 $args = array(
140 'category_name' => $tab->label,
141 'categorize' => false,
142 'title_li' => false,
143 'title_before' => false,
144 'title_after' => false,
145 'category_before' => false,
146 'category_after' => false,
147 'link_before' => '<span>',
148 'link_after' => '</span>',
149 'show_rating' => false,
150 'show_updated' => false,
151 'show_description' => false,
152 'show_images' => false,
153 'echo' => false,
154 );
155
156 echo '<ul class="xoxo bookmarks">';
157 echo str_replace( array( "\r", "\n", "\t" ), '', wp_list_bookmarks( $args ) );
158 echo '</ul>';
159 }
160
161 /**
162 * Lists the blog's post categories.
163 * @uses wp_list_categories()
164 * @link http://codex.wordpress.org/Template_Tags/wp_list_categories
165 *
166 * @since 0.1
167 */
168 function hybrid_tabs_categories() {
169 echo '<ul class="xoxo categories">';
170 echo str_replace( array( "\r", "\n", "\t" ), '', wp_list_categories( array( 'use_desc_for_title' => false, 'orderby' => 'name', 'title_li' => false, 'echo' => false ) ) );
171 echo '</ul>';
172 }
173
174 /**
175 * Lists all the blog's pages.
176 * @uses wp_list_pages()
177 * @link http://codex.wordpress.org/Template_Tags/wp_list_pages
178 *
179 * @since 0.1
180 */
181 function hybrid_tabs_pages() {
182 echo '<ul class="xoxo pages">';
183 echo str_replace( array( "\r", "\n", "\t" ), '', wp_list_pages( array( 'echo' => false, 'title_li' => false ) ) );
184 echo '</ul>';
185 }
186
187 /**
188 * Lists 10 random posts.
189 * @uses get_posts()
190 * @link http://codex.wordpress.org/Template_Tags/get_posts
191 *
192 * @since 0.1
193 */
194 function hybrid_tabs_random() {
195 echo '<ul class="xoxo random">';
196 $random_posts = get_posts( array( 'numberposts' => 10, 'orderby' => 'rand' ) );
197 foreach ( $random_posts as $post ) :
198 global $post;
199 the_title( '<li><a href="' . get_permalink() . '" title="' . the_title_attribute( 'echo=0' ) . '" rel="bookmark">', '</a></li>', true );
200 endforeach;
201 echo '</ul>';
202 }
203
204 /**
205 * Displays a term/tag cloud of the given taxonomy.
206 * @uses wp_tag_cloud()
207 * @link http://codex.wordpress.org/Template_Tags/wp_tag_cloud
208 *
209 * @since 0.2
210 * @param object $tab The current tab.
211 */
212 function hybrid_tabs_term_cloud( $tab ) {
213 $tax = str_replace( '_cloud', '', $tab->name );
214
215 echo '<p class="term-cloud ' . $tax . '-cloud">';
216 echo wp_tag_cloud( array( 'taxonomy' => $tax, 'largest' => 15, 'smallest' => 8, 'order' => 'ASC', 'echo' => false ) );
217 echo '</p>';
218 }
219
220 /**
221 * Displays the WP Wall plugin.
222 * @link http://wordpress.org/extend/plugins/wp-wall
223 * @since 0.2
224 */
225 function hybrid_tabs_WPWall_Widget() {
226 if ( function_exists( 'WPWall_Widget' ) )
227 WPWall_Widget();
228 }
229
230 /**
231 * Displays the Events Calendar plugin.
232 * @link http://wordpress.org/extend/plugins/events-calendar
233 * @since 0.2
234 */
235 function hybrid_tabs_sidebarEventsCalendar() {
236 if ( function_exists( 'sidebarEventsCalendar' ) )
237 sidebarEventsCalendar();
238 }
239
240 /**
241 * Displays the Sidebar Login plugin.
242 * @link http://wordpress.org/extend/plugins/sidebar-login
243 * @since 0.2
244 */
245 function hybrid_tabs_sidebarlogin() {
246 if ( function_exists( 'sidebarlogin' ) )
247 sidebarlogin();
248 }
249
250 /**
251 * Displays the most viewed posts by the WP PostViews plugin.
252 * @link http://wordpress.org/extend/plugins/wp-postviews
253 * @since 0.2
254 */
255 function hybrid_tabs_get_most_viewed() {
256 if ( !function_exists( 'get_most_viewed' ) )
257 return false;
258
259 echo '<ul class="xoxo most-viewed">';
260 get_most_viewed( '', 10, 0, true );
261 echo '</ul>';
262 }
263
264 /**
265 * Displays the least viewed posts by the WP PostViews plugin.
266 * @link http://wordpress.org/extend/plugins/wp-postviews
267 * @since 0.2
268 */
269 function hybrid_tabs_get_least_viewed() {
270 if ( !function_exists( 'get_least_viewed' ) )
271 return false;
272
273 echo '<ul class="xoxo least-viewed">';
274 get_least_viewed( '', 10, 0, true );
275 echo '</ul>';
276 }
277
278 /**
279 * Displays the recent comments by the WP Stats plugin.
280 * @link http://wordpress.org/extend/plugins/wp-stats
281 * @since 0.2
282 */
283 function hybrid_tabs_get_recentcomments() {
284 if ( !function_exists( 'get_recentcomments' ) )
285 return false;
286
287 echo '<ul class="xoxo recent-comments">';
288 get_recentcomments( '', 10, true );
289 echo '</ul>';
290 }
291
292 /**
293 * Displays the most-commented posts by the WP Stats plugin.
294 * @link http://wordpress.org/extend/plugins/wp-stats
295 * @since 0.2
296 */
297 function hybrid_tabs_get_mostcommented() {
298 if ( !function_exists( 'get_mostcommented' ) )
299 return false;
300
301 echo '<ul class="xoxo most-commented">';
302 get_mostcommented( '', 10, 0, true );
303 echo '</ul>';
304 }
305
306 /**
307 * Displays authors' stats by the WP Stats plugin.
308 * @link http://wordpress.org/extend/plugins/wp-stats
309 * @since 0.2
310 */
311 function hybrid_tabs_get_authorsstats() {
312 if ( !function_exists( 'get_authorsstats' ) )
313 return false;
314
315 echo '<ul class="xoxo authors-stats">';
316 get_authorsstats( '', true );
317 echo '</ul>';
318 }
319
320 /**
321 * Displays the comment member stats by the WP Stats plugin.
322 * @link http://wordpress.org/extend/plugins/wp-stats
323 * @since 0.2
324 */
325 function hybrid_tabs_get_commentmembersstats() {
326 if ( !function_exists( 'get_commentmembersstats' ) )
327 return false;
328
329 echo '<ul class="xoxo comment-members-stats">';
330 get_commentmembersstats( -1, 0, true );
331 echo '</ul>';
332 }
333
334 /**
335 * Displays the post category stats by the WP Stats plugin.
336 * @link http://wordpress.org/extend/plugins/wp-stats
337 * @since 0.2
338 */
339 function hybrid_tabs_get_postcats() {
340 if ( !function_exists( 'get_postcats' ) )
341 return false;
342
343 echo '<ul class="xoxo post-category-stats">';
344 get_postcats( true );
345 echo '</ul>';
346 }
347
348 /**
349 * Displays the link category stats by the WP Stats plugin.
350 * @link http://wordpress.org/extend/plugins/wp-stats
351 * @since 0.2
352 */
353 function hybrid_tabs_get_linkcats() {
354 if ( !function_exists( 'get_linkcats' ) )
355 return false;
356
357 echo '<ul class="xoxo link-category-stats">';
358 get_linkcats( true );
359 echo '</ul>';
360 }
361
362 /**
363 * Displays the post tags stats by the WP Stats plugin.
364 * @link http://wordpress.org/extend/plugins/wp-stats
365 * @since 0.2
366 */
367 function hybrid_tabs_get_tags_list() {
368 if ( !function_exists( 'get_tags_list' ) )
369 return false;
370
371 echo '<ul title="xoxo post_tag-stats">';
372 get_tags_list( true );
373 echo '</ul>';
374 }
375
376 /**
377 * Displays the Configurable Tag Cloud plugin.
378 * @link http://wordpress.org/extend/plugins/configurable-tag-cloud-widget
379 * @since 0.2
380 */
381 function hybrid_tabs_ctc() {
382 if ( !function_exists( 'ctc' ) )
383 return false;
384
385 echo '<p class="term-cloud post_tag-cloud">';
386 ctc();
387 echo '</p>';
388 }
389
390 /**
391 * Displays the Hot Friends plugin.
392 * @link http://wordpress.org/extend/plugins/hot-friends
393 * @since 0.2
394 */
395 function hybrid_tabs_hot_friends() {
396 if ( function_exists( 'hot_friends' ) )
397 hot_friends();
398 }
399
400 /**
401 * Displays the flickrRSS plugin.
402 * @link http://wordpress.org/extend/plugins/flickr-rss
403 * @since 0.2
404 */
405 function hybrid_tabs_get_flickrRSS() {
406 if ( function_exists( 'get_flickrRSS' ) )
407 get_flickrRSS();
408 }
409
410 /**
411 * Displays the most rated posts by the WP Post Ratings plugin.
412 * @link http://wordpress.org/extend/plugins/wp-postratings
413 * @since 0.2
414 */
415 function hybrid_tabs_get_most_rated() {
416 if ( !function_exists( 'get_most_rated' ) )
417 return false;
418
419 echo '<ul class="xoxo most-rated">';
420 get_most_rated( '', 0, 10, 0, true );
421 echo '</ul>';
422 }
423
424 /**
425 * Displays the highest rated posts by the WP Post Ratings plugin.
426 * @link http://wordpress.org/extend/plugins/wp-postratings
427 * @since 0.2
428 */
429 function hybrid_tabs_get_highest_rated() {
430 if ( !function_exists( 'get_highest_rated' ) )
431 return false;
432
433 echo '<ul class="xoxo highest-rated">';
434 get_highest_rated( '', 0, 10, 0, true );
435 echo '</ul>';
436 }
437
438 /**
439 * Displays the lowest rated posts by the WP Post Ratings plugin.
440 * @link http://wordpress.org/extend/plugins/wp-postratings
441 * @since 0.2
442 */
443 function hybrid_tabs_get_lowest_rated() {
444 if ( !function_exists( 'get_lowest_rated' ) )
445 return false;
446
447 echo '<ul class="xoxo lowest-rated">';
448 get_lowest_rated( '', 0, 10, 0, true );
449 echo '</ul>';
450 }
451
452 /**
453 * Displays the WP Cumulus plugin.
454 * @link http://wordpress.org/extend/plugins/wp-cumulus
455 * @since 0.2
456 */
457 function hybrid_tabs_wp_cumulus_insert() {
458 if ( function_exists( 'wp_cumulus_insert' ) )
459 wp_cumulus_insert();
460 }
461
462 /**
463 * Displays latest comments by the Get Recent Comments plugin.
464 * @link http://wordpress.org/extend/plugins/get-recent-comments
465 * @since 0.2
466 */
467 function hybrid_tabs_recent_comments() {
468 if ( !function_exists( 'get_recent_comments' ) )
469 return false;
470
471 echo '<ul class="xoxo recent-comments">';
472 get_recent_comments();
473 echo '</ul>';
474 }
475
476 /**
477 * Displays latest trackbacks by the Get Recent Comments plugin.
478 * @link http://wordpress.org/extend/plugins/get-recent-comments
479 * @since 0.2
480 */
481 function hybrid_tabs_recent_trackbacks() {
482 if ( !function_exists( 'get_recent_trackbacks' ) )
483 return false;
484
485 echo '<ul class="xoxo recent-trackbacks">';
486 get_recent_trackbacks();
487 echo '</ul>';
488 }
489
490 /**
491 * Displays a radom quote by the Quote This plugin.
492 * @link http://justintadlock.com/archives/2009/03/26/quote-this-wordpress-plugin
493 * @since 0.2
494 * @param object $tab The tab object.
495 */
496 function hybrid_tabs_quote_this( $tab ) {
497 $type = str_replace( '_quote_this', '', $tab->name );
498 quote_this( array( 'type' => $type, 'orderby' => 'rand', 'format' => 'p' ) );
499 }
500
501 /**
502 * Custom tab that can be filtered with custom function.
503 * @deprecated 0.2 Use register_hybrid_tab() instead.
504 * @since 0.1
505 */
506 function hybrid_tabs_custom_1() {
507 echo apply_filters( 'hybrid_tabs_custom_1', '' );
508 }
509
510 /**
511 * Custom tab that can be filtered with custom function.
512 * @deprecated 0.2 Use register_hybrid_tab() instead.
513 * @since 0.1
514 */
515 function hybrid_tabs_custom_2() {
516 echo apply_filters( 'hybrid_tabs_custom_2', '' );
517 }
518
519 /**
520 * Custom tab that can be filtered with custom function.
521 * @deprecated 0.2 Use register_hybrid_tab() instead.
522 * @since 0.1
523 */
524 function hybrid_tabs_custom_3() {
525 echo apply_filters( 'hybrid_tabs_custom_3', '' );
526 }
527
528 /**
529 * Custom tab that can be filtered with custom function.
530 * @deprecated 0.2 Use register_hybrid_tab() instead.
531 * @since 0.1
532 */
533 function hybrid_tabs_custom_4() {
534 echo apply_filters( 'hybrid_tabs_custom_4', '' );
535 }
536
537 /**
538 * Custom tab that can be filtered with custom function.
539 * @deprecated 0.2 Use register_hybrid_tab() instead.
540 * @since 0.1
541 */
542 function hybrid_tabs_custom_5() {
543 echo apply_filters( 'hybrid_tabs_custom_5', '' );
544 }
545
546 /**
547 * Custom tab that can be filtered with custom function.
548 * @deprecated 0.2 Use register_hybrid_tab() instead.
549 * @since 0.1
550 */
551 function hybrid_tabs_custom_6() {
552 echo apply_filters( 'hybrid_tabs_custom_6', '' );
553 }
554
555 ?>
Something went wrong with that request. Please try again.