diff forum/Themes/default/Combat.template.php @ 76:e3e11437ecea website

Add forum code
author Chris Cannam
date Sun, 07 Jul 2013 11:25:48 +0200
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/forum/Themes/default/Combat.template.php	Sun Jul 07 11:25:48 2013 +0200
@@ -0,0 +1,40 @@
+<?php
+// Version: 1.1; Combat
+
+// This is a fix for the image stuff, lovely....
+if (!isset($context['html_headers']))
+	$context['html_headers'] = '';
+$context['html_headers'] .= '
+	<style type="text/css">
+	a img{
+	border: 0;
+	}
+	</style>';
+
+// Generate a strip of buttons, out of buttons.
+function template_button_strip($button_strip, $direction = 'top', $force_reset = false, $custom_td = '')
+{
+	global $settings, $buttons, $context, $txt, $scripturl;
+
+	if (empty($button_strip))
+		return '';
+
+	// Create the buttons...
+	foreach ($button_strip as $key => $value)
+	{
+		if (isset($value['test']) && empty($context[$value['test']]))
+		{
+			unset($button_strip[$key]);
+			continue;
+		}
+		elseif (!isset($buttons[$key]) || $force_reset)
+			$buttons[$key] = '<a href="' . $value['url'] . '" ' .( isset($value['custom']) ? $value['custom'] : '') . '>' . ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . ($value['lang'] ? $context['user']['language'] . '/' : '') . $value['image'] . '" alt="' . $txt[$value['text']] . '" border="0" />' : $txt[$value['text']]) . '</a>';
+
+		$button_strip[$key] = $buttons[$key];
+	}
+
+	echo '
+		<td ', $custom_td, '>', implode($context['menu_separator'], $button_strip) , '</td>';
+}
+
+?>
\ No newline at end of file