source: trunk/www.guidonia.net/wp/wp-content/themes/atahualpa/functions/bfa_footer.php@ 44

Last change on this file since 44 was 44, checked in by luciano, 15 years ago
File size: 2.3 KB
Line 
1<?php
2function footer_page_links($matches) {
3 $page_id = $matches[1];
4 $page_data = get_page($page_id, ARRAY_A);
5 $page_title = $page_data['post_title'];
6 $page_url = get_permalink($page_id);
7
8 return '<a href="' . $page_url . '">' . $page_title . '</a>';
9}
10
11
12function loginout_link() {
13 if ( ! is_user_logged_in() )
14 $link = '<a href="' . get_settings('siteurl') . '/wp-login.php"' . ($bfa_ata_nofollow == "Yes" ? ' rel="nofollow"' : '') . '>' . __('Login','atahualpa') . '</a>';
15 else
16 $link = '<a href="' . get_settings('siteurl') . '/wp-login.php?action=logout">' . __('Logout','atahualpa') . '</a>';
17
18 return apply_filters('loginout', $link);
19}
20
21
22function register_link() {
23 if ( ! is_user_logged_in() ) {
24 if ( get_settings('users_can_register') )
25 $link = '<a href="' . get_settings('siteurl') . '/wp-register.php"' . ($bfa_ata_nofollow == "Yes" ? ' rel="nofollow"' : '') . '>' . __('Register','atahualpa') . '</a>';
26 else
27 $link = '';
28 }
29
30 return apply_filters('register', $link);
31}
32
33function admin_link() {
34 if ( is_user_logged_in() ) {
35 $link = '<a href="' . get_settings('siteurl') . '/wp-admin/">' . __('Site Admin','atahualpa') . '</a>';
36 }
37
38 return apply_filters('register', $link);
39}
40
41
42function bfa_footer($footer_content) {
43
44if (strpos($footer_content,'%page')!==false) {
45// page links
46$footer_content = preg_replace_callback("|%page-(.*?)%|","footer_page_links",$footer_content);
47}
48
49// home link
50$footer_content = str_replace("%home%", '<a href="' . get_option('home') . '/">' . get_option('blogname') . '</a>', $footer_content);
51// login/logout link
52$footer_content = str_replace("%loginout%", loginout_link(), $footer_content);
53// admin link
54$footer_content = str_replace("%admin%", admin_link(), $footer_content);
55// register link
56$footer_content = str_replace("%register%", register_link(), $footer_content);
57// RSS link
58$footer_content = str_replace("%rss%", get_bloginfo('rss2_url'), $footer_content);
59// Comments RSS link
60$footer_content = str_replace("%comments-rss%", get_bloginfo('comments_rss2_url'), $footer_content);
61// Current Year
62$footer_content = str_replace("%current-year%", date('Y'), $footer_content);
63
64
65return footer_output($footer_content);
66
67}
68?>
Note: See TracBrowser for help on using the repository browser.