Advertisement
Guest User

wp-phpbb-bridge

a guest
Sep 30th, 2012
525
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.61 KB | None | 0 0
  1. <div id="wpbb_xtndit_info" class="postbox ">
  2. <div class="handlediv" title="<?php _e('Toggle', 'wpbb'); ?>"><br /></div>
  3. <h3 class="hndle">
  4. <span>
  5. <?php _e('eXtnd.it latest news', 'wpbb'); ?>
  6. </span>
  7. </h3>
  8. <div class="inside">
  9. <br />
  10. <?php
  11. include_once(ABSPATH . WPINC . '/rss.php');
  12. $rss = fetch_rss('http://www.e-xtnd.it/feed/');
  13. $maxitems = 5;
  14. $extnd_items = array_slice($rss->items, 0, $maxitems);
  15.  
  16. $rss = fetch_rss('http://www.stigmahost.com/en/feed/');
  17. $maxitems = 5;
  18. $stigma_items = array_slice($rss->items, 0, $maxitems);
  19.  
  20. function date_short($a, $b)
  21. {
  22. $a_time = strtotime($a['pubdate']);
  23. $b_time = strtotime($b['pubdate']);
  24.  
  25. if($a_time == $b_time)
  26. {
  27. return 0;
  28. }
  29.  
  30. return ($a_time < $b_time)? -1 : 1;
  31. }
  32.  
  33. $items = array_merge($extnd_items, $stigma_items);
  34.  
  35. usort($items, 'date_short');
  36.  
  37. $items = array_reverse($items);
  38.  
  39. $items = array_slice($items, 0, 5);
  40.  
  41. foreach($items as $i)
  42. {
  43. $d = dateDiff(time(), strtotime($i['pubdate']));
  44.  
  45. $month = key_exists('month', $d) ? $d['month'] : 0;
  46. $dt = date(get_option('date_format'), strtotime($i['pubdate']));
  47. ?>
  48. <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>
  49. <p>
  50. <strong><?php $month != 1 ? printf(__('%1$d months old', 'wpbb'), $month) : printf(__('%1$d month old', 'wpbb'), $month) ?></strong> - <?php echo $i['description']; ?>
  51. </p>
  52. <?php
  53. }
  54. ?>
  55. </div>
  56. </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement