XPressME Integration Kit

Trac

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

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

抜粋のロジックを、wp-multibyte-patchと同等の処理を行うようにする。 #82
XOOPS,WordPressの表示切替(ユーザ選択)機能 #11
bump Ver0.20

File size: 3.2 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://jp.xoops.org/" 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                                        $output .=
38                                        '<li>'.
39                                        '<a href="'.get_settings('siteurl').'/wp-admin/post-new.php" title="'. __('Add New', 'xpress') .'">'. __('Add New', 'xpress') .'</a>'.
40                                        '</li>';
41                        }
42                }
43                if ($admin_edit){
44                        if($Now_user_level > 7){
45                                $output .=     
46                                '<li>'.
47                                '<a href="'.get_settings('siteurl').'/wp-admin/" title="'. __('Site Admin', 'xpress') .'">'. __('Site Admin', 'xpress') .'</a>'.
48                                '</li>';
49                        }
50                }
51                $output .=
52                                '<li>'.
53                                '<a href="'.get_settings('siteurl').'/wp-admin/profile.php" title="' . __('User Profile', 'xpress') .'">'. __('User Profile', 'xpress') .'</a>'.
54                                '</li>';                               
55               
56
57                if (defined('S2VERSION')){
58                        if($Now_user_level > 7){
59                                        $output .=
60                                        '<li>'.
61                                        '<a href="'.get_settings('siteurl').'/wp-admin/users.php?page=subscribe2/subscribe2.php" title="'. __('Subscription management', 'xpress') .'">'. __('Subscription management', 'xpress') .'</a>'.
62                                        '</li>';
63                        } else {
64                                        $output .=
65                                        '<li>'.
66                                        '<a href="'.get_settings('siteurl').'/wp-admin/profile.php?page=subscribe2/subscribe2.php" title="'. __('Subscription management', 'xpress') .'">'. __('Subscription management', 'xpress') .'</a>'.
67                                        '</li>';
68                        }
69                }
70                       
71        }
72       
73        if ($readme){
74                $output .='<li>'.'<a href="'.get_settings('siteurl').'/readme.html" title="' .  __('ReadMe', 'xpress') . '">' . __('ReadMe', 'xpress') . '</a>'.'</li>';
75        }
76        $output .= disp_mode_set();
77        if (function_exists('wp_theme_switcher') ) {
78                ob_start();
79                        echo '<li>' . __('Themes') . ':';
80                        wp_theme_switcher('dropdown');
81                        echo '</li>';
82                        $output .= ob_get_contents();
83                ob_end_clean();
84        }
85        $output .= '</ul>';
86        $block['meta_info'] = $output;
87        return $block ;
88}
89?>
Note: See TracBrowser for help on using the repository browser.