| | 3 | |
|---|
| | 4 | function index_js() { |
|---|
| | 5 | ?> |
|---|
| | 6 | <script type="text/javascript"> |
|---|
| | 7 | Event.observe( window, 'load', dashboard_init, false ); |
|---|
| | 8 | function dashboard_init() { |
|---|
| | 9 | var update1 = new Ajax.Updater( 'incominglinks', 'index-extra.php?jax=incominglinks' ); |
|---|
| | 10 | var update2 = new Ajax.Updater( 'devnews', 'index-extra.php?jax=devnews' ); |
|---|
| | 11 | var update3 = new Ajax.Updater( 'planetnews', 'index-extra.php?jax=planetnews' ); |
|---|
| | 12 | } |
|---|
| | 13 | </script> |
|---|
| | 14 | <?php |
|---|
| | 15 | } |
|---|
| | 16 | add_action( 'admin_head', 'index_js' ); |
|---|
| | 17 | wp_enqueue_script('prototype'); |
|---|
| | 18 | |
|---|
| 18 | | <?php |
|---|
| 19 | | $rss = @fetch_rss('http://feeds.technorati.com/cosmos/rss/?url='. trailingslashit(get_option('home')) .'&partner=wordpress'); |
|---|
| 20 | | if ( isset($rss->items) && 0 != count($rss->items) ) { |
|---|
| 21 | | ?> |
|---|
| 22 | | <div id="incominglinks"> |
|---|
| 23 | | <h3><?php _e('Incoming Links'); ?> <cite><a href="http://www.technorati.com/search/<?php echo trailingslashit(get_option('home')); ?>?partner=wordpress"><?php _e('More »'); ?></a></cite></h3> |
|---|
| 24 | | <ul> |
|---|
| 25 | | <?php |
|---|
| 26 | | $rss->items = array_slice($rss->items, 0, 10); |
|---|
| 27 | | foreach ($rss->items as $item ) { |
|---|
| 28 | | ?> |
|---|
| 29 | | <li><a href="<?php echo wp_filter_kses($item['link']); ?>"><?php echo wptexturize(wp_specialchars($item['title'])); ?></a></li> |
|---|
| 30 | | <?php } ?> |
|---|
| 31 | | </ul> |
|---|
| 32 | | </div> |
|---|
| 33 | | <?php } ?> |
|---|
| | 33 | <div id="incominglinks"></div> |
|---|
| 131 | | <?php |
|---|
| 132 | | $rss = @fetch_rss('http://wordpress.org/development/feed/'); |
|---|
| 133 | | if ( isset($rss->items) && 0 != count($rss->items) ) { |
|---|
| 134 | | ?> |
|---|
| 135 | | <div id="devnews"> |
|---|
| 136 | | <h3><?php _e('WordPress Development Blog'); ?></h3> |
|---|
| 137 | | <?php |
|---|
| 138 | | $rss->items = array_slice($rss->items, 0, 3); |
|---|
| 139 | | foreach ($rss->items as $item ) { |
|---|
| 140 | | ?> |
|---|
| 141 | | <h4><a href='<?php echo wp_filter_kses($item['link']); ?>'><?php echo wp_specialchars($item['title']); ?></a> — <?php printf(__('%s ago'), human_time_diff(strtotime($item['pubdate'], time() ) ) ); ?></h4> |
|---|
| 142 | | <p><?php echo $item['description']; ?></p> |
|---|
| 143 | | <?php |
|---|
| 144 | | } |
|---|
| 145 | | } |
|---|
| 146 | | ?> |
|---|
| 147 | | </div> |
|---|
| 149 | | <?php |
|---|
| 150 | | $rss = @fetch_rss('http://planet.wordpress.org/feed/'); |
|---|
| 151 | | if ( isset($rss->items) && 0 != count($rss->items) ) { |
|---|
| 152 | | ?> |
|---|
| 153 | | <div id="planetnews"> |
|---|
| 154 | | <h3><?php _e('Other WordPress News'); ?></h3> |
|---|
| 155 | | <ul> |
|---|
| 156 | | <?php |
|---|
| 157 | | $rss->items = array_slice($rss->items, 0, 20); |
|---|
| 158 | | foreach ($rss->items as $item ) { |
|---|
| 159 | | $title = wp_specialchars($item['title']); |
|---|
| 160 | | $author = preg_replace( '|(.+?):.+|s', '$1', $item['title'] ); |
|---|
| 161 | | $post = preg_replace( '|.+?:(.+)|s', '$1', $item['title'] ); |
|---|
| 162 | | ?> |
|---|
| 163 | | <li><a href='<?php echo wp_filter_kses($item['link']); ?>'><span class="post"><?php echo $post; ?></span><span class="hidden"> - </span><cite><?php echo $author; ?></cite></a></li> |
|---|
| 164 | | <?php |
|---|
| 165 | | } |
|---|
| 166 | | ?> |
|---|
| 167 | | </ul> |
|---|
| 168 | | <p class="readmore"><a href="http://planet.wordpress.org/"><?php _e('Read more'); ?> »</a></p> |
|---|
| 169 | | </div> |
|---|
| 170 | | <?php |
|---|
| 171 | | } |
|---|
| 172 | | ?> |
|---|
| | 132 | <div id="devnews"></div> |
|---|
| | 133 | |
|---|
| | 134 | <div id="planetnews"></div> |
|---|
| | 135 | |
|---|