<?xml version="1.0"?>
<!DOCTYPE modification SYSTEM "http://www.simplemachines.org/xml/modification">
<modification xmlns="http://www.simplemachines.org/xml/modification" xmlns:smf="http://www.simplemachines.org/">
	<id>yodaofdarkness:tagging</id>
	<version>1.0.2</version>

<file name="$themedir/Display.template.php">



	<!-- ONLY ONE OF THE FOLLOWING THREE OPERATIONS WILL WORK! -->
	<!-- They might not even work at all! -->



	<operation error="ignore">
		<search position="replace"><![CDATA[
	</td></tr>';
	}
	echo '
	<tr><td style="padding: 0 0 1px 0;"></td></tr>]]></search>
		<add><![CDATA[
	</td></tr>';

		// Show the tags after the first message _only_
		if ($message['id'] == $context['first_message'] && !empty($context['tags'])){
			echo '
		<tr class="windowbg3 smalltext">
			<td style="padding: 4px;">
				<b>', $txt['tags'], '</b>: ';

			$num_tags = count($context['tags']);
			$count_tags = 0;

			foreach($context['tags'] as $id => $name){
				$count_tags++;

				echo '
				<a href="', $scripturl, '?action=tags;name=', urlencode($name), '">', $name, '</a>', ($count_tags != $num_tags ? ',' : '');
			}
			echo '
			</td>
		</tr>';
		}

	}
	echo '
	<tr><td style="padding: 0 0 1px 0;"></td></tr>]]></add>
	</operation>


	<operation error="ignore">
		<search position="replace"><![CDATA[
	</td></tr>';
	}
	echo '
</table>]]></search>
		<add><![CDATA[
	</td></tr>';

		// Show the tags after the first message _only_
		if ($message['id'] == $context['first_message'] && !empty($context['tags'])){
			echo '
		<tr class="windowbg3 smalltext">
			<td style="padding: 4px;">
				<b>', $txt['tags'], '</b>: ';

			$num_tags = count($context['tags']);
			$count_tags = 0;

			foreach($context['tags'] as $id => $name){
				$count_tags++;

				echo '
				<a href="', $scripturl, '?action=tags;name=', urlencode($name), '">', $name, '</a>', ($count_tags != $num_tags ? ',' : '');
			}
			echo '
			</td>
		</tr>';
		}

	}
	echo '
</table>]]></add>
	</operation>


	<operation error="ignore">
		<search position="replace"><![CDATA[
		</div>';
	}

	echo '
	</form>';]]></search>
		<add><![CDATA[
		</div>';

		// Show the tags after the first message _only_
		if ($message['id'] == $context['first_message'] && !empty($context['tags'])){
			echo '
		<div class="clearfix topborder windowbg3 largepadding smalltext">
			<b>', $txt['tags'], '</b>: ';

			$num_tags = count($context['tags']);
			$count_tags = 0;

			foreach($context['tags'] as $id => $name){
				$count_tags++;

				echo '
			<a href="', $scripturl, '?action=tags;name=', urlencode($name), '">', $name, '</a>', ($count_tags != $num_tags ? ',' : '');
			}
			echo '
		</div>';
		}

	}

	echo '
	</form>';]]></add>
	</operation>
</file>
</modification>
