Commits

Christian Fischer committed 505ed20

WBB3 Plugin buildscript hinzugefügt
WBB3 Shoutbox-Plugin v0.2 hinzugefügt

  • Participants

Comments (0)

Files changed (14)

File dist/net.northshirebund.wbb.shoutbox-0.1.tar

Binary file added.

File dist/net.northshirebund.wbb.shoutbox-0.1.zip

Binary file added.

File dist/net.northshirebund.wbb.shoutbox-0.2.tar

Binary file added.

File dist/net.northshirebund.wbb.shoutbox-0.2.zip

Binary file added.

File files/lib/page/ShoutboxContentPage.class.php

+<?php
+require_once(WCF_DIR.'lib/page/AbstractPage.class.php');
+require_once(WCF_DIR.'lib/system/event/EventHandler.class.php');
+require_once(WCF_DIR.'lib/data/message/bbcode/MessageParser.class.php');
+require_once(WCF_DIR.'lib/data/message/bbcode/URLParser.class.php');
+
+
+/**
+ * This class provides default implementations for the Page interface.
+ * This includes the call of the default event listeners for a page: construct, readParameters, assignVariables and show.
+ * 
+ * @author	Christian Fischer
+ * @package	com.woltlab.wcf.page
+ */
+class ShoutboxContentPage extends AbstractPage {
+	/**
+	 * Name of the template for the called page.
+	 */
+	public $templateName	= 'shoutboxContent';
+	public $templateNameXml	= 'shoutboxContentXml';
+	public $messages		= array();
+	public $lastmessage		= 0;
+	public $xmloutput		= false;
+	
+	
+	/**
+	 * @see Page::readParameters()
+	 */
+	public function readParameters() {
+		parent::readParameters();
+		
+		if (isset($_POST['message'])) {
+			$message = MessageUtil::stripCrap(StringUtil::trim($_POST['message']));
+			$userid  = WCF::getUser()->userID;
+			
+			if($message != '') {
+				if($userid || SHOUTBOX_ALLOWGUESTS) {
+					WCF::getDB()->sendQuery("
+						INSERT INTO wcf".WCF_N."_shoutbox(userid,message_text,message_time,message_ip)
+						VALUES ('".$userid."','".escapeString($message)."','".TIME_NOW."', '".UserUtil::getIpAddress()."')"
+					);
+						
+					$messageid = WCF::getDB()->getInsertID();
+			 		
+			 		WCF::getDB()->sendQuery("DELETE FROM wcf".WCF_N."_shoutbox WHERE message_id<'".($messageid-SHOUTBOX_MESSAGECOUNT-5)."'");
+				}
+			}
+		}
+		
+		if(isset($_REQUEST['since'])) {
+			$this->lastmessage = intval($_REQUEST['since']);
+		}
+		
+		if(isset($_REQUEST['output']) && $_REQUEST['output'] == 'xml') {
+			$this->xmloutput = true;
+		}
+		
+		return;
+	}
+	
+	
+	protected function readMessages() {
+		$parser = MessageParser::getInstance();
+		$parser->setOutputType('text/html');
+		
+		if($this->xmloutput) {
+			$order = 'ASC';
+		}
+		else {
+			//$order = SHOUTBOX_MESSAGEORDER;
+			$order = 'DESC';
+		}
+		
+		$sql = '
+			SELECT		sb.*, 
+						u.userID, u.username
+			FROM 		wcf'.WCF_N.'_shoutbox	sb
+			LEFT JOIN	wcf'.WCF_N.'_user		u
+			USING		(userid)
+			WHERE		message_time > '.$this->lastmessage.'
+			ORDER BY 	message_time '.$order.'
+			LIMIT		0,'.SHOUTBOX_MESSAGECOUNT.'
+		';		
+		
+		$result = WCF::getDB()->sendQuery($sql);
+		//WCF::getTPL()->assign('sql', $sql);
+		
+		while ($row = WCF::getDB()->fetchArray($result)) {
+			$message = $row['message_text'];
+			
+			// parse URLs
+			$message = URLParser::parse($message);
+			
+			// parse smilies
+			$message = $parser->parse($message, /*smilies*/true, /*html*/false, /*bbcode*/false, /*highlighting*/false);
+			
+			// convert [url] into <a href...
+			$message = preg_replace('/\[url\](.+?)\[\/url\]/', '<a href="\1" target="_blank">\1</a>', $message);
+			
+			// convert *emote* into <i>emote</i>
+			$message = preg_replace('/\*(.+?)\*/', '<i>\1</i>', $message);
+			
+			$row['message_text'] = $message;
+			
+			array_push($this->messages, $row);
+			
+			$this->lastmessage = max($this->lastmessage, $row['message_time']);
+		}
+		
+		return;
+	}
+	
+	
+	/**
+	 * @see Page::assignVariables()
+	 */
+	public function assignVariables() {
+		parent::assignVariables();
+		
+		$this->readMessages();
+		
+		WCF::getTPL()->assign(array(
+			'messages'		=> $this->messages,
+			'lastmessage'	=> $this->lastmessage
+		));
+	}
+	
+	
+	/** * @see Page::show() */ public function show() { // assign variables 
+	$this->assignVariables();		
+		
+		// call show event
+		EventHandler::fireAction($this, 'show');
+		
+		// show template
+		if($this->xmloutput) {
+			/*
+			header('Content-type: text/xml');
+			
+			echo '<?xml version="1.0" encoding="'.CHARSET.'"?><lines>';
+			
+			foreach($this->messages as $message) {
+				echo '<line><![CDATA[' . $message['username'] . ': ' . $message['message_text'] . ']]></line>';
+			}
+			
+			echo '</lines>';
+			*/
+			if (!empty($this->templateNameXml)) {
+				header('Content-type: text/xml');
+				WCF::getTPL()->display($this->templateNameXml, false);
+			}
+		}
+		else {
+			if (!empty($this->templateName)) {
+				WCF::getTPL()->display($this->templateName);
+			}
+		}
+		
+		return;
+	}
+}
+?>

File lang/net.northshirebund.wbb.shoutbox.xml

+<?xml version="1.0" encoding="UTF-8"?><?mso-application progid="Excel.Sheet"?>
+<Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns:x2="http://schemas.microsoft.com/office/excel/2003/xml" xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:html="http://www.w3.org/TR/REC-html40" xmlns:c="urn:schemas-microsoft-com:office:component:spreadsheet"><OfficeDocumentSettings xmlns="urn:schemas-microsoft-com:office:office"><Colors><Color><Index>3</Index><RGB>#c0c0c0</RGB></Color><Color><Index>4</Index><RGB>#ff0000</RGB></Color></Colors></OfficeDocumentSettings><ExcelWorkbook xmlns="urn:schemas-microsoft-com:office:excel"><WindowHeight>9000</WindowHeight><WindowWidth>13860</WindowWidth><WindowTopX>240</WindowTopX><WindowTopY>75</WindowTopY><ProtectStructure>False</ProtectStructure><ProtectWindows>False</ProtectWindows></ExcelWorkbook><Styles><Style ss:ID="Default" ss:Name="Default"/><Style ss:ID="Result" ss:Name="Result"><Font ss:Bold="1" ss:Italic="1" ss:Size="10" ss:Underline="Single"/></Style><Style ss:ID="Result2" ss:Name="Result2"><Font ss:Bold="1" ss:Italic="1" ss:Size="10" ss:Underline="Single"/><NumberFormat ss:Format="General"/></Style><Style ss:ID="Heading" ss:Name="Heading"><Alignment ss:Horizontal="Center"/><Font ss:Bold="1" ss:Italic="1" ss:Size="16"/></Style><Style ss:ID="Heading1" ss:Name="Heading1"><Alignment ss:Horizontal="Center" ss:Rotate="90"/><Font ss:Bold="1" ss:Italic="1" ss:Size="16"/></Style><Style ss:ID="co1"/><Style ss:ID="co2"/><Style ss:ID="co3"/><Style ss:ID="co4"/><Style ss:ID="ta1"/></Styles><ss:Worksheet ss:Name="Tabelle1"><Table ss:StyleID="ta1"><Column ss:StyleID="Default" ss:Width="206.1921"/><Column ss:StyleID="Default" ss:Width="122.7118"/><Column ss:StyleID="Default" ss:Width="136.8567"/><Row ss:AutoFitHeight="0" ss:Height="13.4079"><Cell ss:Index="2"><Data ss:Type="String">De</Data></Cell><Cell><Data ss:Type="String">En</Data></Cell></Row><Row ss:AutoFitHeight="0" ss:Height="13.4079"><Cell><Data ss:Type="String">net.northshirebund.wbb.shoutbox.title</Data></Cell><Cell><Data ss:Type="String">Shoutbox</Data></Cell><Cell><Data ss:Type="String">Shoutbox</Data></Cell></Row><Row ss:AutoFitHeight="0" ss:Height="13.4079"><Cell><Data ss:Type="String">net.northshirebund.wbb.shoutbox.description</Data></Cell><Cell><Data ss:Type="String">Ein Chat-Frame</Data></Cell><Cell><Data ss:Type="String">A chat frame</Data></Cell></Row><Row ss:Height="13.4079"><Cell><Data ss:Type="String">net.northshirebund.wbb.shoutbox.guest</Data></Cell><Cell><Data ss:Type="String">Gast</Data></Cell><Cell><Data ss:Type="String">Guest</Data></Cell></Row></Table><x:WorksheetOptions/></ss:Worksheet></Workbook>

File lang/wcf.acp.option.xml

+<?xml version="1.0" encoding="UTF-8"?><?mso-application progid="Excel.Sheet"?>
+<Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns:x2="http://schemas.microsoft.com/office/excel/2003/xml" xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:html="http://www.w3.org/TR/REC-html40" xmlns:c="urn:schemas-microsoft-com:office:component:spreadsheet"><OfficeDocumentSettings xmlns="urn:schemas-microsoft-com:office:office"><Colors><Color><Index>3</Index><RGB>#c0c0c0</RGB></Color><Color><Index>4</Index><RGB>#ff0000</RGB></Color></Colors></OfficeDocumentSettings><ExcelWorkbook xmlns="urn:schemas-microsoft-com:office:excel"><WindowHeight>9000</WindowHeight><WindowWidth>13860</WindowWidth><WindowTopX>240</WindowTopX><WindowTopY>75</WindowTopY><ProtectStructure>False</ProtectStructure><ProtectWindows>False</ProtectWindows></ExcelWorkbook><Styles><Style ss:ID="Default" ss:Name="Default"/><Style ss:ID="Result" ss:Name="Result"><Font ss:Bold="1" ss:Italic="1" ss:Size="10" ss:Underline="Single"/></Style><Style ss:ID="Result2" ss:Name="Result2"><Font ss:Bold="1" ss:Italic="1" ss:Size="10" ss:Underline="Single"/><NumberFormat ss:Format="General"/></Style><Style ss:ID="Heading" ss:Name="Heading"><Alignment ss:Horizontal="Center"/><Font ss:Bold="1" ss:Italic="1" ss:Size="16"/></Style><Style ss:ID="Heading1" ss:Name="Heading1"><Alignment ss:Horizontal="Center" ss:Rotate="90"/><Font ss:Bold="1" ss:Italic="1" ss:Size="16"/></Style><Style ss:ID="co1"/><Style ss:ID="co2"/><Style ss:ID="co3"/><Style ss:ID="co4"/><Style ss:ID="ta1"/><Style ss:ID="ce1"><Alignment ss:WrapText="1"/><Font ss:FontName="Times New Roman" ss:Size="10"/></Style><Style ss:ID="ce2"><Alignment ss:WrapText="1"/><Font ss:FontName="Times New Roman1" ss:Size="10"/></Style></Styles><ss:Worksheet ss:Name="Tabelle1"><Table ss:StyleID="ta1"><Column ss:StyleID="ce2" ss:Width="246.9543"/><Column ss:StyleID="Default" ss:Width="176.2016"/><Column ss:StyleID="Default" ss:Width="136.8567"/><Row ss:AutoFitHeight="0" ss:Height="13.4079"><Cell ss:StyleID="Default"/><Cell><Data ss:Type="String">De</Data></Cell><Cell><Data ss:Type="String">En</Data></Cell></Row><Row ss:AutoFitHeight="0" ss:Height="13.4079"><Cell ss:StyleID="Default"><Data ss:Type="String">wcf.acp.option.category.shoutbox</Data></Cell><Cell><Data ss:Type="String">Shoutbox</Data></Cell><Cell><Data ss:Type="String">Shoutbox</Data></Cell></Row><Row ss:AutoFitHeight="0" ss:Height="13.4079"><Cell ss:StyleID="ce1"><Data ss:Type="String">wcf.acp.option.category.shoutbox.description </Data></Cell><Cell><Data ss:Type="String">Eine einfache Chat-Box für das WBB</Data></Cell><Cell><Data ss:Type="String">A simple chatbox for the WBB</Data></Cell></Row><Row ss:AutoFitHeight="0" ss:Height="13.4079"><Cell><Data ss:Type="String">wcf.acp.option.category.shoutbox.options </Data></Cell><Cell><Data ss:Type="String">Shoutbox-Einstellungen</Data></Cell><Cell><Data ss:Type="String">Shoutbox-Options</Data></Cell></Row><Row ss:AutoFitHeight="0" ss:Height="13.4079"><Cell><Data ss:Type="String">wcf.acp.option.category.shoutbox.options.description </Data></Cell><Cell><Data ss:Type="String">Shoutbox-Einstellungen</Data></Cell><Cell><Data ss:Type="String">Shoutbox-Options</Data></Cell></Row><Row ss:AutoFitHeight="0" ss:Height="13.4079"><Cell><Data ss:Type="String">wcf.acp.option.shoutbox_reloadtime</Data></Cell><Cell><Data ss:Type="String">Frame neu laden nach &lt;i&gt;n&lt;/i&gt; Sek.</Data></Cell><Cell><Data ss:Type="String">Refresh frame after &lt;i&gt;n&lt;/i&gt; sec.</Data></Cell></Row><Row ss:AutoFitHeight="0" ss:Height="13.4079"><Cell><Data ss:Type="String">wcf.acp.option.shoutbox_messagecount</Data></Cell><Cell><Data ss:Type="String">Zeige die letzten &lt;i&gt;n&lt;/i&gt; Nachrichten</Data></Cell><Cell><Data ss:Type="String">Show the last &lt;i&gt;n&lt;/i&gt; messages</Data></Cell></Row><Row ss:AutoFitHeight="0" ss:Height="13.4079"><Cell><Data ss:Type="String">wcf.acp.option.shoutbox_allowguests </Data></Cell><Cell><Data ss:Type="String">Erlaube es Gästen in die Shoutbox zu schreiben</Data></Cell><Cell><Data ss:Type="String">Allow guests to post into the shoutbox</Data></Cell></Row><Row ss:Index="9" ss:AutoFitHeight="0" ss:Height="12.8409"><Cell><Data ss:Type="String">wcf.acp.option.shoutbox_defaultwidth</Data></Cell><Cell><Data ss:Type="String">Standard-Breite des Shoutbox-Frames</Data></Cell><Cell><Data ss:Type="String">Default width of the shoutbox frame</Data></Cell></Row><Row ss:AutoFitHeight="0" ss:Height="12.8409"><Cell><Data ss:Type="String">wcf.acp.option.shoutbox_defaultheight</Data></Cell><Cell><Data ss:Type="String">Standard-Höhe des Shoutbox-Frames</Data></Cell><Cell><Data ss:Type="String">Default height of the shoutbox frame</Data></Cell></Row><Row ss:AutoFitHeight="0" ss:Height="12.8409"><Cell><Data ss:Type="String">wcf.acp.option.shoutbox_messageorder</Data></Cell><Cell><Data ss:Type="String">Nachrichten-Reihenfolge</Data></Cell><Cell><Data ss:Type="String">Message order</Data></Cell></Row><Row ss:AutoFitHeight="0" ss:Height="13.4079"><Cell><Data ss:Type="String">wcf.acp.option.shoutbox_messageorder.asc</Data></Cell><Cell><Data ss:Type="String">Neueste Nachricht unten</Data></Cell><Cell><Data ss:Type="String">Newest message at the bottom</Data></Cell></Row><Row ss:AutoFitHeight="0" ss:Height="13.4079"><Cell><Data ss:Type="String">wcf.acp.option.shoutbox_messageorder.desc</Data></Cell><Cell><Data ss:Type="String">Neueste Nachricht oben</Data></Cell><Cell><Data ss:Type="String">Newest message first</Data></Cell></Row><Row ss:AutoFitHeight="0" ss:Height="12.8409"><Cell ss:Index="3"/></Row><Row ss:Height="12.8409"><Cell ss:Index="3"/></Row><Row ss:Index="65536" ss:AutoFitHeight="0" ss:Height="12.8409"><Cell ss:Index="3"/></Row></Table><x:WorksheetOptions/></ss:Worksheet></Workbook>

File package.properties

+package.id=net.northshirebund.wbb.shoutbox
+package.name=Shoutbox
+package.description=Ein Chat-Frame
+package.version=0.2
+package.parent=com.woltlab.wbb
+
+package.author.name=Christian Fischer
+package.author.url=www.northshirebund.net
+
+
+package.unique=1
+package.standalone=0
+
+package.dependencities=\
+	com.woltlab.wcf(1.0.0 Beta3)
+	
+package.optionalPackages=		\
+	shoutbox-wbb3modsportalbox;	\
+	shoutbox-page
+
+package.updateableFrom=			\
+	0.1

File script/install/install.sql

+
+
+CREATE TABLE `wcf1_shoutbox` (
+  `message_id` int(11) NOT NULL auto_increment,
+  `userid` int(11) unsigned NOT NULL default '0',
+  `message_text` text NOT NULL,
+  `message_time` int(11) NOT NULL,
+  `message_ip` varchar(15) NOT NULL,
+  PRIMARY KEY  (`message_id`)
+);

File script/install/options.xml

+<?xml version="1.0"?>
+<!DOCTYPE data SYSTEM "http://www.woltlab.com/DTD/options.dtd">
+<data>
+	<import>
+		<categories>
+			<category name="shoutbox"></category>
+			<category name="shoutbox.options">
+				<parent>shoutbox</parent>
+			</category>
+		</categories>
+		
+		<options>
+			<!-- shoutbox -->
+			<option name="shoutbox_reloadtime">
+				<categoryname>shoutbox.options</categoryname>
+				<optiontype>integer</optiontype>
+				<defaultvalue>60</defaultvalue>
+			</option>
+			<option name="shoutbox_messagecount">
+				<categoryname>shoutbox.options</categoryname>
+				<optiontype>integer</optiontype>
+				<defaultvalue>50</defaultvalue>
+			</option>
+			<!--
+			<option name="shoutbox_messageorder">
+				<categoryname>shoutbox.options</categoryname>
+				<optiontype>select</optiontype>
+				<defaultvalue>DESC</defaultvalue>
+				<selectoptions><![CDATA[DESC:wcf.acp.option.shoutbox_messageorder.desc
+ASC:wcf.acp.option.shoutbox_messageorder.asc]]></selectoptions>
+			</option>
+			-->
+			<option name="shoutbox_defaultwidth">
+				<categoryname>shoutbox.options</categoryname>
+				<optiontype>text</optiontype>
+				<defaultvalue>100%</defaultvalue>
+			</option>
+			<option name="shoutbox_defaultheight">
+				<categoryname>shoutbox.options</categoryname>
+				<optiontype>text</optiontype>
+				<defaultvalue>150px</defaultvalue>
+			</option>
+			<option name="shoutbox_allowguests">
+				<categoryname>shoutbox.options</categoryname>
+				<optiontype>boolean</optiontype>
+				<defaultvalue>true</defaultvalue>
+			</option>
+		</options>
+	</import>
+</data>

File templates/shoutboxBox.tpl

+<div class="border">
+    <div class="containerHead">
+		<div class="containerIcon">
+    		<a href="javascript: void(0)" onclick="openList('shoutboxBox', true)">
+        	<img src="icons/minusS.png" id="lastthreadsboxImage" alt="" /></a>
+        </div>
+        <img src="icons/postQuoteS.png" alt="" /> {lang}net.northshirebund.wbb.shoutbox.title{/lang}
+    </div>
+    <div class="container-1" id="shoutboxBox" style="width:100%;">
+		{include file="shoutboxFrame"}
+    </div>
+</div>

File templates/shoutboxContent.tpl

+{include file="documentHeader"}
+<head>
+	{include file="headInclude"}
+	<meta http-equiv="refresh" content="{SHOUTBOX_RELOADTIME};URL=index.php?page=ShoutboxContent">
+</head>
+<body style="text-align:left; margin:0px; padding:0px;">
+<div class="container-1" style="height:100%;">
+{foreach from=$messages item=message}
+	<span class="light">[{@$message['message_time']|shorttime}]</span> {if $message['userID']}{$message['username']}{else}{lang}net.northshirebund.wbb.shoutbox.guest{/lang}{/if}: {@$message['message_text']}<br/>
+{/foreach}
+</div>
+</body>
+</html>

File templates/shoutboxContentXml.tpl

+<?xml version="1.0" encoding="{CHARSET}"?>
+<lines>
+{foreach from=$messages item=message}
+	<line><![CDATA[<span class="light">[{@$message['message_time']|shorttime}]</span> {if $message['userID']}{$message['username']}{else}{lang}net.northshirebund.wbb.shoutbox.guest{/lang}{/if}: {@$message['message_text']}]]></line>
+{/foreach}
+	<last>{$lastmessage}</last>
+</lines>

File templates/shoutboxFrame.tpl

+<table cellpadding="4" cellspacing="0" border="0" style="width:{SHOUTBOX_DEFAULTWIDTH};">
+<tr><td>
+	<div id="shoutboxcontent" style="width:{SHOUTBOX_DEFAULTWIDTH}; height:{SHOUTBOX_DEFAULTHEIGHT}; overflow:scroll;">
+		<noscript><iframe name="chat" src="index.php?page=ShoutboxContent" scrolling="yes" frameborder="0" style="width:{SHOUTBOX_DEFAULTWIDTH}; height:{SHOUTBOX_DEFAULTHEIGHT}; border:0px;"></iframe></noscript>
+	</div>
+</td></tr>
+<tr><td>
+{if $this->getUser()->userID || SHOUTBOX_ALLOWGUESTS}
+	<script language="javascript" type="text/javascript">
+		//<![CDATA[
+		
+			var ajaxRequest   = null;
+			var lastmessage   = 0;
+			var queuedmessage = null;
+			var timerPending  = false;
+			var sbcontent     = document.getElementById('shoutboxcontent');
+			
+			// prepare div element
+			sbcontent.style.overflow = 'scroll';
+			sbcontent.innerHTML = '<div id="innershoutboxcontent" style="width:100%;"></div><a name="shoutboxbottom"></a><br/>';
+			sbcontent = document.getElementById('innershoutboxcontent');
+			
+			setTimeout('shoutboxTimer()', 100);
+			
+			
+			function shoutboxTimer() {
+				this.timerPending = false;
+				sendShoutboxAjaxRequest();
+				return;
+			}
+			
+			
+			function sendShoutboxAjaxRequest() {
+				if(this.ajaxRequest == null) {
+					var appendmessage = '';
+					
+					if(this.queuedmessage != null) {
+						appendmessage = '&message=' + escape(this.queuedmessage);
+						this.queuedmessage = null;
+					}
+					
+					this.ajaxRequest = new AjaxRequest();
+					return this.ajaxRequest.openPost(
+										'index.php?page=ShoutboxContent&output=xml',
+										'since=' + this.lastmessage + appendmessage,
+										function() { handleShoutboxContentRequest(); }
+					);
+				}
+				
+				return true;
+			}
+			
+			function sendShoutboxMessage() {
+				this.queuedmessage = document.shoutboxInputform.message.value;
+				document.shoutboxInputform.message.value='';
+				return !sendShoutboxAjaxRequest();
+			}
+			
+			function handleShoutboxContentRequest() {
+				if (this.ajaxRequest && this.ajaxRequest.xmlHttpRequest.readyState == 4) {
+					if(this.ajaxRequest.xmlHttpRequest.status == 200 && this.ajaxRequest.xmlHttpRequest.responseXML) {
+						var lines = this.ajaxRequest.xmlHttpRequest.responseXML.getElementsByTagName('lines');
+						
+						if(lines.length > 0) {
+							for(var i=0; i<lines[0].childNodes.length; i++) {
+								var line = lines[0].childNodes[i];
+								
+								if(line.childNodes.length > 0) {
+									var node = line.childNodes[0];
+									
+									if(node.nodeType == 3 || node.nodeType == 4) {
+										if(line.tagName == 'line') {
+											// if SHOUTBOX_MESSAGEORDER=='ASC'}
+											//	this.sbcontent.innerHTML = this.sbcontent.innerHTML + node.nodeValue + '<br/>';
+											// else}
+												this.sbcontent.innerHTML = node.nodeValue + '<br/>' + this.sbcontent.innerHTML;
+											// /if}
+										}
+										else if(line.tagName == 'last') {
+											this.lastmessage = node.nodeValue;
+										}
+									}
+								}
+							}
+						}
+						
+						// if SHOUTBOX_MESSAGEORDER=="ASC"}
+							// scroll the frame to the bottom
+						//	window.location.href = '#shoutboxbottom';
+						// /if}
+						
+						// request was successfully handled...
+						this.ajaxRequest = null;
+						
+						// if a message was queued, send another request immediately
+						if(this.queuedmessage) {
+							sendShoutboxAjaxRequest();
+						}
+						else if(!this.timerPending) {
+							this.timerPending = true;
+							setTimeout('shoutboxTimer()', {SHOUTBOX_RELOADTIME*1000});
+						}
+					}
+				}
+				
+				return;
+			}
+		
+		//]]>
+	</script>
+	<form name="shoutboxInputform" action="index.php" method="post" target="chat" onsubmit="return sendShoutboxMessage();">
+		<input type="hidden" name="page" value="ShoutboxContent">
+		<noscript><span>[<a href="index.php?page=ShoutboxContent" target="chat">aktualisieren</a>]</noscript>
+			<b>{if $this->getUser()->userID}{$this->getUser()->username}{else}{lang}net.northshirebund.wbb.shoutbox.guest{/lang}{/if}</b> &raquo;
+			<input type=text name="message" size="60" class="input">
+			<input type=submit value="Senden" class="input">
+		</span>
+	</form>
+{/if}
+</td></tr>
+</table>