XPressME Integration Kit

Trac

source: trunk/xpressme_integration_kit/wp-content/themes/xpress_default/blocks/meta_block_theme.php @ 360

Last change on this file since 360 was 360, checked in by toemon, 15 years ago

WP2.1.3MEへの対応 fixed #199
但しWP2.1.3ME自体のバグ(MySQL4.1以上でEUC-JPを使用したときの文字化け)があるので注意

File size: 3.4 KB
Line 
1<?php
2function meta_block($options)
3{
4        $mydirname = empty( $options[0] ) ? 'xpress' : $options[0] ;
5        $this_template = empty( $options[1] ) ? 'db:'.$mydirname.'_block_meta.html' : trim( $options[1] );
6        $wp_link = empty( $options[2] ) ? false : true ;
7        $xoops_link = empty( $options[3] ) ? false : true ;
8        $post_rss = empty( $options[4] ) ? false : true ;
9        $comment_rss = empty( $options[5] ) ? false : true ;
10        $post_new = empty( $options[6] ) ? false : true ;
11        $admin_edit = empty( $options[7] ) ? false : true ;
12        $readme = empty( $options[8] ) ? false : true ;
13        $ch_style = empty( $options[9] ) ? false : true ;
14       
15        $output ="<ul>\n";
16       
17        if ($wp_link){
18                $output .= '<li><a href="http://wordpress.org/" title="Powered by WordPress, state-of-the-art semantic personal publishing platform." target="_blank">WordPress</a></li>';
19        }
20        if ($xoops_link){
21                $output .= '<li><a href="http://xoopscube.sourceforge.net/" title="Powered by XOOPS Cube, state-of-the-art Content Management Portal." target="_blank">XOOPS cube</a></li>';
22        }
23        if ($post_rss){
24                $output .= '<li><a href="'.get_bloginfo('rss2_url').'" title="'. __('Posts RSS', 'xpress') .'">'. __('Posts RSS', 'xpress') .'</a></li>';
25        }
26        if ($comment_rss){     
27                $output .= '<li><a href="'.get_bloginfo('comments_rss2_url').'" title="'. __('Comments RSS', 'xpress') .'">'. __('Comments RSS', 'xpress') .'</a></li>';
28        }
29
30        if (is_user_logged_in()) {
31                global $current_user;
32
33                $Now_user_level = $current_user->user_level;
34               
35                if ($post_new){
36                        if($Now_user_level > 0){
37                                if (xpress_is_wp_version('<','2.1') ){
38                                        $output .=
39                                        '<li>'.
40                                        '<a href="'.get_settings('siteurl').'/wp-admin/post.php" title="'. __('Add New', 'xpress') .'">'. __('Add New', 'xpress') .'</a>'.
41                                        '</li>';
42                                } else {
43                                        $output .=
44                                        '<li>'.
45                                        '<a href="'.get_settings('siteurl').'/wp-admin/post-new.php" title="'. __('Add New', 'xpress') .'">'. __('Add New', 'xpress') .'</a>'.
46                                        '</li>';
47                                }
48                        }
49                }
50                if ($admin_edit){
51                        if($Now_user_level > 7){
52                                $output .=     
53                                '<li>'.
54                                '<a href="'.get_settings('siteurl').'/wp-admin/" title="'. __('Site Admin', 'xpress') .'">'. __('Site Admin', 'xpress') .'</a>'.
55                                '</li>';
56                        }
57                }
58                $output .=
59                                '<li>'.
60                                '<a href="'.get_settings('siteurl').'/wp-admin/profile.php" title="' . __('User Profile', 'xpress') .'">'. __('User Profile', 'xpress') .'</a>'.
61                                '</li>';                               
62               
63
64                if (defined('S2VERSION')){
65                        if($Now_user_level > 7){
66                                        $output .=
67                                        '<li>'.
68                                        '<a href="'.get_settings('siteurl').'/wp-admin/users.php?page=subscribe2/subscribe2.php" title="'. __('Subscription management', 'xpress') .'">'. __('Subscription management', 'xpress') .'</a>'.
69                                        '</li>';
70                        } else {
71                                        $output .=
72                                        '<li>'.
73                                        '<a href="'.get_settings('siteurl').'/wp-admin/profile.php?page=subscribe2/subscribe2.php" title="'. __('Subscription management', 'xpress') .'">'. __('Subscription management', 'xpress') .'</a>'.
74                                        '</li>';
75                        }
76                }
77                       
78        }
79       
80        if ($readme){
81                $output .='<li>'.'<a href="'.get_settings('siteurl').'/readme.html" title="' .  __('ReadMe', 'xpress') . '">' . __('ReadMe', 'xpress') . '</a>'.'</li>';
82        }
83        $output .= disp_mode_set();
84        if (function_exists('wp_theme_switcher') ) {
85                ob_start();
86                        echo '<li>' . __('Themes') . ':';
87                        wp_theme_switcher('dropdown');
88                        echo '</li>';
89                        $output .= ob_get_contents();
90                ob_end_clean();
91        }
92        $output .= '</ul>';
93        $block['meta_info'] = $output;
94        return $block ;
95}
96?>
Note: See TracBrowser for help on using the repository browser.