config = $config;
		$this->user = $user;
		$this->phpbb_root_path = $phpbb_root_path;
		$this->phpEx = $phpEx;
	}
	/**
	* Run links through append_sid(), prepend generate_board_url() and remove session id
	*/
	public function get_board_url()
	{
		static $board_url;
		if (empty($board_url))
		{
			$board_url = generate_board_url();
		}
		return $board_url;
	}
	/**
	* Run links through append_sid(), prepend generate_board_url() and remove session id
	*/
	public function append_sid($url, $params)
	{
		return append_sid($this->get_board_url() . '/' . $url, $params, true, '');
	}
	/**
	* Generate ISO 8601 date string (RFC 3339)
	*/
	public function format_date($time)
	{
		static $zone_offset;
		static $offset_string;
		if (empty($offset_string))
		{
			$zone_offset = $this->user->create_datetime()->getOffset();
			$offset_string = phpbb_format_timezone_offset($zone_offset);
		}
		return gmdate("Y-m-d\TH:i:s", $time + $zone_offset) . $offset_string;
	}
	/**
	* Generate text content
	*
	* @param string $content is feed text content
	* @param string $uid is bbcode_uid
	* @param string $bitfield is bbcode bitfield
	* @param int $options bbcode flag options
	* @param int $forum_id is the forum id
	* @param array $post_attachments is an array containing the attachments and their respective info
	* @return string the html content to be printed for the feed
	*/
	public function generate_content($content, $uid, $bitfield, $options, $forum_id, $post_attachments)
	{
		if (empty($content))
		{
			return '';
		}
		// Prepare some bbcodes for better parsing
		$content	= preg_replace("#\[quote(=".*?")?:$uid\]\s*(.*?)\s*\[/quote:$uid\]#si", "[quote$1:$uid]
$2
[/quote:$uid]", $content);
		$content = generate_text_for_display($content, $uid, $bitfield, $options);
		// Add newlines
		$content = str_replace('
', '
' . "\n", $content);
		// Convert smiley Relative paths to Absolute path, Windows style
		$content = str_replace($this->phpbb_root_path . $this->config['smilies_path'], $this->get_board_url() . '/' . $this->config['smilies_path'], $content);
		// Remove "Select all" link and mouse events
		$content = str_replace('' . $this->user->lang['SELECT_ALL_CODE'] . '', '', $content);
		$content = preg_replace('#(onkeypress|onclick)="(.*?)"#si', '', $content);
		// Firefox does not support CSS for feeds, though
		// Remove font sizes
	//	$content = preg_replace('#([^>]+)#iU', '\1', $content);
		// Make text strong :P
	//	$content = preg_replace('#(.*?)#iU', '\1', $content);
		// Italic
	//	$content = preg_replace('#([^<]+)#iU', '\1', $content);
		// Underline
	//	$content = preg_replace('#([^<]+)#iU', '\1', $content);
		// Remove embed Windows Media Streams
		$content	= preg_replace( '#<\!--\[if \!IE\]>-->([^[]+)<\!--#si', '', $content);
		// Do not use < and >, because we want to retain code contained in [code][/code]
		// Remove embed and objects
		$content	= preg_replace( '#<(object|embed)(.*?) (value|src)=(.*?) ([^[]+)(object|embed)>#si',' $1 ',$content);
		// Remove some specials html tag, because somewhere there are a mod to allow html tags ;)
		$content	= preg_replace( '#<(script|iframe)([^[]+)\1>#siU', ' $1 ', $content);
		// Parse inline images to display with the feed
		if (!empty($post_attachments))
		{
			$update_count = array();
			parse_attachments($forum_id, $content, $post_attachments, $update_count);
			$post_attachments = implode('
', $post_attachments);
			// Convert attachments' relative path to absolute path
			$post_attachments = str_replace($this->phpbb_root_path . 'download/file.' . $this->phpEx, $this->get_board_url() . '/download/file.' . $this->phpEx, $post_attachments);
			$content .= $post_attachments;
		}
		// Remove Comments from inline attachments [ia]
		$content = preg_replace('#