[122] | 1 | <?php
|
---|
| 2 | function 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){
|
---|
[206] | 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>';
|
---|
[122] | 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){
|
---|
[360] | 37 | if (xpress_is_wp_version('<','2.1') ){
|
---|
[122] | 38 | $output .=
|
---|
| 39 | '<li>'.
|
---|
[270] | 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>'.
|
---|
[122] | 45 | '<a href="'.get_settings('siteurl').'/wp-admin/post-new.php" title="'. __('Add New', 'xpress') .'">'. __('Add New', 'xpress') .'</a>'.
|
---|
| 46 | '</li>';
|
---|
[270] | 47 | }
|
---|
[122] | 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 | }
|
---|
[145] | 83 | $output .= disp_mode_set();
|
---|
[122] | 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 | ?> |
---|