Pastebin launched a little side project called HostCabi.net, check it out ;-)Don't like ads? PRO users don't see any ads ;-)
Guest

Diamond Multisite Widget ignore broadcasted posts

By: a guest on Sep 2nd, 2011  |  syntax: PHP  |  size: 0.71 KB  |  hits: 61  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. // Removes all duplicate posts (according to title) from all included sites across the network
  2. $titleTemp = '';
  3. $i = 0;
  4. foreach ($post_list AS $post) {
  5.         $p = get_blog_post($post["blog_id"], $post["id"]);
  6.         $post_tile_compare = $p->post_title;
  7.         if ($titleTemp == $post_tile_compare) {
  8.                 unset($post_list[$i]);
  9.                 //echo '<br />Removed duplicate: '.$post_tile_compare;
  10.                 unset($post_list[$i-1]);
  11.         } else if ($post["blog_id"] == 1) { // After checking for broadcasted posts, this removes root blog posts
  12.                 $post_removed = get_blog_post($post["blog_id"], $post["id"])->post_title;
  13.                 unset($post_list[$i]);
  14.                 //echo '<br />Removed root site post: '.$post_removed;
  15.         }
  16.        
  17.         $titleTemp = $post_tile_compare;
  18.         $i++;
  19. }