1 | <?php get_header(); ?>
|
---|
2 |
|
---|
3 | <div id="content" class="widecolumn">
|
---|
4 | <h3><?php _e('Site News', 'xpress'); ?></h3>
|
---|
5 | <ul>
|
---|
6 | <?php
|
---|
7 | query_posts('showposts=7');
|
---|
8 | if (have_posts()) : ?><?php while (have_posts()) : the_post(); ?>
|
---|
9 | <li><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title();?> </a></li>
|
---|
10 | <?php endwhile; ?><?php endif; ?>
|
---|
11 | </ul>
|
---|
12 | <br />
|
---|
13 | <h3><?php _e('Blogs List', 'xpress'); ?></h3>
|
---|
14 | <?php
|
---|
15 | $blog_list = get_blog_list( 0, 'all' );
|
---|
16 | echo "<ul>\n";
|
---|
17 | foreach ($blog_list AS $blog) {
|
---|
18 | $url = 'http://' .$blog['domain'] .$blog['path'];
|
---|
19 | $blog_name = get_blog_option( $blog['blog_id'], 'blogname' );
|
---|
20 | $post_count = $blog['postcount'];
|
---|
21 |
|
---|
22 | echo "<li><a href=\" $url \"> $blog_name </a> (" . __('post count','xpress') . ":$post_count) </li>";
|
---|
23 | }
|
---|
24 | echo "</ul>\n";
|
---|
25 | ?>
|
---|
26 | <br />
|
---|
27 |
|
---|
28 | <?php
|
---|
29 | $date_format = get_settings('date_format');
|
---|
30 | $blog_count = get_blog_count();
|
---|
31 | if ($blog_count > 1){
|
---|
32 | echo '<h3>' . __('New Entries', 'xpress') . "</h3>\n";
|
---|
33 |
|
---|
34 | $blog_list = get_blog_list();
|
---|
35 | echo "<ul>\n";
|
---|
36 | for ($i = 0; $i < $blog_count; $i++){
|
---|
37 | $blog_id = $blog_list[$i]['blog_id'];
|
---|
38 | if ($blog_id == 1) continue;
|
---|
39 | $output_blogs = '<li><a href="' .
|
---|
40 | get_blog_option($blog_id,'siteurl') . '">' .
|
---|
41 | get_blog_option($blog_id,'blogname') .
|
---|
42 | '</a></li>';
|
---|
43 | echo $output_blogs;
|
---|
44 |
|
---|
45 | $wpdb->set_blog_id($blog_id);
|
---|
46 | query_posts("showposts=3&post_status=publish");
|
---|
47 | if (have_posts()){
|
---|
48 | echo "<ul>\n";
|
---|
49 | while(have_posts()){
|
---|
50 | the_post();
|
---|
51 | echo '<li>';
|
---|
52 | echo '<a href="' . $post->guid . '">' . $post->post_title . "</a>\n(";
|
---|
53 | the_time($date_format);
|
---|
54 | echo ")</li>\n";
|
---|
55 | }
|
---|
56 | echo "</ul>\n";
|
---|
57 | }
|
---|
58 | }
|
---|
59 | $wpdb->set_blog_id(1);
|
---|
60 |
|
---|
61 | echo "</ul>\n";
|
---|
62 | }
|
---|
63 | ?>
|
---|
64 |
|
---|
65 | <h3><?php _e('Updated Blogs', 'xpress'); ?></h3>
|
---|
66 | <?php
|
---|
67 | $blogs = get_last_updated();
|
---|
68 | if( is_array( $blogs ) ) {
|
---|
69 | ?>
|
---|
70 | <ul>
|
---|
71 | <?php foreach( $blogs as $details ) {
|
---|
72 | ?><li><a href="http://<?php echo $details[ 'domain' ] . $details[ 'path' ] ?>"><?php echo get_blog_option( $details[ 'blog_id' ], 'blogname' ) ?></a></li><?php
|
---|
73 | }
|
---|
74 | ?>
|
---|
75 | </ul>
|
---|
76 | <?php
|
---|
77 | }
|
---|
78 | ?>
|
---|
79 | <br />
|
---|
80 | <?php
|
---|
81 | $current_uid = get_current_user_id();
|
---|
82 | if (!empty($current_uid)) {
|
---|
83 | $user_info = get_userdata($current_uid);
|
---|
84 | $display_name = $user_info->display_name;
|
---|
85 | echo '<h3>';
|
---|
86 | printf(__('Howdy %s', 'xpress'),$display_name);
|
---|
87 | echo "</h3>\n";
|
---|
88 | echo "<ul>\n";
|
---|
89 |
|
---|
90 | $user_blogs = get_blogs_of_user($current_uid);
|
---|
91 | if( is_array($user_blogs) ) {
|
---|
92 | echo '<li>' . __('Your Blogs list','xpress') ;
|
---|
93 | echo "<ul>\n";
|
---|
94 | foreach( $user_blogs as $blog ) {
|
---|
95 | $url = 'http://' .$blog->domain .$blog->path;
|
---|
96 | $blog_name = $blog->blogname;
|
---|
97 | echo "<li><a href=\" $url \"> $blog_name </a></li>";
|
---|
98 | }
|
---|
99 | echo "</ul>\n";
|
---|
100 | echo "</li>\n";
|
---|
101 | wp_register();
|
---|
102 | }
|
---|
103 | echo '<li> <a href="wp-signup.php">' . __('Create a new blog','xpress') . "</a></li>\n";
|
---|
104 | echo "</ul>\n";
|
---|
105 | }
|
---|
106 |
|
---|
107 | ?>
|
---|
108 |
|
---|
109 | </div>
|
---|
110 |
|
---|
111 | <?php get_footer(); ?>
|
---|