Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <div id="wpbb_xtndit_info" class="postbox ">
- <div class="handlediv" title="<?php _e('Toggle', 'wpbb'); ?>"><br /></div>
- <h3 class="hndle">
- <span>
- <?php _e('eXtnd.it latest news', 'wpbb'); ?>
- </span>
- </h3>
- <div class="inside">
- <br />
- <?php
- include_once(ABSPATH . WPINC . '/rss.php');
- $rss = fetch_rss('http://www.e-xtnd.it/feed/');
- $maxitems = 5;
- $extnd_items = array_slice($rss->items, 0, $maxitems);
- $rss = fetch_rss('http://www.stigmahost.com/en/feed/');
- $maxitems = 5;
- $stigma_items = array_slice($rss->items, 0, $maxitems);
- function date_short($a, $b)
- {
- $a_time = strtotime($a['pubdate']);
- $b_time = strtotime($b['pubdate']);
- if($a_time == $b_time)
- {
- return 0;
- }
- return ($a_time < $b_time)? -1 : 1;
- }
- $items = array_merge($extnd_items, $stigma_items);
- usort($items, 'date_short');
- $items = array_reverse($items);
- $items = array_slice($items, 0, 5);
- foreach($items as $i)
- {
- $d = dateDiff(time(), strtotime($i['pubdate']));
- $month = key_exists('month', $d) ? $d['month'] : 0;
- $dt = date(get_option('date_format'), strtotime($i['pubdate']));
- ?>
- <a href="<?php echo $i['link']; ?>" title="<?php echo $i['title']; ?>" target="_blank"><?php echo $i['title']; ?></a> <span class="rss-date"><?php echo $dt; ?></span>
- <p>
- <strong><?php $month != 1 ? printf(__('%1$d months old', 'wpbb'), $month) : printf(__('%1$d month old', 'wpbb'), $month) ?></strong> - <?php echo $i['description']; ?>
- </p>
- <?php
- }
- ?>
- </div>
- </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement