private static function HandleBlizzPosts() { if (is_array(self::$loaded_blizz_posts)) { $blizz_posts = self::$loaded_blizz_posts; } elseif (is_array(self::$blizz_tracker) && self::$blizz_tracker_active) { $blizz_posts = self::$blizz_tracker; } else { return false; } if (self::$blizz_tracker_active) { $message_len = 400; } else { $message_len = 115; } $posts = array(); foreach ($blizz_posts as $post) { // Crop message if (mb_strlen($post['message']) > $message_len) { $post['message_short'] = sprintf('%s…', mb_substr($post['message'], 0, $message_len)); } else { $post['message_short'] = $post['message']; } $post['message_short'] = self::BBCodesToHTML($post['message_short']); $post['message'] = self::BBCodesToHTML($post['message']); // Crop thread title if (mb_strlen($post['threadTitle']) > 28) { $post['threadTitle_short'] = sprintf('%s…', mb_substr($post['threadTitle'], 0, 28)); } else { $post['threadTitle_short'] = $post['threadTitle']; } // Set default author name if ($post['author'] == '') { $post['author'] = 'Blizzard'; } $page = floor($post['ROW'] / 20); $onPage = ceil($post['ROW'] / 20); $post['ROW'] = $post['ROW'] > 20 ? $post['ROW'] - $page * 20 : $post['ROW']; $post['link'] = $onPage > 1 ? sprintf('?page=%d#%d', $onPage, $post['ROW']) : sprintf('#%d', $post['ROW']); $posts[] = $post; } if (is_array(self::$loaded_blizz_posts)) { self::$loaded_blizz_posts = $posts; } elseif (is_array(self::$blizz_tracker) && self::$blizz_tracker_active) { self::$blizz_tracker = $posts; } else { unset($posts, $post); return false; } unset($posts, $post); return true; }