Example #1
0
		if($forum_topics == '0')
		{
			$template->assign_block_vars("switch_no_topics", array());
		}

		// Quick Title
		// Temporary allow all BBCode for Quick Title, and store current vars to temp arrays
		$bbcode_allow_html_tmp = $bbcode->allow_html;
		$bbcode_allow_bbcode_tmp = $bbcode->allow_bbcode;
		$bbcode_allow_smilies_tmp = $bbcode->allow_smilies;
		$bbcode->allow_html = true;
		$bbcode->allow_bbcode = true;
		$bbcode->allow_smilies = true;

		$topic_prefixes = $class_topics->get_topic_prefixes();
		$qt_select_data = '';
		foreach ($topic_prefixes as $qt_id => $qt_data)
		{
			$qt_html = !empty($qt_data['title_html']) ? true : false;
			$qt_title_prefix = !empty($qt_data['title_html']) ? $bbcode->parse($qt_data['title_html']) : $qt_data['title_info'];
			$qt_title_prefix = str_replace('%mod%', $user->data['username'], $qt_title_prefix);
			$qt_date = ($qt_data['date_format'] == '') ? create_date($config['default_dateformat'], time(), $config['board_timezone']) : create_date($qt_data['date_format'], time(), $config['board_timezone']);
			$qt_title_prefix = str_replace('%date%', $qt_date, $qt_title_prefix);
			$qt_title_prefix = !empty($qt_html) ? $qt_title_prefix : htmlspecialchars($qt_title_prefix);
			$qt_select_data .= '<option value="' . $qt_data['id'] . '">' . $qt_title_prefix . '</option>';
		}

		// Restore BBCode status...
		$bbcode->allow_html = $bbcode_allow_html_tmp;
		$bbcode->allow_bbcode = $bbcode_allow_bbcode_tmp;