[613] | 1 | <?php
|
---|
| 2 | /*
|
---|
| 3 | Template Name: MultiBlog Front_Page
|
---|
| 4 | */
|
---|
| 5 | ?>
|
---|
| 6 | <?php get_header(); ?>
|
---|
| 7 |
|
---|
| 8 | <div id="content" class="widecolumn">
|
---|
| 9 | <h3><?php _e('Site News', 'xpress'); ?></h3>
|
---|
| 10 | <ul>
|
---|
| 11 | <?php
|
---|
| 12 | query_posts('showposts=7');
|
---|
| 13 | if (have_posts()) : ?><?php while (have_posts()) : the_post(); ?>
|
---|
| 14 | <li><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title();?> </a></li>
|
---|
| 15 | <?php endwhile; ?><?php endif; ?>
|
---|
| 16 | </ul>
|
---|
| 17 | <br />
|
---|
| 18 | <h3><?php _e('Blogs List', 'xpress'); ?></h3>
|
---|
| 19 | <?php
|
---|
| 20 | $blog_list = get_blog_list( 0, 'all' );
|
---|
| 21 | echo "<ul>\n";
|
---|
| 22 | foreach ($blog_list AS $blog) {
|
---|
| 23 | $url = 'http://' .$blog['domain'] .$blog['path'];
|
---|
| 24 | $blog_name = get_blog_option( $blog['blog_id'], 'blogname' );
|
---|
| 25 | $post_count = $blog['postcount'];
|
---|
| 26 |
|
---|
| 27 | echo "<li><a href=\" $url \"> $blog_name </a> (" . __('post count','xpress') . ":$post_count) </li>";
|
---|
| 28 | }
|
---|
| 29 | echo "</ul>\n";
|
---|
| 30 | ?>
|
---|
| 31 | <br />
|
---|
| 32 |
|
---|
| 33 | <?php
|
---|
| 34 | echo '<h3>' . __('New Entries', 'xpress') . "</h3>\n";
|
---|
| 35 | $data_array = xpress_grobal_recent_posts();
|
---|
| 36 | echo "<ul>\n";
|
---|
| 37 | foreach($data_array as $data){
|
---|
| 38 | echo '<li>';
|
---|
| 39 | printf(__('%1$s wrote %2$s in %3$s.','xpress'), $data->post_author,$data->title_link,$data->blog_link);
|
---|
| 40 | echo "</li>\n";
|
---|
| 41 | }
|
---|
| 42 | echo "</ul>\n";
|
---|
| 43 | ?>
|
---|
| 44 | <br />
|
---|
| 45 |
|
---|
| 46 | <h3><?php _e('Updated Blogs', 'xpress'); ?></h3>
|
---|
| 47 | <?php
|
---|
| 48 | $blogs = get_last_updated();
|
---|
| 49 | if( is_array( $blogs ) ) {
|
---|
| 50 | ?>
|
---|
| 51 | <ul>
|
---|
| 52 | <?php foreach( $blogs as $details ) {
|
---|
| 53 | ?><li><a href="http://<?php echo $details[ 'domain' ] . $details[ 'path' ] ?>"><?php echo get_blog_option( $details[ 'blog_id' ], 'blogname' ) ?></a></li><?php
|
---|
| 54 | }
|
---|
| 55 | ?>
|
---|
| 56 | </ul>
|
---|
| 57 | <?php
|
---|
| 58 | }
|
---|
| 59 | ?>
|
---|
| 60 | <br />
|
---|
| 61 | <?php
|
---|
| 62 | $current_uid = get_current_user_id();
|
---|
| 63 | if (!empty($current_uid)) {
|
---|
| 64 | $user_info = get_userdata($current_uid);
|
---|
| 65 | $display_name = $user_info->display_name;
|
---|
| 66 | echo '<h3>';
|
---|
| 67 | printf(__('Howdy %s', 'xpress'),$display_name);
|
---|
| 68 | echo "</h3>\n";
|
---|
| 69 | echo "<ul>\n";
|
---|
| 70 |
|
---|
| 71 | $user_blogs = get_blogs_of_user($current_uid);
|
---|
| 72 | if( is_array($user_blogs) ) {
|
---|
| 73 | echo '<li>' . __('Your Blogs list','xpress') ;
|
---|
| 74 | echo "<ul>\n";
|
---|
| 75 | foreach( $user_blogs as $blog ) {
|
---|
| 76 | $url = 'http://' .$blog->domain .$blog->path;
|
---|
| 77 | $blog_name = $blog->blogname;
|
---|
| 78 | echo "<li><a href=\" $url \"> $blog_name </a></li>";
|
---|
| 79 | }
|
---|
| 80 | echo "</ul>\n";
|
---|
| 81 | echo "</li>\n";
|
---|
| 82 | wp_register();
|
---|
| 83 | }
|
---|
| 84 | echo '<li> <a href="wp-signup.php">' . __('Create a new blog','xpress') . "</a></li>\n";
|
---|
| 85 | echo "</ul>\n";
|
---|
| 86 | }
|
---|
| 87 | ?>
|
---|
| 88 |
|
---|
| 89 | </div>
|
---|
| 90 |
|
---|
| 91 | <?php get_footer(); ?>
|
---|